omxvideodec: Only drain the component a single time and only after processing started

This commit is contained in:
Sebastian Dröge 2011-11-04 09:43:32 +01:00
parent 3a17d11109
commit d5371b9208

View file

@ -1054,7 +1054,11 @@ gst_omx_video_dec_set_format (GstBaseVideoDecoder * decoder,
}
if (needs_disable && is_format_change) {
gst_omx_video_dec_drain (self);
if (self->started) {
gst_omx_video_dec_drain (self);
self->started = FALSE;
}
if (klass->hacks & GST_OMX_HACK_NO_COMPONENT_RECONFIGURE) {
GST_BASE_VIDEO_CODEC_STREAM_UNLOCK (self);
gst_omx_video_dec_stop (GST_BASE_VIDEO_DECODER (self));
@ -1174,6 +1178,7 @@ gst_omx_video_dec_reset (GstBaseVideoDecoder * decoder)
if (self->started) {
gst_omx_video_dec_drain (self);
self->started = FALSE;
gst_omx_port_set_flushing (self->in_port, TRUE);
gst_omx_port_set_flushing (self->out_port, TRUE);
@ -1426,6 +1431,8 @@ gst_omx_video_dec_drain (GstOMXVideoDec * self)
GST_DEBUG_OBJECT (self, "Draining component");
g_assert (self->started);
/* Send an EOS buffer to the component and let the base
* class drop the EOS event. We will send it later when
* the EOS buffer arrives on the output port. */