mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 17:20:36 +00:00
omxvideoenc: Improve EOS handling
If downstream return UNEXPECTED we should still signal the drain cond because nothing will trigger this again later.
This commit is contained in:
parent
1b7742ca98
commit
56bcfc0397
1 changed files with 7 additions and 2 deletions
|
@ -840,15 +840,20 @@ gst_omx_video_enc_loop (GstOMXVideoEnc * self)
|
||||||
}
|
}
|
||||||
GST_BASE_VIDEO_CODEC_STREAM_UNLOCK (self);
|
GST_BASE_VIDEO_CODEC_STREAM_UNLOCK (self);
|
||||||
|
|
||||||
if (flow_ret == GST_FLOW_OK && (buf->omx_buf->nFlags & OMX_BUFFERFLAG_EOS)) {
|
if ((flow_ret == GST_FLOW_OK && (buf->omx_buf->nFlags & OMX_BUFFERFLAG_EOS))
|
||||||
|
|| flow_ret == GST_FLOW_UNEXPECTED) {
|
||||||
g_mutex_lock (self->drain_lock);
|
g_mutex_lock (self->drain_lock);
|
||||||
if (self->draining) {
|
if (self->draining) {
|
||||||
|
GST_DEBUG_OBJECT (self, "Drained");
|
||||||
self->draining = FALSE;
|
self->draining = FALSE;
|
||||||
g_cond_broadcast (self->drain_cond);
|
g_cond_broadcast (self->drain_cond);
|
||||||
} else {
|
} else if (flow_ret == GST_FLOW_OK) {
|
||||||
|
GST_DEBUG_OBJECT (self, "Component signalled EOS");
|
||||||
flow_ret = GST_FLOW_UNEXPECTED;
|
flow_ret = GST_FLOW_UNEXPECTED;
|
||||||
}
|
}
|
||||||
g_mutex_unlock (self->drain_lock);
|
g_mutex_unlock (self->drain_lock);
|
||||||
|
} else {
|
||||||
|
GST_DEBUG_OBJECT (self, "Finished frame: %s", gst_flow_get_name (flow_ret));
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_omx_port_release_buffer (port, buf);
|
gst_omx_port_release_buffer (port, buf);
|
||||||
|
|
Loading…
Reference in a new issue