File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
src/modules/ffmpeg/producer Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -844,6 +844,8 @@ struct AVProducer::Impl
844844 timer decode_timer;
845845
846846 int warning_debounce = 0 ;
847+ uint8_t warning_count = 0 ;
848+ const uint8_t max_warnings = 5 ;
847849
848850 while (!thread_.interruption_requested ()) {
849851 {
@@ -904,14 +906,18 @@ struct AVProducer::Impl
904906
905907 if ((!video_filter_.frame && !video_filter_.eof ) || (!audio_filter_.frame && !audio_filter_.eof )) {
906908 if (!progress) {
907- if (warning_debounce++ % 500 == 100 ) {
909+ if (warning_debounce++ % 500 == 100 && warning_count < max_warnings ) {
908910 if (!video_filter_.frame && !video_filter_.eof ) {
909911 CASPAR_LOG (warning) << print () << " Waiting for video frame..." ;
910912 } else if (!audio_filter_.frame && !audio_filter_.eof ) {
911913 CASPAR_LOG (warning) << print () << " Waiting for audio frame..." ;
912914 } else {
913915 CASPAR_LOG (warning) << print () << " Waiting for frame..." ;
914916 }
917+ warning_count++;
918+ if (warning_count == max_warnings) {
919+ CASPAR_LOG (warning) << print () << " Too many warnings. Silencing." ;
920+ }
915921 }
916922
917923 // TODO (perf): Avoid live loop.
@@ -920,7 +926,7 @@ struct AVProducer::Impl
920926 continue ;
921927 }
922928
923- warning_debounce = 0 ;
929+ warning_debounce = warning_count = 0 ;
924930
925931 // TODO (fix)
926932 // if (start_ != AV_NOPTS_VALUE && frame.pts < start_) {
You can’t perform that action at this time.
0 commit comments