• softworkz's avatar
    avformat/matroskaenc: Regression fix for invalid MKV headers · 20e8be0c
    softworkz authored
    The following three commits created a regression by writing initially
    invalid mkv headers:
    
    650e17d8 avformat/matroskaenc: write a
    CRC32 element on Tags
    3bcadf82 avformat/matroskaenc: write a
    CRC32 element on Info
    ee888cfb avformat/matroskaenc: postpone
    writing the Tracks master
    
    Symptoms:
    
    - You can no longer playback a file that is still processed by ffmpeg,
    e.g. VLC fails playback
    - You can no longer stream a file to a client while if is still being
    processed
    - Various diagnosing tools show header errors or incomplete headers
    (e.g. ffprobe, mediainfo, mkvalidator)
    
    Note: The symptoms do not apply to completed files or ffmpeg runs that
    were interrupted with 'q'
    
    Cause:
    
    The mentioned commits made changes in a way that some header elements
    are only partially written in
    mkv_write_header, leaving the header in an invalid state. Only in
    mkv_write_trailer, these elements
    are finished correctly, but that does only occur at the end of the
    process.
    
    Regression:
    
    Before these commits were applied, mkv headers have always been valid,
    even before completion of ffmpeg.
    This has worked reliably over many versions of ffmpeg, to it was an
    obvious regression.
    
    Bugtracker:
    
    This issue has been recorded as #5977 which is resolved by this patch
    
    Patch:
    
    The patch adds a new function 'end_ebml_master_crc32_preliminary' that
    preliminarily finishes the ebml
    element without destroying the buffer. The buffer can be used to update
    the ebml element later during
    mkv_write_trailer. But most important: mkv_write_header finishes with a
    valid mkv header again.
    Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
    20e8be0c
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...
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...
arch.mak Loading commit data...
cmdutils.c Loading commit data...
cmdutils.h Loading commit data...
cmdutils_common_opts.h Loading commit data...
cmdutils_opencl.c Loading commit data...
common.mak 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_opt.c Loading commit data...
ffmpeg_qsv.c Loading commit data...
ffmpeg_vaapi.c Loading commit data...
ffmpeg_vdpau.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...
library.mak Loading commit data...
version.sh Loading commit data...