• Rafaël Carré's avatar
    apedec: do not buffer decoded samples over AVPackets · 91d4cfb8
    Rafaël Carré authored
    Only consume an AVPacket when all the samples have been read.
    
    When the rate of samples output is limited (by the default value
    of max_samples), consuming the first packet immediately will cause
    timing problems:
    
    - The first packet with PTS 0 will output 4608 samples and be
    consumed entirely
    - The second packet with PTS 64 will output the remaining samples
    (typically, a lot, that's why max_samples exist) until the decoded
    samples of the first packet have been exhausted, at which point the
    samples of the second packet will be decoded and output when
    av_decode_frame is called with the next packet).
    
    That means there's a PTS jump since the first packet is 'decoded'
    immediately, which can be seen with avplay or mplayer: the timing
    jumps immediately to 6.2s (which is the size of a packet).
    
    Sample: http://streams.videolan.org/issues/6348/Goldwave-MAClib.apeSigned-off-by: 's avatarJustin Ruggles <justin.ruggles@gmail.com>
    91d4cfb8
Name
Last commit
Last update
compat Loading commit data...
doc 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...
libswscale Loading commit data...
presets Loading commit data...
tests Loading commit data...
tools Loading commit data...
.gitignore 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 Loading commit data...
LICENSE Loading commit data...
Makefile Loading commit data...
README Loading commit data...
RELEASE Loading commit data...
arch.mak Loading commit data...
avconv.c Loading commit data...
avconv.h Loading commit data...
avconv_filter.c Loading commit data...
avconv_opt.c Loading commit data...
avplay.c Loading commit data...
avprobe.c Loading commit data...
avserver.c Loading commit data...
cmdutils.c Loading commit data...
cmdutils.h Loading commit data...
cmdutils_common_opts.h Loading commit data...
common.mak Loading commit data...
configure Loading commit data...
library.mak Loading commit data...
version.sh Loading commit data...