mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-23 23:58:17 +00:00
faad: refactor some partial stream reset
This commit is contained in:
parent
f6ea217792
commit
96ad733207
1 changed files with 16 additions and 8 deletions
|
@ -229,6 +229,16 @@ gst_faad_init (GstFaad * faad)
|
|||
gst_faad_reset (faad);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_faad_reset_stream_state (GstFaad * faad)
|
||||
{
|
||||
faad->sync_flush = 0;
|
||||
gst_adapter_clear (faad->adapter);
|
||||
clear_queued (faad);
|
||||
if (faad->handle)
|
||||
faacDecPostSeekReset (faad->handle, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_faad_reset (GstFaad * faad)
|
||||
{
|
||||
|
@ -244,11 +254,11 @@ gst_faad_reset (GstFaad * faad)
|
|||
faad->bytes_in = 0;
|
||||
faad->sum_dur_out = 0;
|
||||
faad->error_count = 0;
|
||||
faad->sync_flush = 0;
|
||||
gst_adapter_clear (faad->adapter);
|
||||
clear_queued (faad);
|
||||
|
||||
gst_faad_reset_stream_state (faad);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
gst_faad_finalize (GObject * object)
|
||||
{
|
||||
|
@ -613,13 +623,12 @@ gst_faad_sink_event (GstPad * pad, GstEvent * event)
|
|||
|
||||
switch (GST_EVENT_TYPE (event)) {
|
||||
case GST_EVENT_FLUSH_STOP:
|
||||
gst_adapter_clear (faad->adapter);
|
||||
clear_queued (faad);
|
||||
gst_faad_reset_stream_state (faad);
|
||||
res = gst_pad_push_event (faad->srcpad, event);
|
||||
break;
|
||||
case GST_EVENT_EOS:
|
||||
gst_faad_drain (faad);
|
||||
gst_adapter_clear (faad->adapter);
|
||||
gst_faad_reset_stream_state (faad);
|
||||
res = gst_pad_push_event (faad->srcpad, event);
|
||||
break;
|
||||
case GST_EVENT_NEWSEGMENT:
|
||||
|
@ -997,8 +1006,7 @@ gst_faad_chain (GstPad * pad, GstBuffer * buffer)
|
|||
|
||||
if (GST_BUFFER_IS_DISCONT (buffer)) {
|
||||
gst_faad_drain (faad);
|
||||
faacDecPostSeekReset (faad->handle, 0);
|
||||
gst_adapter_clear (faad->adapter);
|
||||
gst_faad_reset_stream_state (faad);
|
||||
faad->discont = TRUE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue