mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
omxvideoenc: Switch to Idle first and wait before switching to Loaded and deallocating buffers
Allocating buffers before the Idle state is reached can lead to crashes.
This commit is contained in:
parent
ab9ce7db7d
commit
e364088596
1 changed files with 4 additions and 0 deletions
|
@ -404,6 +404,10 @@ gst_omx_video_enc_close (GstOMXVideoEnc * self)
|
|||
|
||||
state = gst_omx_component_get_state (self->component, 0);
|
||||
if (state > OMX_StateLoaded || state == OMX_StateInvalid) {
|
||||
if (state > OMX_StateIdle) {
|
||||
gst_omx_component_set_state (self->component, OMX_StateIdle);
|
||||
gst_omx_component_get_state (self->component, 5 * GST_SECOND);
|
||||
}
|
||||
gst_omx_component_set_state (self->component, OMX_StateLoaded);
|
||||
gst_omx_port_deallocate_buffers (self->in_port);
|
||||
gst_omx_port_deallocate_buffers (self->out_port);
|
||||
|
|
Loading…
Reference in a new issue