mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
Wait at most 100ms for dequeueing a buffer, and retry after that
Some codecs don't fail the dequeueing if the codec is flushed, causing deadlocks when shutting down the element.
This commit is contained in:
parent
9a034f2beb
commit
562b033872
2 changed files with 12 additions and 4 deletions
|
@ -491,7 +491,9 @@ retry:
|
||||||
} else { */
|
} else { */
|
||||||
GST_DEBUG_OBJECT (self, "Waiting for available output buffer");
|
GST_DEBUG_OBJECT (self, "Waiting for available output buffer");
|
||||||
GST_AUDIO_DECODER_STREAM_UNLOCK (self);
|
GST_AUDIO_DECODER_STREAM_UNLOCK (self);
|
||||||
idx = gst_amc_codec_dequeue_output_buffer (self->codec, &buffer_info, -1);
|
/* Wait at most 100ms here, some codecs don't fail dequeueing if
|
||||||
|
* the codec is flushing, causing deadlocks during shutdown */
|
||||||
|
idx = gst_amc_codec_dequeue_output_buffer (self->codec, &buffer_info, 100000);
|
||||||
GST_AUDIO_DECODER_STREAM_LOCK (self);
|
GST_AUDIO_DECODER_STREAM_LOCK (self);
|
||||||
/*} */
|
/*} */
|
||||||
|
|
||||||
|
@ -991,7 +993,9 @@ gst_amc_audio_dec_handle_frame (GstAudioDecoder * decoder, GstBuffer * inbuf)
|
||||||
* _loop() can't call _finish_frame() and we might block forever
|
* _loop() can't call _finish_frame() and we might block forever
|
||||||
* because no input buffers are released */
|
* because no input buffers are released */
|
||||||
GST_AUDIO_DECODER_STREAM_UNLOCK (self);
|
GST_AUDIO_DECODER_STREAM_UNLOCK (self);
|
||||||
idx = gst_amc_codec_dequeue_input_buffer (self->codec, -1);
|
/* Wait at most 100ms here, some codecs don't fail dequeueing if
|
||||||
|
* the codec is flushing, causing deadlocks during shutdown */
|
||||||
|
idx = gst_amc_codec_dequeue_input_buffer (self->codec, 100000);
|
||||||
GST_AUDIO_DECODER_STREAM_LOCK (self);
|
GST_AUDIO_DECODER_STREAM_LOCK (self);
|
||||||
|
|
||||||
if (idx < 0) {
|
if (idx < 0) {
|
||||||
|
|
|
@ -875,7 +875,9 @@ retry:
|
||||||
} else { */
|
} else { */
|
||||||
GST_DEBUG_OBJECT (self, "Waiting for available output buffer");
|
GST_DEBUG_OBJECT (self, "Waiting for available output buffer");
|
||||||
GST_VIDEO_DECODER_STREAM_UNLOCK (self);
|
GST_VIDEO_DECODER_STREAM_UNLOCK (self);
|
||||||
idx = gst_amc_codec_dequeue_output_buffer (self->codec, &buffer_info, -1);
|
/* Wait at most 100ms here, some codecs don't fail dequeueing if
|
||||||
|
* the codec is flushing, causing deadlocks during shutdown */
|
||||||
|
idx = gst_amc_codec_dequeue_output_buffer (self->codec, &buffer_info, 100000);
|
||||||
GST_VIDEO_DECODER_STREAM_LOCK (self);
|
GST_VIDEO_DECODER_STREAM_LOCK (self);
|
||||||
/*} */
|
/*} */
|
||||||
|
|
||||||
|
@ -1359,7 +1361,9 @@ gst_amc_video_dec_handle_frame (GstVideoDecoder * decoder,
|
||||||
* _loop() can't call _finish_frame() and we might block forever
|
* _loop() can't call _finish_frame() and we might block forever
|
||||||
* because no input buffers are released */
|
* because no input buffers are released */
|
||||||
GST_VIDEO_DECODER_STREAM_UNLOCK (self);
|
GST_VIDEO_DECODER_STREAM_UNLOCK (self);
|
||||||
idx = gst_amc_codec_dequeue_input_buffer (self->codec, -1);
|
/* Wait at most 100ms here, some codecs don't fail dequeueing if
|
||||||
|
* the codec is flushing, causing deadlocks during shutdown */
|
||||||
|
idx = gst_amc_codec_dequeue_input_buffer (self->codec, 100000);
|
||||||
GST_VIDEO_DECODER_STREAM_LOCK (self);
|
GST_VIDEO_DECODER_STREAM_LOCK (self);
|
||||||
|
|
||||||
if (idx < 0) {
|
if (idx < 0) {
|
||||||
|
|
Loading…
Reference in a new issue