Commit 78a7af82 authored by Anton Khirnov's avatar Anton Khirnov Committed by James Almer

Use the new AVIOContext destructor.

(cherry picked from commit 6f554521)
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent b12e4d3b
......@@ -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;
}
......
......@@ -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;
}
......@@ -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);
......
......@@ -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;
}
......
......@@ -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;
......
......@@ -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)
......
......@@ -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);
......
......@@ -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
......
......@@ -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;
}
......
......@@ -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);
}
/*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment