]> git.sesse.net Git - ffmpeg/commitdiff
Use the new AVIOContext destructor.
authorAnton Khirnov <anton@khirnov.net>
Fri, 1 Sep 2017 05:16:33 +0000 (02:16 -0300)
committerJames Almer <jamrial@gmail.com>
Fri, 1 Sep 2017 05:16:33 +0000 (02:16 -0300)
(cherry picked from commit 6f554521afdf7ab4edbfaa9536660a1dca946b19)
Signed-off-by: James Almer <jamrial@gmail.com>
libavformat/avidec.c
libavformat/flac_picture.c
libavformat/hdsenc.c
libavformat/mpjpegdec.c
libavformat/rdt.c
libavformat/segment.c
libavformat/smoothstreamingenc.c
libavformat/swfdec.c
libavformat/tests/movenc.c
libavformat/wtvdec.c

index 9816a1dfacce787e9dbef2977cc18c3c62df2cbf..b8a31dcff28755afab071ce811ecb46b85c9d80c 100644 (file)
@@ -1124,7 +1124,7 @@ static int read_gab2_sub(AVFormatContext *s, AVStream *st, AVPacket *pkt)
 
 error:
         av_freep(&ast->sub_ctx);
-        av_freep(&pb);
+        avio_context_free(&pb);
     }
     return 0;
 }
index a3217f02a6b50b48f6a684aebbbfd14e1c8ea70e..38982b960de44bd29014fae7a8aa243ce993c325 100644 (file)
@@ -140,14 +140,14 @@ int ff_flac_parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size)
     if (desc)
         av_dict_set(&st->metadata, "title", desc, AV_DICT_DONT_STRDUP_VAL);
 
-    av_freep(&pb);
+    avio_context_free(&pb);
 
     return 0;
 
 fail:
     av_buffer_unref(&data);
     av_freep(&desc);
-    av_freep(&pb);
+    avio_context_free(&pb);
 
     return ret;
 }
index d01b5fa84ec823f8516163bc111bbed442269962..72829f7257a284e418fa15124540162b8c72a689 100644 (file)
@@ -145,7 +145,7 @@ static void hds_free(AVFormatContext *s)
         if (os->ctx && os->ctx_inited)
             av_write_trailer(os->ctx);
         if (os->ctx)
-            av_freep(&os->ctx->pb);
+            avio_context_free(&os->ctx->pb);
         if (os->ctx)
             avformat_free_context(os->ctx);
         av_freep(&os->metadata);
index 4c7764412f0f09d6e61d66e659addbd1db3ef2df..83aa70d0c9726324e64aea8a68eb58d887efb241 100644 (file)
@@ -126,7 +126,7 @@ static int mpjpeg_read_probe(AVProbeData *p)
 
     ret = (parse_multipart_header(pb, &size, "--", NULL) >= 0) ? AVPROBE_SCORE_MAX : 0;
 
-    av_free(pb);
+    avio_context_free(&pb);
 
     return ret;
 }
index 8670eadce67d4e66be61d4b8c99d41960375f126..b69827fcbfcd65a47eb385987679afcf9cc9d9cc 100644 (file)
@@ -323,7 +323,7 @@ get_cache:
                                   st, rdt->rmst[st->index], pkt);
         if (rdt->audio_pkt_cnt == 0 &&
             st->codecpar->codec_id == AV_CODEC_ID_AAC)
-            av_freep(&rdt->rmctx->pb);
+            avio_context_free(&rdt->rmctx->pb);
     }
     pkt->stream_index = st->index;
     pkt->pts = *timestamp;
index 0e8bcddb00be6abe93d16195ddcb6c6d085883cd..b0ef6dd38e08a2a0d736e3916c2c4585c6ba33f5 100644 (file)
@@ -569,7 +569,7 @@ static int open_null_ctx(AVIOContext **ctx)
 static void close_null_ctxp(AVIOContext **pb)
 {
     av_freep(&(*pb)->buffer);
-    av_freep(pb);
+    avio_context_free(pb);
 }
 
 static int select_reference_stream(AVFormatContext *s)
index 083af492129535b00e00df51a894c94cfc81bd59..86618351b800d028b6b0d953739e6fd79772f708 100644 (file)
@@ -182,7 +182,7 @@ static void ism_free(AVFormatContext *s)
         if (os->ctx && os->ctx_inited)
             av_write_trailer(os->ctx);
         if (os->ctx && os->ctx->pb)
-            av_freep(&os->ctx->pb);
+            avio_context_free(&os->ctx->pb);
         if (os->ctx)
             avformat_free_context(os->ctx);
         av_freep(&os->private_str);
index b91560c56ce3d1dcb217f5b5be8c9e5f3edf8243..57b619fb203d0810c5db874397b9bae1727de8a1 100644 (file)
@@ -531,7 +531,7 @@ static av_cold int swf_read_close(AVFormatContext *avctx)
     inflateEnd(&s->zstream);
     av_freep(&s->zbuf_in);
     av_freep(&s->zbuf_out);
-    av_freep(&s->zpb);
+    avio_context_free(&s->zpb);
     return 0;
 }
 #endif
index ab871765d9391b612a2eb3252ab1b653fa7de85f..7a66395efd286f43a53285a4e3359b9d0378ce50 100644 (file)
@@ -344,7 +344,7 @@ static void signal_init_ts(void)
 static void finish(void)
 {
     av_write_trailer(ctx);
-    av_free(ctx->pb);
+    avio_context_free(&ctx->pb);
     avformat_free_context(ctx);
     ctx = NULL;
 }
index 3ac45013066b6309eb6f812d8bcc6a2b2acfa73b..27be5c9c04d90031084958544f8c72bb10b30587 100644 (file)
@@ -305,7 +305,7 @@ static void wtvfile_close(AVIOContext *pb)
     av_freep(&wf->sectors);
     av_freep(&pb->opaque);
     av_freep(&pb->buffer);
-    av_free(pb);
+    avio_context_free(&pb);
 }
 
 /*