• Marton Balint's avatar
    avformat/aviobuf: fix flushing write buffers after seeking backward or forward · c14fa7a3
    Marton Balint authored
    This patch makes aviobuf work more like traditinal file IO, which is how people
    think about it.
    
    For example, in the past, aviobuf only flushed buffers until the current buffer
    position, even if more data was written to it previously, and a backward seek
    was used to reposition the IO context.
    
    From now, aviobuf will keep track of the written data, so no explicit seek will
    be required till the end of the buffer, or till the end of file before flushing.
    
    This fixes at least one regression, fate-vsynth3-flv was broken if
    flush_packets option was set to false, an explicit seek was removed in
    4e3cc4bd.
    
    Also from now on, if a forward seek in the write buffer were to cause a gap
    between the already written data and the new file position, a flush will
    happen.
    
    The must_flush varable is also removed, which might have caused needless
    flushes with multiple seeks whithin the write buffer. Since we know the amount
    of data written to it, we will know when to flush.
    Signed-off-by: 's avatarMarton Balint <cus@passwd.hu>
    c14fa7a3
Name
Last commit
Last update
compat Loading commit data...
doc Loading commit data...
ffbuild 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...
cmdutils.c Loading commit data...
cmdutils.h Loading commit data...
cmdutils_opencl.c Loading commit data...
configure Loading commit data...
ffmpeg.c Loading commit data...
ffmpeg.h Loading commit data...
ffmpeg_cuvid.c Loading commit data...
ffmpeg_dxva2.c Loading commit data...
ffmpeg_filter.c Loading commit data...
ffmpeg_hw.c Loading commit data...
ffmpeg_opt.c Loading commit data...
ffmpeg_qsv.c Loading commit data...
ffmpeg_videotoolbox.c Loading commit data...
ffplay.c Loading commit data...
ffprobe.c Loading commit data...
ffserver.c Loading commit data...
ffserver_config.c Loading commit data...
ffserver_config.h Loading commit data...