Re: [FFmpeg-devel] [PATCH] fix memory leak in frame_thread_encoder: occurs when close encoder without sending eof and receiving to end
On Mon, Aug 06, 2018 at 01:13:00AM +0200, Michael Niedermayer wrote: > On Sat, Aug 04, 2018 at 10:19:45AM +, lee ju wrote: > > --- > > libavcodec/frame_thread_encoder.c | 17 + > > 1 file changed, 17 insertions(+) > > probably ok will apply thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Those who are too smart to engage in politics are punished by being governed by those who are dumber. -- Plato signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] fix memory leak in frame_thread_encoder: occurs when close encoder without sending eof and receiving to end
On Sat, Aug 04, 2018 at 10:19:45AM +, lee ju wrote: > --- > libavcodec/frame_thread_encoder.c | 17 + > 1 file changed, 17 insertions(+) probably ok thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Awnsering whenever a program halts or runs forever is On a turing machine, in general impossible (turings halting problem). On any real computer, always possible as a real computer has a finite number of states N, and will either halt in less than N cycles or never halt. signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] fix memory leak in frame_thread_encoder: occurs when close encoder without sending eof and receiving to end
--- libavcodec/frame_thread_encoder.c | 17 + 1 file changed, 17 insertions(+) diff --git a/libavcodec/frame_thread_encoder.c b/libavcodec/frame_thread_encoder.c index 5ff3f7863c..55756c4c54 100644 --- a/libavcodec/frame_thread_encoder.c +++ b/libavcodec/frame_thread_encoder.c @@ -251,6 +251,23 @@ void ff_frame_thread_encoder_free(AVCodecContext *avctx){ pthread_join(c->worker[i], NULL); } +while (av_fifo_size(c->task_fifo) > 0) { +Task task; +AVFrame *frame; +av_fifo_generic_read(c->task_fifo, , sizeof(task), NULL); +frame = task.indata; +av_frame_free(); +task.indata = NULL; +} + +for (i=0; ifinished_tasks[i].outdata != NULL) { +AVPacket *pkt = c->finished_tasks[i].outdata; +av_packet_free(); +c->finished_tasks[i].outdata = NULL; +} +} + pthread_mutex_destroy(>task_fifo_mutex); pthread_mutex_destroy(>finished_task_mutex); pthread_mutex_destroy(>buffer_mutex); -- 2.17.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel