Clarify one log message and add another.
[dcpomatic.git] / src / lib / audio_analyser.cc
index 755d6e9b07e6a9488a6f51b959e56191d1597e6f..1556f921de634b27103ec2276d9013c9bd22d9cd 100644 (file)
 #include "filter.h"
 #include "playlist.h"
 #include "types.h"
-#include "warnings.h"
+#include <dcp/warnings.h>
 extern "C" {
 #include <leqm_nrt.h>
-DCPOMATIC_DISABLE_WARNINGS
+LIBDCP_DISABLE_WARNINGS
 #include <libavutil/channel_layout.h>
 #ifdef DCPOMATIC_HAVE_EBUR128_PATCHED_FFMPEG
 #include <libavfilter/f_ebur128.h>
 #endif
-DCPOMATIC_ENABLE_WARNINGS
+LIBDCP_ENABLE_WARNINGS
 }
 
 
@@ -136,8 +136,13 @@ AudioAnalyser::~AudioAnalyser ()
 void
 AudioAnalyser::analyse (shared_ptr<AudioBuffers> b, DCPTime time)
 {
-       LOG_DEBUG_AUDIO_ANALYSIS("Received %1 frames at %2", b->frames(), to_string(time));
+       LOG_DEBUG_AUDIO_ANALYSIS("AudioAnalyser received %1 frames at %2", b->frames(), to_string(time));
        DCPOMATIC_ASSERT (time >= _start);
+       /* In bug #2364 we had a lot of frames arriving here (~47s worth) which
+        * caused an OOM error on Windows.  Check for the number of frames being
+        * reasonable here to make sure we catch this if it happens again.
+        */
+       DCPOMATIC_ASSERT(b->frames() < 480000);
 
 #ifdef DCPOMATIC_HAVE_EBUR128_PATCHED_FFMPEG
        if (Config::instance()->analyse_ebur128 ()) {