[FFmpeg-cvslog] avcodec/libopusenc: Fix infinite loop on flushing after 0 input
Michael Niedermayer
git at videolan.org
Sun Dec 6 12:57:07 CET 2015
ffmpeg | branch: release/2.4 | Michael Niedermayer <michael at niedermayer.cc> | Thu Aug 27 12:44:31 2015 +0200| [ab79e3d1a5f9b2d677273d15970a719b8be039bf] | committer: Michael Niedermayer
avcodec/libopusenc: Fix infinite loop on flushing after 0 input
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 6701c92fa4269872856c70c3170a9b3291b46247)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ab79e3d1a5f9b2d677273d15970a719b8be039bf
---
libavcodec/libopusenc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/libopusenc.c b/libavcodec/libopusenc.c
index 9a1952a..dadd7f0 100644
--- a/libavcodec/libopusenc.c
+++ b/libavcodec/libopusenc.c
@@ -324,7 +324,7 @@ static int libopus_encode(AVCodecContext *avctx, AVPacket *avpkt,
} else
audio = frame->data[0];
} else {
- if (!opus->afq.remaining_samples)
+ if (!opus->afq.remaining_samples || (!opus->afq.frame_alloc && !opus->afq.frame_count))
return 0;
audio = opus->samples;
memset(audio, 0, opus->opts.packet_size * sample_size);
More information about the ffmpeg-cvslog
mailing list