[FFmpeg-devel] [PATCH 2/4] avformat/mpeg: Remove secondary packet for reading VobSub

Michael Niedermayer michael at niedermayer.cc
Wed Jan 1 17:40:03 EET 2020


On Tue, Oct 08, 2019 at 07:41:14AM +0200, Andreas Rheinhardt wrote:
> 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 at gmail.com>
> ---
>  libavformat/mpeg.c | 23 +++++++----------------
>  1 file changed, 7 insertions(+), 16 deletions(-)

will apply

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Freedom in capitalist society always remains about the same as it was in
ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20200101/8036c8a0/attachment.sig>


More information about the ffmpeg-devel mailing list