avformat/flacenc: add a deinit function

Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2019-10-20 23:44:05 -03:00
parent df57246aaf
commit aeb8b65cdf
1 changed files with 9 additions and 2 deletions

View File

@ -348,11 +348,17 @@ static int flac_write_trailer(struct AVFormatContext *s)
av_log(s, AV_LOG_WARNING, "unable to rewrite FLAC header.\n"); av_log(s, AV_LOG_WARNING, "unable to rewrite FLAC header.\n");
} }
av_freep(&c->streaminfo);
return 0; return 0;
} }
static void flac_deinit(struct AVFormatContext *s)
{
FlacMuxerContext *c = s->priv_data;
ff_packet_list_free(&c->queue, &c->queue_end);
av_freep(&c->streaminfo);
}
static int flac_write_packet(struct AVFormatContext *s, AVPacket *pkt) static int flac_write_packet(struct AVFormatContext *s, AVPacket *pkt)
{ {
FlacMuxerContext *c = s->priv_data; FlacMuxerContext *c = s->priv_data;
@ -425,6 +431,7 @@ AVOutputFormat ff_flac_muxer = {
.write_header = flac_write_header, .write_header = flac_write_header,
.write_packet = flac_write_packet, .write_packet = flac_write_packet,
.write_trailer = flac_write_trailer, .write_trailer = flac_write_trailer,
.deinit = flac_deinit,
.flags = AVFMT_NOTIMESTAMPS, .flags = AVFMT_NOTIMESTAMPS,
.priv_class = &flac_muxer_class, .priv_class = &flac_muxer_class,
}; };