Remove Frame from PieceAudio.
authorCarl Hetherington <cth@carlh.net>
Tue, 4 May 2021 21:26:56 +0000 (23:26 +0200)
committerCarl Hetherington <cth@carlh.net>
Fri, 7 May 2021 07:29:59 +0000 (09:29 +0200)
src/lib/piece.cc
src/lib/piece_audio.h
src/lib/player.cc

index 7590698ab0098594df89814f785fd59c210a2604..65699a47ba34ec233f6c211c95155cb7241fedb0 100644 (file)
@@ -133,8 +133,7 @@ Piece::audio (AudioStreamPtr stream_ptr, shared_ptr<const AudioBuffers> audio, F
                stream.position = frame;
        }
 
-       auto const pos = stream.position;
-       Audio (PieceAudio(index, audio, pos, resampled_audio_to_dcp(pos), stream_ptr->mapping()));
+       Audio (PieceAudio(index, audio, resampled_audio_to_dcp(stream.position), stream_ptr->mapping()));
        stream.position += audio->frames();
 }
 
@@ -411,8 +410,7 @@ Piece::flush ()
        for (auto& i: _audio_streams) {
                auto ro = i.resampler->flush ();
                if (ro->frames() > 0) {
-                       auto const frame = i.position;
-                       Audio (PieceAudio(index, ro, frame, resampled_audio_to_dcp(frame), i.mapping));
+                       Audio (PieceAudio(index, ro, resampled_audio_to_dcp(i.position), i.mapping));
                        i.position += ro->frames();
                }
                ++index;
index e29cafd03607769e4085ab7a4d59c9699dcef88c..408805fefe631393048f1ed78bd13865fd40d1e7 100644 (file)
@@ -43,17 +43,15 @@ public:
                : audio (new AudioBuffers(0, 0))
        {}
 
-       PieceAudio (int s, std::shared_ptr<const AudioBuffers> a, Frame f, dcpomatic::DCPTime t, AudioMapping m)
+       PieceAudio (int s, std::shared_ptr<const AudioBuffers> a, dcpomatic::DCPTime t, AudioMapping m)
                : stream (s)
                , audio (a)
-               , frame (f)
                , time (t)
                , mapping (m)
        {}
 
        int stream; ///< index of stream within the Piece
        std::shared_ptr<const AudioBuffers> audio;
-       Frame frame = 0;
        dcpomatic::DCPTime time;
        AudioMapping mapping;
 };
index 2fa6805ba16930e10fdfa28bbedd276b87d571e7..35a08629eceeb3d5f02bd2181462119f6ab7ae6d 100644 (file)
@@ -909,7 +909,7 @@ Player::audio (weak_ptr<Piece> wp, PieceAudio audio)
                return;
        }
 
-       LOG_DEBUG_PLAYER("Received audio frame %1 at %2", audio.frame, to_string(audio.time));
+       LOG_DEBUG_PLAYER("Received audio at %1", to_string(audio.time));
 
        /* The end of this block in the DCP */
        int const rfr = piece->resampled_audio_frame_rate ();