Commit 87d6c265 authored by Sebastian Dröge's avatar Sebastian Dröge
Browse files

video{en,de}coder: Call reset() before the start() vfunc

This makes sure that the element is in the same state before start() is called
the very first time and every future call after the element was used already.

Also it ensure that we always have a clean state before start(), cleaned the
same way in every case.
parent aae64009
......@@ -2275,12 +2275,13 @@ gst_video_decoder_change_state (GstElement * element, GstStateChange transition)
goto open_failed;
break;
case GST_STATE_CHANGE_READY_TO_PAUSED:
/* Initialize device/library if needed */
if (decoder_class->start && !decoder_class->start (decoder))
goto start_failed;
GST_VIDEO_DECODER_STREAM_LOCK (decoder);
gst_video_decoder_reset (decoder, TRUE, TRUE);
GST_VIDEO_DECODER_STREAM_UNLOCK (decoder);
/* Initialize device/library if needed */
if (decoder_class->start && !decoder_class->start (decoder))
goto start_failed;
break;
default:
break;
......
......@@ -1411,12 +1411,13 @@ gst_video_encoder_change_state (GstElement * element, GstStateChange transition)
goto open_failed;
break;
case GST_STATE_CHANGE_READY_TO_PAUSED:
/* Initialize device/library if needed */
if (encoder_class->start && !encoder_class->start (encoder))
goto start_failed;
GST_VIDEO_ENCODER_STREAM_LOCK (encoder);
gst_video_encoder_reset (encoder, TRUE);
GST_VIDEO_ENCODER_STREAM_UNLOCK (encoder);
/* Initialize device/library if needed */
if (encoder_class->start && !encoder_class->start (encoder))
goto start_failed;
break;
default:
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment