提交 a1c0062f authored 作者: Seven Du's avatar Seven Du

FS-8914 feed NULL to flush encoder at the end of recording, this fixes possible infinite loop

上级 e840bd9a
...@@ -725,7 +725,7 @@ static void *SWITCH_THREAD_FUNC video_thread_run(switch_thread_t *thread, void * ...@@ -725,7 +725,7 @@ static void *SWITCH_THREAD_FUNC video_thread_run(switch_thread_t *thread, void *
av_init_packet(&pkt); 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) { if (ret < 0) {
break; break;
...@@ -735,6 +735,8 @@ static void *SWITCH_THREAD_FUNC video_thread_run(switch_thread_t *thread, void * ...@@ -735,6 +735,8 @@ static void *SWITCH_THREAD_FUNC video_thread_run(switch_thread_t *thread, void *
switch_mutex_unlock(eh->mutex); switch_mutex_unlock(eh->mutex);
av_free_packet(&pkt); av_free_packet(&pkt);
if (ret < 0) break; if (ret < 0) break;
} else {
break;
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论