hlsdemux: don't warn about duration if it is not known
authorThiago Santos <thiagoss@osg.samsung.com>
Thu, 6 Aug 2015 14:30:04 +0000 (11:30 -0300)
committerThiago Santos <thiagoss@osg.samsung.com>
Fri, 7 Aug 2015 14:24:52 +0000 (11:24 -0300)
And also print the values in case of warning

ext/hls/m3u8.c

index 5e78d948e29af7e376a2f84194158d443246127e..1273b71016fb21b9471734114c1488be8c9df1d0 100755 (executable)
@@ -519,8 +519,11 @@ gst_m3u8_update (GstM3U8Client * client, GstM3U8 * self, gchar * data,
         goto next_line;
       }
       duration = fval * (gdouble) GST_SECOND;
-      if (duration > self->targetduration)
-        GST_WARNING ("EXTINF duration > TARGETDURATION");
+      if (self->targetduration > 0 && duration > self->targetduration) {
+        GST_WARNING ("EXTINF duration (%" GST_TIME_FORMAT
+            ") > TARGETDURATION (%" GST_TIME_FORMAT ")",
+            GST_TIME_ARGS (duration), GST_TIME_ARGS (self->targetduration));
+      }
       if (!data || *data != ',')
         goto next_line;
       data = g_utf8_next_char (data);