[vlc-devel] [PATCH 3/4] mediacodec: fix GetOutput timeout

Thomas Guillem thomas at gllm.fr
Wed Oct 29 18:34:08 CET 2014


On Wed, Oct 29, 2014, at 18:22, Martin Storsjö wrote:
> On Wed, 29 Oct 2014, Thomas Guillem wrote:
> 
> > ---
> > modules/codec/omxil/android_mediacodec.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/modules/codec/omxil/android_mediacodec.c b/modules/codec/omxil/android_mediacodec.c
> > index 8507ebc..e352266 100644
> > --- a/modules/codec/omxil/android_mediacodec.c
> > +++ b/modules/codec/omxil/android_mediacodec.c
> > @@ -738,6 +738,8 @@ static int GetOutput(decoder_t *p_dec, JNIEnv *env, picture_t **pp_pic, jlong ti
> >             (*env)->ExceptionClear(env);
> >             return -1;
> >         }
> > +        // timeout is only for the first try
> > +        timeout = 0;
> >
> >         if (index >= 0) {
> >             if (!p_sys->pixel_format) {
> > -- 
> > 2.1.0
> 
> Umm.. maybe? The commit message is a bit too terse, the change might be 
> right but I'm missing the explanation on why and in which case it
> matters.

Ah yes. You can pass a timeout to GetOutput, that will pass it to the
dequeue function.
The dequeue can return an event instead of a buffer. If GetOutput handle
it, it'll call again the dequeue function with the same timeout. In that
case, we wait 2 x timeout.

I'll redo the commit log & comments if you agree with this commit.

(But finally, I decided to use a timeout of 0 in the next commit)

> 
> // Martin
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel



More information about the vlc-devel mailing list