[FFmpeg-devel] [PATCH] avpacket: do not copy data when buf ref is available.

Clément Bœsch ubitux at gmail.com
Tue Mar 12 23:31:23 CET 2013


On Tue, Mar 12, 2013 at 11:14:06PM +0100, Clément Bœsch wrote:
> On Tue, Mar 12, 2013 at 11:05:20PM +0100, Clément Bœsch wrote:
> > On Tue, Mar 12, 2013 at 06:22:10PM +0100, Michael Niedermayer wrote:
> > > On Tue, Mar 12, 2013 at 08:22:26AM +0100, Clément Bœsch wrote:
> > > > On Tue, Mar 12, 2013 at 08:13:38AM +0100, Clément Bœsch wrote:
> > > > > This at least fixes issues with lavf/subtitles.
> > > > > ---
> > > > >  libavcodec/avpacket.c | 12 ++++++++++--
> > > > >  1 file changed, 10 insertions(+), 2 deletions(-)
> > > > > 
> > > > 
> > > > Functionally identical, but simpler.
> > > > 
> > > > -- 
> > > > Clément B.
> > > 
> > > >  avpacket.c |   11 +++++++++--
> > > >  1 file changed, 9 insertions(+), 2 deletions(-)
> > > > 10c78e97d43e6ae3fdbf216ea16f6519acbbf183  0001-avpacket-do-not-copy-data-when-buf-ref-is-available.patch
> > > > From 312fd3c73d83f4cb10b9e7de7e7b4ea45c3c0b72 Mon Sep 17 00:00:00 2001
> > > > From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= <ubitux at gmail.com>
> > > > Date: Tue, 12 Mar 2013 08:13:21 +0100
> > > > Subject: [PATCH] avpacket: do not copy data when buf ref is available.
> > > > 
> > > > This at least fixes issues with lavf/subtitles.
> > > 
> > > this also changes av_dup_packet i think, is this intended ?
> > > 
> > 
> > av_dup_packet should not be affected, it's a noop in case pkt->buf is
> > NULL.
> > 
> 
> Please disregard this comment.
> 

Correct wording: av_dup_packet should not be affected, it's a noop in case
pkt->buf is *NOT* NULL. The behaviour of copy_packet_data() is unchanged
in case pkt->buf is NULL, which is the only case where copy_packet_data
can be called from av_dup_packet().

On a side note, while the behaviour of av_dup_packet() is unchanged, I'm
not sure it is really correct. But this is not what the patch is meant to
fix anyway.

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130312/ececbf35/attachment.asc>


More information about the ffmpeg-devel mailing list