]> git.sesse.net Git - ffmpeg/commit
mmaldec: hack against buffering problems on broken input
authorwm4 <nfxjfg@googlemail.com>
Tue, 8 Sep 2015 17:42:22 +0000 (19:42 +0200)
committerLuca Barbato <lu_zero@gentoo.org>
Sat, 12 Sep 2015 10:25:23 +0000 (12:25 +0200)
commitb84675d63aaede8f6944b901250a10456c5477e6
tree8084ecf23f56142a064ef8876eff66e04b6f6ea9
parent5788623d29c3e806a7879210986110aced758dc2
mmaldec: hack against buffering problems on broken input

I can't come up with a nice way to handle this. It's hard to keep the
lock-stepped input/output in this case. You can't predict whether the
MMAL decoder will output a picture (because it's asynchronous), so
you have to assume in general that any packet could produce 0 or 1
frames. You can't continue to write input packets to the decoder,
because then you might get too many output frames, which you can't
get rid of because the lavc decoding API does not allow the decoder
to return an output frame without consuming an input frame (except
when flushing).

The ideal fix is a M:N decoding API (preferably asynchronous), which
would make this code potentially much cleaner. For now, this hack
will do.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
libavcodec/mmaldec.c