[FFmpeg-devel] [PATCH 1/2] avformat/dashenc: Fix a resource leak when http persistent in enabled
Jeyapal, Karthick
kjeyapal at akamai.com
Tue Jan 2 10:23:13 EET 2018
On 1/2/18 1:41 PM, 刘歧 wrote:
>
>> On 2 Jan 2018, at 14:48, Karthick J <kjeyapal at akamai.com> wrote:
>>
>> From: Karthick Jeyapal <kjeyapal at akamai.com>
>>
>> ---
>> libavformat/dashenc.c | 11 +++++++++++
>> 1 file changed, 11 insertions(+)
>>
>> diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
>> index 3345b89..c4c112b 100644
>> --- a/libavformat/dashenc.c
>> +++ b/libavformat/dashenc.c
>> @@ -1,6 +1,7 @@
>> /*
>> * MPEG-DASH ISO BMFF segmenter
>> * Copyright (c) 2014 Martin Storsjo
>> + * Copyright (c) 2018 Akamai Technologies, Inc.
>> *
>> * This file is part of FFmpeg.
>> *
>> @@ -1317,6 +1318,16 @@ static int dash_write_trailer(AVFormatContext *s)
>> }
>> dash_flush(s, 1, -1);
>>
>> + if (c->http_persistent) {
>> + int i;
>> + for (i = 0; i < s->nb_streams; i++) {
>> + OutputStream *os = &c->streams[i];
>> + ff_format_io_close(s, &os->out);
>> + }
>> + ff_format_io_close(s, &c->mpd_out);
>> + ff_format_io_close(s, &c->m3u8_out);
>> + }
>> +
>> if (c->remove_at_exit) {
>> char filename[1024];
>> int i;
>> --
>> 1.9.1
>>
>
> LGTM
Thanks.
But I overlooked the presence dash_free function in this patch.
I have sent a new patch v2, which I think looks better than this. What do you think?
Sorry for any inconvenience caused.
>
> Thanks
>
> Steven
>
>
>
More information about the ffmpeg-devel
mailing list