adaptivedemux: improved error message if availabilityStartTime is missing for a live...
authorFlorin Apostol <florin.apostol@oregan.net>
Wed, 4 Nov 2015 18:15:24 +0000 (18:15 +0000)
committerThiago Santos <thiagoss@osg.samsung.com>
Mon, 18 Jan 2016 18:12:07 +0000 (15:12 -0300)
For a live mpd, if availabilityStartTime is missing, adaptive demux asserts
with: Unexpected critical/warning: gst_date_time_to_g_date_time: assertion
'datetime != NULL' failed.

This patch improves the error message to:
Unexpected critical/warning: gst_mpd_client_seek_to_time: assertion
'client->mpd_node->availabilityStartTime != NULL' failed

https://bugzilla.gnome.org/show_bug.cgi?id=757602

ext/dash/gstmpdparser.c

index 8510999..ffb2d24 100644 (file)
@@ -5795,14 +5795,17 @@ gst_mpd_client_get_next_segment_availability_end_time (GstMpdClient * client,
 gboolean
 gst_mpd_client_seek_to_time (GstMpdClient * client, GDateTime * time)
 {
-  GDateTime *start =
-      gst_date_time_to_g_date_time (client->mpd_node->availabilityStartTime);
+  GDateTime *start;
   GTimeSpan ts_microseconds;
   GstClockTime ts;
   gboolean ret = TRUE;
   GList *stream;
 
-  g_return_val_if_fail (gst_mpd_client_is_live (client), 0);
+  g_return_val_if_fail (gst_mpd_client_is_live (client), FALSE);
+  g_return_val_if_fail (client->mpd_node->availabilityStartTime != NULL, FALSE);
+
+  start =
+      gst_date_time_to_g_date_time (client->mpd_node->availabilityStartTime);
 
   ts_microseconds = g_date_time_difference (time, start);
   g_date_time_unref (start);