From: Seven Du Date: Wed, 23 Mar 2016 12:00:24 +0000 (+0800) Subject: FS-8914 feed NULL to flush encoder at the end of recording, this fixes possible infin... X-Git-Tag: v1.6.7^2~62 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a1c0062fef27848550083e6c024abb2fd8668938;p=thirdparty%2Ffreeswitch.git FS-8914 feed NULL to flush encoder at the end of recording, this fixes possible infinite loop --- diff --git a/src/mod/applications/mod_av/avformat.c b/src/mod/applications/mod_av/avformat.c index 4d08f70644..dc8b4d9d2f 100644 --- a/src/mod/applications/mod_av/avformat.c +++ b/src/mod/applications/mod_av/avformat.c @@ -725,7 +725,7 @@ static void *SWITCH_THREAD_FUNC video_thread_run(switch_thread_t *thread, void * av_init_packet(&pkt); - ret = avcodec_encode_video2(eh->video_st->st->codec, &pkt, eh->video_st->frame, &got_packet); + ret = avcodec_encode_video2(eh->video_st->st->codec, &pkt, NULL, &got_packet); if (ret < 0) { break; @@ -735,6 +735,8 @@ static void *SWITCH_THREAD_FUNC video_thread_run(switch_thread_t *thread, void * switch_mutex_unlock(eh->mutex); av_free_packet(&pkt); if (ret < 0) break; + } else { + break; } }