aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/lcldec.c
diff options
context:
space:
mode:
authorDavid Mitchell <dave@fallingcanbedeadly.com>2012-01-19 07:31:01 -0800
committerMichael Niedermayer <michaelni@gmx.at>2012-01-23 19:47:49 +0100
commitd150a147dac67faeaf6b1f25a523ae330168ee1e (patch)
tree444f1d5418b89ceab3bcc58a95a2db08bb391ab2 /libavcodec/lcldec.c
parentcf7c7f13cdad07a174110625f8452c8e3444717b (diff)
downloadffmpeg-d150a147dac67faeaf6b1f25a523ae330168ee1e.tar.gz
Improve support for PGS subtitles.
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: Hendrik Leppkes <h.leppkes@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/lcldec.c')
0 files changed, 0 insertions, 0 deletions