avidemux: correct duration for audio VBR buffers in pull mode
authorMark Nauwelaerts <mnauw@users.sourceforge.net>
Sun, 10 Feb 2013 14:10:32 +0000 (15:10 +0100)
committerMark Nauwelaerts <mnauw@users.sourceforge.net>
Sun, 10 Feb 2013 14:10:32 +0000 (15:10 +0100)
gst/avi/gstavidemux.c

index a68b70f..d0df79e 100644 (file)
@@ -1370,9 +1370,13 @@ gst_avi_demux_get_buffer_info (GstAviDemux * avi, GstAviStream * stream,
       if (timestamp)
         *timestamp =
             avi_stream_convert_frames_to_time_unchecked (stream, entry->total);
-      if (ts_end)
+      if (ts_end) {
+        gint size = 1;
+        if (G_LIKELY (entry_n + 1 < stream->idx_n))
+          size = stream->index[entry_n + 1].total - entry->total;
         *ts_end = avi_stream_convert_frames_to_time_unchecked (stream,
-            entry->total + 1);
+            entry->total + size);
+      }
     } else {
       if (timestamp)
         *timestamp =