Supporters update.
[dcpomatic.git] / src / lib / audio_filter_graph.cc
index 95f6730cf4f24d99d43a981e6056c8058366406f..4e3052d57c519eccc3f390e01d5f3e4c3ad6da5f 100644 (file)
@@ -22,6 +22,8 @@
 #include "audio_buffers.h"
 #include "audio_filter_graph.h"
 #include "compose.hpp"
+#include "dcpomatic_assert.h"
+#include "exceptions.h"
 extern "C" {
 #include <libavfilter/buffersink.h>
 #include <libavfilter/buffersrc.h>
@@ -53,6 +55,9 @@ AudioFilterGraph::AudioFilterGraph (int sample_rate, int channels)
        }
 
        _in_frame = av_frame_alloc ();
+       if (_in_frame == nullptr) {
+               throw std::bad_alloc();
+       }
 }
 
 AudioFilterGraph::~AudioFilterGraph()
@@ -106,7 +111,7 @@ AudioFilterGraph::sink_name () const
 }
 
 void
-AudioFilterGraph::process (shared_ptr<const AudioBuffers> buffers)
+AudioFilterGraph::process (shared_ptr<AudioBuffers> buffers)
 {
        DCPOMATIC_ASSERT (buffers->frames() > 0);
        int const process_channels = av_get_channel_layout_nb_channels (_channel_layout);