GNOME Bugzilla – Bug 321609
[mpegstream] flush packetizer cache on discontinuities
Last modified: 2006-06-23 12:26:13 UTC
The attached patch ports to gstreamer 0.9 the flushing of packetizer cache when newsegment event is received.
Created attachment 54828 [details] [review] flush packetizer cache
Shouldn't this be done when receiving a GST_EVENT_FLUSH_START rather than _NEWSEGMENT?
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.
Adding Martin Soto to CC list
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..)
need a new patch.
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.