From 2918dff2e0b8bf4566d136e7abb581a8f495d73d Mon Sep 17 00:00:00 2001 From: Florin Apostol Date: Wed, 4 Nov 2015 18:15:24 +0000 Subject: [PATCH] adaptivedemux: improved error message if availabilityStartTime is missing for a live stream 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 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ext/dash/gstmpdparser.c b/ext/dash/gstmpdparser.c index 851099996f..ffb2d240e4 100644 --- a/ext/dash/gstmpdparser.c +++ b/ext/dash/gstmpdparser.c @@ -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);