mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-28 03:00:35 +00:00
mftransform: Fix deadlock when MFT requests processing output twice
This sequence of event/data flow might happen 1) Initially we have one pending output event 1-1) Then, process the pending output data 2) No pending input event, then we should wait new pending input event 2-1) Wakeup by new pending event (but it's pending output event) In above case, MFT will not report new pending input event if pending output is not processed. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1325>
This commit is contained in:
parent
309c679c43
commit
52a82f5b84
1 changed files with 10 additions and 0 deletions
|
@ -539,6 +539,8 @@ gst_mf_transform_process_input (GstMFTransform * object,
|
|||
gst_mf_transform_drain_all_events (object);
|
||||
|
||||
if (object->hardware) {
|
||||
process_output:
|
||||
/* Process pending output first */
|
||||
while (object->pending_have_output > 0) {
|
||||
GST_TRACE_OBJECT (object,
|
||||
"Pending have output %d", object->pending_have_output);
|
||||
|
@ -581,6 +583,14 @@ gst_mf_transform_process_input (GstMFTransform * object,
|
|||
GST_DEBUG_OBJECT (object, "Unhandled event %d", type);
|
||||
break;
|
||||
}
|
||||
|
||||
/* If MFT doesn't want to handle input yet but we have pending output,
|
||||
* process output again */
|
||||
if (object->pending_have_output > 0 && object->pending_need_input == 0) {
|
||||
GST_TRACE_OBJECT (object,
|
||||
"Only have pending output, process output again");
|
||||
goto process_output;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue