mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
videoencoder/decoder: Call reset() before start() too
This commit is contained in:
parent
ef5c6d351f
commit
9259ee6729
2 changed files with 10 additions and 1 deletions
|
@ -2033,6 +2033,10 @@ gst_video_decoder_change_state (GstElement * element, GstStateChange transition)
|
|||
goto open_failed;
|
||||
break;
|
||||
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
||||
GST_VIDEO_DECODER_STREAM_LOCK (decoder);
|
||||
gst_video_decoder_reset (decoder, TRUE);
|
||||
GST_VIDEO_DECODER_STREAM_UNLOCK (decoder);
|
||||
|
||||
/* Initialize device/library if needed */
|
||||
if (decoder_class->start && !decoder_class->start (decoder))
|
||||
goto start_failed;
|
||||
|
|
|
@ -1365,6 +1365,9 @@ gst_video_encoder_change_state (GstElement * element, GstStateChange transition)
|
|||
break;
|
||||
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
||||
/* Initialize device/library if needed */
|
||||
GST_VIDEO_ENCODER_STREAM_LOCK (encoder);
|
||||
gst_video_encoder_reset (encoder, TRUE);
|
||||
GST_VIDEO_ENCODER_STREAM_UNLOCK (encoder);
|
||||
if (encoder_class->start && !encoder_class->start (encoder))
|
||||
goto start_failed;
|
||||
break;
|
||||
|
@ -1376,9 +1379,11 @@ gst_video_encoder_change_state (GstElement * element, GstStateChange transition)
|
|||
|
||||
switch (transition) {
|
||||
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
||||
gst_video_encoder_reset (encoder, TRUE);
|
||||
if (encoder_class->stop && !encoder_class->stop (encoder))
|
||||
goto stop_failed;
|
||||
GST_VIDEO_ENCODER_STREAM_LOCK (encoder);
|
||||
gst_video_encoder_reset (encoder, TRUE);
|
||||
GST_VIDEO_ENCODER_STREAM_UNLOCK (encoder);
|
||||
break;
|
||||
case GST_STATE_CHANGE_READY_TO_NULL:
|
||||
/* close device/library if needed */
|
||||
|
|
Loading…
Reference in a new issue