Skip to content

Commit

Permalink
Revert "Break out of the FFmpegFrameRecorder writePacket loop after m…
Browse files Browse the repository at this point in the history
…axRetries iterations instead of a single iteration."

This reverts commit 2eac6da.
  • Loading branch information
Josh Bultman committed Dec 2, 2024
1 parent 2eac6da commit bc8af55
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/main/java/org/bytedeco/javacv/FFmpegFrameRecorder.java
Original file line number Diff line number Diff line change
Expand Up @@ -1350,8 +1350,6 @@ private boolean writeFrame(AVFrame frame) throws Exception {
frame.pts(frame.pts() + frame.nb_samples()); // magic required by libvorbis and webm
}

int retries = 0;
int maxRetries = 1000;
/* if zero size, it means the image was buffered */
got_audio_packet[0] = 0;
while (ret >= 0) {
Expand All @@ -1378,7 +1376,7 @@ private boolean writeFrame(AVFrame frame) throws Exception {
/* write the compressed frame in the media file */
writePacket(AVMEDIA_TYPE_AUDIO, audio_pkt);

if (frame == null && retries++ > maxRetries) {
if (frame == null) {
// avoid infinite loop with buggy codecs on flush
break;
}
Expand Down

0 comments on commit bc8af55

Please sign in to comment.