[vlc-commits] demux: avformat: replace deprecated av_free_packet

Francois Cartegnie git at videolan.org
Wed Feb 22 13:58:09 CET 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Feb 21 16:12:58 2017 +0100| [20260c68d5b98012f928d2fdb09afb586caa24ba] | committer: Francois Cartegnie

demux: avformat: replace deprecated av_free_packet

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=20260c68d5b98012f928d2fdb09afb586caa24ba
---

 modules/demux/avformat/demux.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c
index 2a6842a..24d3147 100644
--- a/modules/demux/avformat/demux.c
+++ b/modules/demux/avformat/demux.c
@@ -730,14 +730,14 @@ static int Demux( demux_t *p_demux )
     }
     if( pkt.stream_index < 0 || pkt.stream_index >= p_sys->i_tk )
     {
-        av_free_packet( &pkt );
+        av_packet_unref( &pkt );
         return 1;
     }
     const AVStream *p_stream = p_sys->ic->streams[pkt.stream_index];
     if( p_stream->time_base.den <= 0 )
     {
         msg_Warn( p_demux, "Invalid time base for the stream %d", pkt.stream_index );
-        av_free_packet( &pkt );
+        av_packet_unref( &pkt );
         return 1;
     }
     if( p_stream->codecpar->codec_id == AV_CODEC_ID_SSA )
@@ -745,7 +745,7 @@ static int Demux( demux_t *p_demux )
         p_frame = BuildSsaFrame( &pkt, p_sys->i_ssa_order++ );
         if( !p_frame )
         {
-            av_free_packet( &pkt );
+            av_packet_unref( &pkt );
             return 1;
         }
     }
@@ -753,7 +753,7 @@ static int Demux( demux_t *p_demux )
     {
         if( ( p_frame = block_Alloc( pkt.size ) ) == NULL )
         {
-            av_free_packet( &pkt );
+            av_packet_unref( &pkt );
             return 0;
         }
         memcpy( p_frame->p_buffer, pkt.data, pkt.size );
@@ -834,7 +834,7 @@ static int Demux( demux_t *p_demux )
     else
         block_Release( p_frame );
 
-    av_free_packet( &pkt );
+    av_packet_unref( &pkt );
     return 1;
 }
 



More information about the vlc-commits mailing list