opusdec: interpret zero duration as unknown
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Thu, 6 Oct 2016 10:44:11 +0000 (11:44 +0100)
committerSebastian Dröge <sebastian@centricular.com>
Tue, 1 Nov 2016 17:58:42 +0000 (19:58 +0200)
This fixes missing audio when we get buffers with zero
duration, denoting unknown duration. When several such
buffers are received in a row, they're all at the same
timestamp, with zero duration.

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

ext/opus/gstopusdec.c

index f840c6b..304e6bf 100644 (file)
@@ -540,7 +540,7 @@ opus_dec_chain_parse_data (GstOpusDec * dec, GstBuffer * buffer)
     GstClockTime aligned_missing_duration;
     GstClockTime missing_duration = GST_BUFFER_DURATION (bufd);
 
-    if (!GST_CLOCK_TIME_IS_VALID (missing_duration)) {
+    if (!GST_CLOCK_TIME_IS_VALID (missing_duration) || missing_duration == 0) {
       if (GST_CLOCK_TIME_IS_VALID (dec->last_known_buffer_duration)) {
         missing_duration = dec->last_known_buffer_duration;
         GST_WARNING_OBJECT (dec,