Cleanup: remove an unnecessary shared_ptr.
authorCarl Hetherington <cth@carlh.net>
Tue, 7 Nov 2023 23:24:20 +0000 (00:24 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 20 Nov 2023 06:34:23 +0000 (07:34 +0100)
src/lib/audio_analyser.cc
src/lib/audio_analyser.h

index 8cbc3145b40d8e5dbc4bf4f0ce9c64324aa56392..5f8f88c5adfaa96cb63088819bd31549b82f92e0 100644 (file)
@@ -57,7 +57,7 @@ AudioAnalyser::AudioAnalyser (shared_ptr<const Film> film, shared_ptr<const Play
        , _playlist (playlist)
        , _set_progress (set_progress)
 #ifdef DCPOMATIC_HAVE_EBUR128_PATCHED_FFMPEG
-       , _ebur128 (new AudioFilterGraph(film->audio_frame_rate(), film->audio_channels()))
+       , _ebur128(film->audio_frame_rate(), film->audio_channels())
 #endif
        , _sample_peak (film->audio_channels())
        , _sample_peak_frame (film->audio_channels())
@@ -66,7 +66,7 @@ AudioAnalyser::AudioAnalyser (shared_ptr<const Film> film, shared_ptr<const Play
 
 #ifdef DCPOMATIC_HAVE_EBUR128_PATCHED_FFMPEG
        _filters.push_back (new Filter("ebur128", "ebur128", "audio", "ebur128=peak=true"));
-       _ebur128->setup (_filters);
+       _ebur128.setup(_filters);
 #endif
 
        _current = std::vector<AudioPoint>(_film->audio_channels());
@@ -145,7 +145,7 @@ AudioAnalyser::analyse (shared_ptr<AudioBuffers> b, DCPTime time)
 
 #ifdef DCPOMATIC_HAVE_EBUR128_PATCHED_FFMPEG
        if (Config::instance()->analyse_ebur128 ()) {
-               _ebur128->process (b);
+               _ebur128.process(b);
        }
 #endif
 
@@ -204,7 +204,7 @@ AudioAnalyser::finish ()
 
 #ifdef DCPOMATIC_HAVE_EBUR128_PATCHED_FFMPEG
        if (Config::instance()->analyse_ebur128 ()) {
-               void* eb = _ebur128->get("Parsed_ebur128_0")->priv;
+               void* eb = _ebur128.get("Parsed_ebur128_0")->priv;
                vector<float> true_peak;
                for (int i = 0; i < _film->audio_channels(); ++i) {
                        true_peak.push_back (av_ebur128_get_true_peaks(eb)[i]);
index 3568d853d20a42aca559428822693f5a5a4a7945..9dd92465e4c94aa4d0f608de543ac1576b3ddfdc 100644 (file)
@@ -20,6 +20,7 @@
 
 
 #include "audio_analysis.h"
+#include "audio_filter_graph.h"
 #include "dcpomatic_time.h"
 #include "types.h"
 #include <leqm_nrt.h>
@@ -29,7 +30,6 @@
 
 class AudioAnalysis;
 class AudioBuffers;
-class AudioFilterGraph;
 class AudioPoint;
 class Film;
 class Filter;
@@ -65,7 +65,7 @@ private:
 
        dcpomatic::DCPTime _start;
 #ifdef DCPOMATIC_HAVE_EBUR128_PATCHED_FFMPEG
-       std::shared_ptr<AudioFilterGraph> _ebur128;
+       AudioFilterGraph _ebur128;
 #endif
        std::vector<Filter const *> _filters;
        Frame _samples_per_point = 1;