From d2aff4ecd386b58036e23836f72a753de641246b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 7 Sep 2012 13:44:19 +0200 Subject: [PATCH] Wait at most 0.5 seconds for getting an input buffer for EOS --- sys/androidmedia/gstamcvideodec.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/androidmedia/gstamcvideodec.c b/sys/androidmedia/gstamcvideodec.c index b5b741dd0e..e3376f1b7b 100644 --- a/sys/androidmedia/gstamcvideodec.c +++ b/sys/androidmedia/gstamcvideodec.c @@ -1257,8 +1257,9 @@ gst_amc_video_dec_finish (GstVideoDecoder * decoder) GST_VIDEO_DECODER_STREAM_UNLOCK (self); /* Send an EOS buffer to the component and let the base * class drop the EOS event. We will send it later when - * the EOS buffer arrives on the output port. */ - idx = gst_amc_codec_dequeue_input_buffer (self->codec, -1); + * the EOS buffer arrives on the output port. + * Wait at most 0.5s here. */ + idx = gst_amc_codec_dequeue_input_buffer (self->codec, 500000); GST_VIDEO_DECODER_STREAM_LOCK (self); if (idx >= 0 && idx < self->n_input_buffers) { @@ -1308,8 +1309,9 @@ gst_amc_video_dec_drain (GstAmcVideoDec * self) GST_VIDEO_DECODER_STREAM_UNLOCK (self); /* Send an EOS buffer to the component and let the base * class drop the EOS event. We will send it later when - * the EOS buffer arrives on the output port. */ - idx = gst_amc_codec_dequeue_input_buffer (self->codec, -1); + * the EOS buffer arrives on the output port. + * Wait at most 0.5s here. */ + idx = gst_amc_codec_dequeue_input_buffer (self->codec, 500000); GST_VIDEO_DECODER_STREAM_LOCK (self); if (idx >= 0 && idx < self->n_input_buffers) {