]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/avidec.c
avpacket: Replace av_free_packet with av_packet_unref
[ffmpeg] / libavformat / avidec.c
index 63afe2f397dc73c4d756c7f99ba735bed55e9575..659bfa7b6d60e557d5457d069009db65532e04b4 100644 (file)
@@ -1215,7 +1215,7 @@ resync:
             pkt->buf    = avbuf;
             pkt->flags |= AV_PKT_FLAG_KEY;
             if (size < 0)
-                av_free_packet(pkt);
+                av_packet_unref(pkt);
         } else if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE &&
                    !st->codec->codec_tag && read_gab2_sub(st, pkt)) {
             ast->frame_offset++;
@@ -1470,7 +1470,7 @@ static void seek_subtitle(AVStream *st, AVStream *st2, int64_t timestamp)
 {
     AVIStream *ast2 = st2->priv_data;
     int64_t ts2     = av_rescale_q(timestamp, st->time_base, st2->time_base);
-    av_free_packet(&ast2->sub_pkt);
+    av_packet_unref(&ast2->sub_pkt);
     if (avformat_seek_file(ast2->sub_ctx, 0, INT64_MIN, ts2, ts2, 0) >= 0 ||
         avformat_seek_file(ast2->sub_ctx, 0, ts2, ts2, INT64_MAX, 0) >= 0)
         ff_read_packet(ast2->sub_ctx, &ast2->sub_pkt);
@@ -1587,7 +1587,7 @@ static int avi_read_close(AVFormatContext *s)
                 avformat_close_input(&ast->sub_ctx);
             }
             av_free(ast->sub_buffer);
-            av_free_packet(&ast->sub_pkt);
+            av_packet_unref(&ast->sub_pkt);
         }
     }