After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 781319 - qtdemux: Reset adapter in more discontinuity cases
qtdemux: Reset adapter in more discontinuity cases
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
unspecified
Other All
: Normal normal
: 1.11.91
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-04-14 15:06 UTC by Edward Hervey
Modified: 2017-04-18 09:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
qtdemux: Reset adapter in more discontinuity cases (1.61 KB, patch)
2017-04-14 15:06 UTC, Edward Hervey
reviewed Details | Review
qtdemux: Reset adapter in more discontinuity cases (1.54 KB, patch)
2017-04-14 16:29 UTC, Edward Hervey
committed Details | Review

Description Edward Hervey 2017-04-14 15:06:25 UTC
See commit
Comment 1 Edward Hervey 2017-04-14 15:06:29 UTC
Created attachment 349870 [details] [review]
qtdemux: Reset adapter in more discontinuity cases

In push mode we process as much as possible in the adapter. When we receive
a DISCONT buffer which we can't match to an actual sample (based on the existing
sample table) and there is still data remaining in the incoming adapter,there is
one of two cases happening:
1) We are doing reverse playback, in which case we should flush out all pending
  data
2) We have leftover data from the previous incoming buffer... which we can't do
  anything about.

For the second case, make sure we flush out the remaining data so that we can start
parsing again from scratch.
Comment 2 Sebastian Dröge (slomo) 2017-04-14 16:05:47 UTC
Review of attachment 349870 [details] [review]:

::: gst/isomp4/qtdemux.c
@@ +6332,3 @@
         demux->offset = GST_BUFFER_OFFSET (inbuf);
+        if (!demux->fragmented || demux->segment.rate > 0)
+          gst_adapter_clear (demux->adapter);

Shouldn't we clear the adapter here in any case?
Comment 3 Edward Hervey 2017-04-14 16:29:47 UTC
Created attachment 349872 [details] [review]
qtdemux: Reset adapter in more discontinuity cases

In push mode we process as much as possible in the adapter. When we receive
a DISCONT buffer which we can't match to an actual sample (based on the existing
sample table) and there is still data remaining in the incoming adapter,there is
one of two cases happening:
1) We are doing reverse playback, in which case we should flush out all pending
  data
2) We have leftover data from the previous incoming buffer... which we can't do
  anything about.

For the second case, make sure we flush out the remaining data so that we can start
parsing again from scratch.
Comment 4 Sebastian Dröge (slomo) 2017-04-14 16:38:27 UTC
Review of attachment 349872 [details] [review]:

Looks good to me
Comment 5 Edward Hervey 2017-04-18 09:54:43 UTC
commit 58e3033747b0e96d7d4d120141707525587dbdd2
Author: Edward Hervey <edward@centricular.com>
Date:   Fri Apr 14 17:01:49 2017 +0200

    qtdemux: Reset adapter in more discontinuity cases
    
    In push mode we process as much as possible in the adapter. When we receive
    a DISCONT buffer which we can't match to an actual sample (based on the existing
    sample table) and there is still data remaining in the incoming adapter,there is
    one of two cases happening:
    1) We are doing reverse playback, in which case we should flush out all pending
      data
    2) We have leftover data from the previous incoming buffer... which we can't do
      anything about.
    
    For the second case, make sure we flush out the remaining data so that we can start
    parsing again from scratch.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=781319