omxvideodec: Fix segment seek

On segment seek, unlike EOS, we drain, but we cannot expect a flush
later to reset the decoder state. As a side effect, the decoder would
remain in EOS state and ignore any new incoming buffers.

To fix this, we call _flush() inside the _drain() function, and
_finish() becomes what _drain() was before. This way, for _finish() (the
    eos case) we only drain, for _drain() triggered by segment seek or new
caps, we also reset the decoder state so it's ready to accept buffers.

https://bugzilla.gnome.org/show_bug.cgi?id=785237
This commit is contained in:
Nicolas Dufresne 2017-07-21 11:52:00 -04:00
parent 3f5d98a360
commit 64f7f781d8

View file

@ -2019,7 +2019,6 @@ gst_omx_video_dec_set_format (GstVideoDecoder * decoder,
GST_DEBUG_OBJECT (self, "Need to disable and drain decoder");
gst_omx_video_dec_drain (decoder);
gst_omx_video_dec_flush (decoder);
gst_omx_port_set_flushing (out_port, 5 * GST_SECOND, TRUE);
if (klass->cdata.hacks & GST_OMX_HACK_NO_COMPONENT_RECONFIGURE) {
@ -2593,13 +2592,16 @@ release_error:
}
static GstFlowReturn
gst_omx_video_dec_finish (GstVideoDecoder * decoder)
gst_omx_video_dec_drain (GstVideoDecoder * decoder)
{
return gst_omx_video_dec_drain (decoder);
gboolean ret;
ret = gst_omx_video_dec_finish (decoder);
gst_omx_video_dec_flush (decoder);
return ret;
}
static GstFlowReturn
gst_omx_video_dec_drain (GstVideoDecoder * decoder)
gst_omx_video_dec_finish (GstVideoDecoder * decoder)
{
GstOMXVideoDec *self;
GstOMXVideoDecClass *klass;