• Dave Stevenson's avatar
    avcodec/omx: Fix handling of fragmented buffers · 3d857f21
    Dave Stevenson authored
    See https://trac.ffmpeg.org/ticket/7687
    
    If an encoded frame is returned split over two or more
    IL buffers due to the size, then there is a race between
    whether get_buffer will fail, return NULL, and a truncated
    frame is passed on, or IL will return the remaining part
    of the encoded frame.
    If get_buffer returns NULL, part of the frame is left behind
    in the codec, and will be collected on the next call. That
    then leaves a frame stuck in the codec. Repeat enough times
    and the codec FIFO is full, and the pipeline stalls.
    
    A performance improvement in the Raspberry Pi firmware means
    that the timing has changed, and now frequently drops into the
    case where get_buffer returns NULL.
    
    Add code such that should a buffer be received without
    OMX_BUFFERFLAG_ENDOFFRAME that get_buffer is called with wait
    set, so we wait for the remainder of the frame.
    This code has been made conditional on the Pi build in case
    other IL implementations don't handle ENDOFFRAME correctly.
    Signed-off-by: 's avatarDave Stevenson <dave.stevenson@raspberrypi.org>
    Signed-off-by: 's avatarAman Gupta <aman@tmm1.net>
    Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
    3d857f21
Name
Last commit
Last update
compat Loading commit data...
doc Loading commit data...
ffbuild Loading commit data...
fftools Loading commit data...
libavcodec Loading commit data...
libavdevice Loading commit data...
libavfilter Loading commit data...
libavformat Loading commit data...
libavresample Loading commit data...
libavutil Loading commit data...
libpostproc Loading commit data...
libswresample Loading commit data...
libswscale Loading commit data...
presets Loading commit data...
tests Loading commit data...
tools Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.travis.yml Loading commit data...
CONTRIBUTING.md Loading commit data...
COPYING.GPLv2 Loading commit data...
COPYING.GPLv3 Loading commit data...
COPYING.LGPLv2.1 Loading commit data...
COPYING.LGPLv3 Loading commit data...
CREDITS Loading commit data...
Changelog Loading commit data...
INSTALL.md Loading commit data...
LICENSE.md Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
RELEASE Loading commit data...
configure Loading commit data...