mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-22 14:06:23 +00:00
audiodecoder: Don't drain and flush on SEGMENT events.
As was done for the base video decoder in commit 695675, don't flush out the decoder on a new SEGMENT event. Segment events may be a new segment, but are also often segment updates for the current segment where the old data should be kept. For new segments, a STREAM_START event will already trigger a drain, but make sure to flush any remaining partial data then as well. https://bugzilla.gnome.org/show_bug.cgi?id=734666
This commit is contained in:
parent
8cab1ab5fc
commit
02d1ab0d1c
1 changed files with 10 additions and 13 deletions
|
@ -1983,7 +1983,10 @@ gst_audio_decoder_sink_eventfunc (GstAudioDecoder * dec, GstEvent * event)
|
|||
switch (GST_EVENT_TYPE (event)) {
|
||||
case GST_EVENT_STREAM_START:
|
||||
GST_AUDIO_DECODER_STREAM_LOCK (dec);
|
||||
/* finish any data in current segment and clear the decoder
|
||||
* to be ready for new stream data */
|
||||
gst_audio_decoder_drain (dec);
|
||||
gst_audio_decoder_flush (dec, FALSE);
|
||||
|
||||
GST_DEBUG_OBJECT (dec, "received STREAM_START. Clearing taglist");
|
||||
/* Flush our merged taglist after a STREAM_START */
|
||||
|
@ -2038,19 +2041,13 @@ gst_audio_decoder_sink_eventfunc (GstAudioDecoder * dec, GstEvent * event)
|
|||
}
|
||||
}
|
||||
|
||||
/* finish current segment */
|
||||
gst_audio_decoder_drain (dec);
|
||||
|
||||
{
|
||||
/* prepare for next one */
|
||||
gst_audio_decoder_flush (dec, FALSE);
|
||||
/* and that's where we time from,
|
||||
* in case upstream does not come up with anything better
|
||||
* (e.g. upstream BYTE) */
|
||||
if (format != GST_FORMAT_TIME) {
|
||||
dec->priv->base_ts = seg.start;
|
||||
dec->priv->samples = 0;
|
||||
}
|
||||
/* prepare for next segment */
|
||||
/* Use the segment start as a base timstamp
|
||||
* in case upstream does not come up with anything better
|
||||
* (e.g. upstream BYTE) */
|
||||
if (format != GST_FORMAT_TIME) {
|
||||
dec->priv->base_ts = seg.start;
|
||||
dec->priv->samples = 0;
|
||||
}
|
||||
|
||||
/* and follow along with segment */
|
||||
|
|
Loading…
Reference in a new issue