[vlc-devel] [PATCH 2/2] mediacodec: remove retry HACK

zhilizhao quinkblack at foxmail.com
Sat Feb 1 19:02:12 CET 2020



> On Feb 2, 2020, at 1:35 AM, zhilizhao <quinkblack at foxmail.com> wrote:
> 
> 
> 
>> On Jan 31, 2020, at 9:11 PM, Thomas Guillem <thomas at gllm.fr <mailto:thomas at gllm.fr>> wrote:
>> 
>> cf. previous commit. It is not fixed in VLC core.
> 
> You mean “now” fixed?
> 
>> ---
>> modules/codec/omxil/mediacodec.c | 29 +----------------------------
>> 1 file changed, 1 insertion(+), 28 deletions(-)
>> 
>> diff --git a/modules/codec/omxil/mediacodec.c b/modules/codec/omxil/mediacodec.c
>> index f6b98458f47..5ad2861d253 100644
>> --- a/modules/codec/omxil/mediacodec.c
>> +++ b/modules/codec/omxil/mediacodec.c
>> @@ -1469,7 +1469,6 @@ static int QueueBlockLocked(decoder_t *p_dec, block_t *p_in_block,
>> {
>>    decoder_sys_t *p_sys = p_dec->p_sys;
>>    block_t *p_block = NULL;
>> -    bool b_dequeue_timeout = false;
>> 
>>    assert(p_sys->api.b_started);
>> 
>> @@ -1485,9 +1484,7 @@ static int QueueBlockLocked(decoder_t *p_dec, block_t *p_in_block,
>>        vlc_mutex_unlock(&p_sys->lock);
>>        /* Wait for an input buffer. This function returns when a new input
>>         * buffer is available or after 2secs of timeout. */

The above comment is out dated now.

>> -        i_index = p_sys->api.dequeue_in(&p_sys->api,
>> -                                        p_sys->api.b_direct_rendering ?
>> -                                        INT64_C(2000000) : -1);
>> +        i_index = p_sys->api.dequeue_in(&p_sys->api, -1);
>>        vlc_mutex_lock(&p_sys->lock);
>> 
>>        if (p_sys->b_aborted)
>> @@ -1531,7 +1528,6 @@ static int QueueBlockLocked(decoder_t *p_dec, block_t *p_in_block,
>>                    assert(p_block == p_in_block),
>>                    p_in_block = NULL;
>>                }
>> -                b_dequeue_timeout = false;
>>                if (b_drain)
>>                    break;
>>            } else
>> @@ -1540,29 +1536,6 @@ static int QueueBlockLocked(decoder_t *p_dec, block_t *p_in_block,
>>                goto error;
>>            }
>>        }
>> -        else if (i_index == MC_API_INFO_TRYAGAIN)
>> -        {
>> -            /* HACK: When direct rendering is enabled, there is a possible
>> -             * deadlock between the Decoder and the Vout. It happens when the
>> -             * Vout is paused and when the Decoder is flushing. In that case,
>> -             * the Vout won't release any output buffers, therefore MediaCodec
>> -             * won't dequeue any input buffers. To work around this issue,
>> -             * release all output buffers if DecodeBlock is waiting more than
>> -             * 2secs for a new input buffer. */
>> -            if (!b_dequeue_timeout)
>> -            {
>> -                msg_Warn(p_dec, "Decoder stuck: invalidate all buffers");
>> -                if (p_sys->cat == VIDEO_ES)
>> -                    ReleaseAllPictureContexts(p_sys);
>> -                b_dequeue_timeout = true;
>> -                continue;
>> -            }
>> -            else
>> -            {
>> -                msg_Err(p_dec, "dequeue_in timeout: no input available for 2secs");
>> -                goto error;
>> -            }
>> -        }
>>        else
>>        {
>>            msg_Err(p_dec, "dequeue_in failed");
>> -- 
>> 2.20.1
>> 
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel <https://mailman.videolan.org/listinfo/vlc-devel>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20200202/3f96d75d/attachment.html>


More information about the vlc-devel mailing list