mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-04-23 23:46:41 +00:00
Use the new AVIOContext destructor.
(cherry picked from commit 6f554521af
)
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
b12e4d3bb8
commit
78a7af823b
@ -1124,7 +1124,7 @@ static int read_gab2_sub(AVFormatContext *s, AVStream *st, AVPacket *pkt)
|
|||||||
|
|
||||||
error:
|
error:
|
||||||
av_freep(&ast->sub_ctx);
|
av_freep(&ast->sub_ctx);
|
||||||
av_freep(&pb);
|
avio_context_free(&pb);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -140,14 +140,14 @@ int ff_flac_parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size)
|
|||||||
if (desc)
|
if (desc)
|
||||||
av_dict_set(&st->metadata, "title", desc, AV_DICT_DONT_STRDUP_VAL);
|
av_dict_set(&st->metadata, "title", desc, AV_DICT_DONT_STRDUP_VAL);
|
||||||
|
|
||||||
av_freep(&pb);
|
avio_context_free(&pb);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
av_buffer_unref(&data);
|
av_buffer_unref(&data);
|
||||||
av_freep(&desc);
|
av_freep(&desc);
|
||||||
av_freep(&pb);
|
avio_context_free(&pb);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -145,7 +145,7 @@ static void hds_free(AVFormatContext *s)
|
|||||||
if (os->ctx && os->ctx_inited)
|
if (os->ctx && os->ctx_inited)
|
||||||
av_write_trailer(os->ctx);
|
av_write_trailer(os->ctx);
|
||||||
if (os->ctx)
|
if (os->ctx)
|
||||||
av_freep(&os->ctx->pb);
|
avio_context_free(&os->ctx->pb);
|
||||||
if (os->ctx)
|
if (os->ctx)
|
||||||
avformat_free_context(os->ctx);
|
avformat_free_context(os->ctx);
|
||||||
av_freep(&os->metadata);
|
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;
|
ret = (parse_multipart_header(pb, &size, "--", NULL) >= 0) ? AVPROBE_SCORE_MAX : 0;
|
||||||
|
|
||||||
av_free(pb);
|
avio_context_free(&pb);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -323,7 +323,7 @@ get_cache:
|
|||||||
st, rdt->rmst[st->index], pkt);
|
st, rdt->rmst[st->index], pkt);
|
||||||
if (rdt->audio_pkt_cnt == 0 &&
|
if (rdt->audio_pkt_cnt == 0 &&
|
||||||
st->codecpar->codec_id == AV_CODEC_ID_AAC)
|
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->stream_index = st->index;
|
||||||
pkt->pts = *timestamp;
|
pkt->pts = *timestamp;
|
||||||
|
@ -569,7 +569,7 @@ static int open_null_ctx(AVIOContext **ctx)
|
|||||||
static void close_null_ctxp(AVIOContext **pb)
|
static void close_null_ctxp(AVIOContext **pb)
|
||||||
{
|
{
|
||||||
av_freep(&(*pb)->buffer);
|
av_freep(&(*pb)->buffer);
|
||||||
av_freep(pb);
|
avio_context_free(pb);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int select_reference_stream(AVFormatContext *s)
|
static int select_reference_stream(AVFormatContext *s)
|
||||||
|
@ -182,7 +182,7 @@ static void ism_free(AVFormatContext *s)
|
|||||||
if (os->ctx && os->ctx_inited)
|
if (os->ctx && os->ctx_inited)
|
||||||
av_write_trailer(os->ctx);
|
av_write_trailer(os->ctx);
|
||||||
if (os->ctx && os->ctx->pb)
|
if (os->ctx && os->ctx->pb)
|
||||||
av_freep(&os->ctx->pb);
|
avio_context_free(&os->ctx->pb);
|
||||||
if (os->ctx)
|
if (os->ctx)
|
||||||
avformat_free_context(os->ctx);
|
avformat_free_context(os->ctx);
|
||||||
av_freep(&os->private_str);
|
av_freep(&os->private_str);
|
||||||
|
@ -531,7 +531,7 @@ static av_cold int swf_read_close(AVFormatContext *avctx)
|
|||||||
inflateEnd(&s->zstream);
|
inflateEnd(&s->zstream);
|
||||||
av_freep(&s->zbuf_in);
|
av_freep(&s->zbuf_in);
|
||||||
av_freep(&s->zbuf_out);
|
av_freep(&s->zbuf_out);
|
||||||
av_freep(&s->zpb);
|
avio_context_free(&s->zpb);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -344,7 +344,7 @@ static void signal_init_ts(void)
|
|||||||
static void finish(void)
|
static void finish(void)
|
||||||
{
|
{
|
||||||
av_write_trailer(ctx);
|
av_write_trailer(ctx);
|
||||||
av_free(ctx->pb);
|
avio_context_free(&ctx->pb);
|
||||||
avformat_free_context(ctx);
|
avformat_free_context(ctx);
|
||||||
ctx = NULL;
|
ctx = NULL;
|
||||||
}
|
}
|
||||||
|
@ -305,7 +305,7 @@ static void wtvfile_close(AVIOContext *pb)
|
|||||||
av_freep(&wf->sectors);
|
av_freep(&wf->sectors);
|
||||||
av_freep(&pb->opaque);
|
av_freep(&pb->opaque);
|
||||||
av_freep(&pb->buffer);
|
av_freep(&pb->buffer);
|
||||||
av_free(pb);
|
avio_context_free(&pb);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user