Web lists-archives.com

[MPlayer-dev-eng] [PATCH] Stop using deprecatet AVPacket.destruct




Hi,
 this patch drops the usage of the destruct field in AVPacket from
demuxer_lavf.

Thanks to  Andreas Cadhalpun for reporting it.


I haven't found an easy way to replace it; since now AVPacket.data is a
pointer into an AVBuffer (and not a plain malloc'd buffer), we can't
just seal it like we did before and free it later.

The removed path was just an optimization to avoid copying the demuxed
packet data.

Also note that because of the way the condition is written, the removed
code was already inactive (we compare the destruct field with
av_destruct_packet to enable it, but lavc now sets it to
dummy_destruct_packer).


Will apply shortly if no complain.

Ciao,
 Roberto

Index: demux_lavf.c
===================================================================
--- demux_lavf.c	(revisione 37444)
+++ demux_lavf.c	(copia locale)
@@ -682,16 +682,9 @@
         return 1;
     }
 
-    if(pkt.destruct == av_destruct_packet && !CONFIG_MEMALIGN_HACK){
-        dp=new_demux_packet(0);
-        dp->len=pkt.size;
-        dp->buffer=pkt.data;
-        pkt.destruct= NULL;
-    }else{
         dp=new_demux_packet(pkt.size);
         memcpy(dp->buffer, pkt.data, pkt.size);
         av_free_packet(&pkt);
-    }
 
     if(pkt.pts != AV_NOPTS_VALUE){
         dp->pts=pkt.pts * av_q2d(priv->avfc->streams[id]->time_base);
_______________________________________________
MPlayer-dev-eng mailing list
MPlayer-dev-eng@xxxxxxxxxxxx
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng