mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-08 00:16:13 +00:00
basevideoencoder: handle failures in start() and stop()
This commit is contained in:
parent
f27ca88ecc
commit
247e410df0
1 changed files with 12 additions and 2 deletions
|
@ -899,7 +899,8 @@ gst_base_video_encoder_change_state (GstElement * element,
|
||||||
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
||||||
gst_base_video_encoder_reset (base_video_encoder);
|
gst_base_video_encoder_reset (base_video_encoder);
|
||||||
if (base_video_encoder_class->start) {
|
if (base_video_encoder_class->start) {
|
||||||
base_video_encoder_class->start (base_video_encoder);
|
if (!base_video_encoder_class->start (base_video_encoder))
|
||||||
|
goto start_error;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -912,7 +913,8 @@ gst_base_video_encoder_change_state (GstElement * element,
|
||||||
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
||||||
gst_base_video_encoder_reset (base_video_encoder);
|
gst_base_video_encoder_reset (base_video_encoder);
|
||||||
if (base_video_encoder_class->stop) {
|
if (base_video_encoder_class->stop) {
|
||||||
base_video_encoder_class->stop (base_video_encoder);
|
if (!base_video_encoder_class->stop (base_video_encoder))
|
||||||
|
goto stop_error;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -920,6 +922,14 @@ gst_base_video_encoder_change_state (GstElement * element,
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
start_error:
|
||||||
|
GST_WARNING_OBJECT (base_video_encoder, "failed to start");
|
||||||
|
return GST_STATE_CHANGE_FAILURE;
|
||||||
|
|
||||||
|
stop_error:
|
||||||
|
GST_WARNING_OBJECT (base_video_encoder, "failed to stop");
|
||||||
|
return GST_STATE_CHANGE_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue