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 321609 - [mpegstream] flush packetizer cache on discontinuities
[mpegstream] flush packetizer cache on discontinuities
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-ugly
git master
Other Linux
: Normal enhancement
: 0.10.4
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-11-16 15:13 UTC by Josef Zlomek
Modified: 2006-06-23 12:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
flush packetizer cache (3.03 KB, patch)
2005-11-16 15:14 UTC, Josef Zlomek
none Details | Review

Description Josef Zlomek 2005-11-16 15:13:39 UTC
The attached patch ports to gstreamer 0.9 the flushing of packetizer cache when
newsegment event is received.
Comment 1 Josef Zlomek 2005-11-16 15:14:07 UTC
Created attachment 54828 [details] [review]
flush packetizer cache
Comment 2 Tim-Philipp Müller 2005-11-20 22:18:14 UTC
Shouldn't this be done when receiving a GST_EVENT_FLUSH_START rather than
_NEWSEGMENT?
Comment 3 Josef Zlomek 2005-11-21 07:20:03 UTC
In GStreamer plugins 0.8, mpegstream was flushing bytestream on DISCONT event.
I think the purpose of this is to flush data when some packet was missing.
Because of that there was a beginning of a chunk in the cache, and the chunk
would not be completed because of the missing packet.
Comment 4 Tim-Philipp Müller 2006-01-19 15:25:52 UTC
Adding Martin Soto to CC list
Comment 5 Wim Taymans 2006-03-07 09:38:08 UTC
internal cache of bytes are flushed on two conditions:

FLUSH_STOP: this is within the STREAM_LOCK so that you can be sure no processing is done.
BUFFER_DISCONT: a flag on the buffer indicating a discontinuity (after a seek or packet loss of some sort).

In no case triggers the newsegment a flush. It could indeed very well be that the newsegment just indicates a new playback rate without any gap or discontuity.

Problem right now is that the DISCONT flag is not set on buffers in a lot of cases. (even basesrc does not set DISCONT after a seek..)
Comment 6 Wim Taymans 2006-06-01 12:08:30 UTC
need a new patch.
Comment 7 Tim-Philipp Müller 2006-06-23 12:26:13 UTC
 2006-06-23  Tim-Philipp Müller  <tim at centricular dot net>

        * gst/mpegstream/gstmpegpacketize.c:
        (gst_mpeg_packetize_flush_cache), (gst_mpeg_packetize_put):
        * gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_chain):
          Also flush packetizer cache when we get a buffer that has the
          DISCONT flag set; update current byte position from buffer
          offset after a flush.

 2006-06-23  Tim-Philipp Müller  <tim at centricular dot net>

        * gst/mpegstream/gstmpegpacketize.c: (gst_mpeg_packetize_new),
        (gst_mpeg_packetize_flush_cache), (gst_mpeg_packetize_destroy),
        (gst_mpeg_packetize_read):
        * gst/mpegstream/gstmpegpacketize.h:
        * gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_process_event),
        (gst_mpeg_parse_change_state):
          Flush packetizer cache when we get a FLUSH_STOP event;
          remove unused source pad member from packetizer; add debug
          category for packetizer.