]> git.sesse.net Git - ffmpeg/commit
avformat/mpeg: Remove secondary packet for reading VobSub
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Tue, 8 Oct 2019 05:41:14 +0000 (07:41 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Wed, 1 Jan 2020 15:38:28 +0000 (16:38 +0100)
commit6d354aeb29d257ae64ad6a055d210dd6b191d5bc
tree029727ec1acea67b59f569a00e98a65c7d7abd2a
parent1fd8929450a6d701620caf60f39d997cccc4001b
avformat/mpeg: Remove secondary packet for reading VobSub

When vobsub_read_packet() reads a packet, it uses a dedicated AVPacket
to get the subtitle timing and position from an FFDemuxSubtitlesQueue
(which has been filled with this data during reading the idx file in
vobsub_read_header); afterwards the actual subtitle data is read into
the packet destined for output and the timing and position are copied
to this packet. Afterwards, the local packet is unreferenced.

This can be simplified: Simply use the output packet to get the timing
and position from the FFDemuxSubtitlesQueue. The packet's size will be
zero afterwards, so that it can be directly used to read the actual
subtitle data. This makes copying the packet fields as well as
unreferencing the local packet unecessary and also removes an instance
of usage of sizeof(AVPacket) in libavformat.

The only difference is that the returned packet will already be flagged
as a keyframe. This currently only happens in compute_pkt_fields().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/mpeg.c