• David Mitchell's avatar
    Improve support for PGS subtitles. · d150a147
    David Mitchell authored
    The previous implementation assumed that a new picture would always
    supersede the previous picture. Similarly, presentation segments
    were assumed to pertain to the most-recently-read picture.
    
    However, each presentation segment may refer to 0 or more pictures
    by their ID. Picture IDs may repeat, and a repeated picture ID
    indicates that the old picture for that ID is no longer needed
    and may be discarded.
    
    The new implementation allocates a buffer with one slot for each
    possible picture ID (the picture ID is a 16-bit field) and
    properly decodes presentation segments so that all relevant
    pictures are output upon encountering a display segment.
    
    Given that most PGS streams are unlikely to use more than a small
    fraction of the available picture IDs, it would probably be better
    to use a more memory-efficient data structure. I'm lazy though, so
    I leave this to a more motivated individual.
    
    I've tested the code with MKV files in VLC (a recent revision from
    their git repo) and with HandBrake (a version that I hacked up to
    use ffmpeg's PGS subtitle decoder).
    Review-by: 's avatarHendrik Leppkes <h.leppkes@gmail.com>
    Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
    d150a147
Name
Last commit
Last update
doc Loading commit data...
ffpresets Loading commit data...
libavcodec Loading commit data...
libavdevice Loading commit data...
libavfilter Loading commit data...
libavformat Loading commit data...
libavutil Loading commit data...
libpostproc Loading commit data...
libswresample Loading commit data...
libswscale Loading commit data...
mt-work 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...
Doxyfile Loading commit data...
INSTALL Loading commit data...
LICENSE Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README Loading commit data...
RELEASE Loading commit data...
avconv.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...
ffmpeg.c Loading commit data...
ffplay.c Loading commit data...
ffprobe.c Loading commit data...
ffserver.c Loading commit data...
library.mak Loading commit data...
version.sh Loading commit data...