Hi Michael, The attached is against git master.
On Sat, Dec 5, 2015 at 5:34 AM, Michael Niedermayer <michae...@gmx.at> wrote: > On Fri, Dec 04, 2015 at 11:20:17AM +0800, Lvqier wrote: > > Hi, > > > > I am using FFmpeg to generate mpegts segments. FFmpeg has memory > > leaks, see the valgrind output in the attachment. > > > > Command line to reproduce: > > > valgrind --tool=memcheck --leak-check=full ./ffmpeg_g -f decklink > > -i 'DeckLink Mini Recorder@14' -map 0 -acodec libvo_aacenc -vcodec > > libx264 -pix_fmt yuv420p -vprofile baseline -q 2 -r 25 -g 25 -dn -f > > stream_segment -segment_format mpegts -segment_time 10 > > /dev/shm/capture/libav-%010d.ts > > > > I have read the source code of libavformat/segment.c and make a > > patch which is attached as well to fix it. > > > > -- > > /Best Regards, > > lvqier - lvq...@gmail.com <mailto:lvq...@gmail.com> > > / > > > > ****************************************** > > 青春如烟,唱一首笑忘歌 > > > > > segment.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > ecd80dc49306e15e9eff71f9192d7a861e53c4e5 patch.diff > > --- ../ffmpeg-2.8.1/libavformat/segment.c 2015-09-09 > 09:17:47.000000000 +0800 > > patches should be against git master > > > > +++ libavformat/segment.c 2015-12-03 14:37:45.000000000 +0800 > > @@ -388,6 +388,7 @@ > > > > end: > > avio_closep(&oc->pb); > > + av_freep(&seg->cur_entry.filename); > > > > return ret; > > } > > @@ -887,7 +888,7 @@ > > av_opt_free(seg); > > av_freep(&seg->times); > > av_freep(&seg->frames); > > - av_freep(&seg->cur_entry.filename); > > > +// av_freep(&seg->cur_entry.filename); > > outcommented code like this doesnt belong in git master > > [...] > > -- > Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB > > Opposition brings concord. Out of discord comes the fairest harmony. > -- Heraclitus > > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > -- 牛奶糖有着让人幸福的味道 尝一下的话就会在嘴里像花儿绽放一样
diff --git a/libavformat/segment.c b/libavformat/segment.c index 8432d0f..b5ee207 100644 --- a/libavformat/segment.c +++ b/libavformat/segment.c @@ -388,6 +388,7 @@ static int segment_end(AVFormatContext *s, int write_trailer, int is_last) end: avio_closep(&oc->pb); + av_freep(&seg->cur_entry.filename); return ret; } @@ -887,7 +888,6 @@ fail: av_opt_free(seg); av_freep(&seg->times); av_freep(&seg->frames); - av_freep(&seg->cur_entry.filename); cur = seg->segment_list_entries; while (cur) {
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel