Post-merge tidy-up.
authorCarl Hetherington <cth@carlh.net>
Tue, 13 Dec 2016 14:51:39 +0000 (14:51 +0000)
committerCarl Hetherington <cth@carlh.net>
Wed, 19 Apr 2017 22:04:32 +0000 (23:04 +0100)
12 files changed:
src/lib/audio_decoder.cc
src/lib/audio_decoder.h
src/lib/dcp_decoder.cc
src/lib/dcp_subtitle_decoder.cc
src/lib/ffmpeg_decoder.cc
src/lib/image_decoder.cc
src/lib/subtitle_decoder.cc
src/lib/subtitle_decoder.h
src/lib/text_subtitle_decoder.cc
src/lib/video_decoder.cc
src/lib/video_decoder.h
src/wx/subtitle_view.cc

index 6a795f3ac1906c3bf0979c9623424ae36a588e41..90f731108cbd66a940b64efe57eaf4409ce9b924 100644 (file)
@@ -73,6 +73,7 @@ AudioDecoder::emit (AudioStreamPtr stream, shared_ptr<const AudioBuffers> data,
        }
 
        _streams[stream]->audio (data, time);
+       _positions[stream] = time;
 }
 
 void
@@ -103,9 +104,3 @@ AudioDecoder::position () const
 
        return p;
 }
-
-void
-AudioDecoder::set_position (AudioStreamPtr stream, ContentTime time)
-{
-       _positions[stream] = time;
-}
index 68e99608fb2b42c2631d718018a59ebd8af685f5..10d88d1ec5f7f76c516881d93394b6659a9666c0 100644 (file)
@@ -46,7 +46,6 @@ public:
        AudioDecoder (Decoder* parent, boost::shared_ptr<const AudioContent>, boost::shared_ptr<Log> log);
 
        boost::optional<ContentTime> position () const;
-       void set_position (AudioStreamPtr stream, ContentTime position);
 
        void set_fast ();
        void flush ();
@@ -55,11 +54,10 @@ public:
 
        boost::signals2::signal<void (AudioStreamPtr, ContentAudio)> Data;
 
-       boost::optional<ContentTime> position () const;
-
 private:
        /** An AudioDecoderStream object to manage each stream in _audio_content */
-       std::map<AudioStreamPtr, boost::shared_ptr<AudioDecoderStream> > _streams;
+       typedef std::map<AudioStreamPtr, boost::shared_ptr<AudioDecoderStream> > StreamMap;
+       StreamMap _streams;
        std::map<AudioStreamPtr, ContentTime> _positions;
 };
 
index 665b5e560ccdd949c5a67b4fc4e67509800fb5d6..25c805d3f2ab74d8a9c77c7d7941d18a8e7aad93 100644 (file)
@@ -155,9 +155,6 @@ DCPDecoder::pass ()
                }
        }
 
-       video->set_position (_next);
-       audio->set_position (_dcp_content->audio->stream(), _next);
-       subtitle->set_position (_next);
        _next += ContentTime::from_frames (1, vfr);
 
        if ((*_reel)->main_picture ()) {
index 9db3254019675061cc0f8095abb9f89604b111f1..ea24bb1c50d0f62e1d93fdf1c84ddc5777dbdc08 100644 (file)
@@ -70,7 +70,6 @@ DCPSubtitleDecoder::pass ()
        }
 
        subtitle->emit_text (p, s);
-       subtitle->set_position (p.from);
 }
 
 ContentTimePeriod
index 57fe55892c3b4a85a06ab046c4bc46def689d99f..32903a20eb8995d4a2c2847f3b8b2d10e037afc5 100644 (file)
@@ -405,8 +405,6 @@ FFmpegDecoder::decode_audio_packet ()
                                LOG_WARNING ("Crazy timestamp %1", to_string (ct));
                        }
 
-                       audio->set_position (*stream, ct);
-
                        /* Give this data provided there is some, and its time is sane */
                        if (ct >= ContentTime() && data->frames() > 0) {
                                audio->emit (*stream, data, ct);
index b0841688fb23d11114b5af019636f9ab5c301f16..6d8f878efeef1a8fe0dd1cd44bed12708c11849b 100644 (file)
@@ -72,7 +72,6 @@ ImageDecoder::pass ()
                }
        }
 
-       video->set_position (ContentTime::from_frames (_frame_video_position, _image_content->active_video_frame_rate ()));
        video->emit (_image, _frame_video_position);
        ++_frame_video_position;
        return;
index c437ec9457b839c8095c444cc1bca828639d4a77..2a94343704737faf9ffdc515a42b4d514c628af3 100644 (file)
@@ -75,6 +75,7 @@ SubtitleDecoder::emit_text (ContentTimePeriod period, list<dcp::SubtitleString>
        }
 
        TextData (ContentTextSubtitle (period, s));
+       _position = period.from;
 }
 
 void
index a1c4b3ddc34b5db80455ec694243df81848e7dae..f44766393c4d889d8f4604a656a8905ac4aacd38 100644 (file)
@@ -48,10 +48,6 @@ public:
                boost::shared_ptr<Log> log
                );
 
-       void set_position (ContentTime position) {
-               _position = position;
-       }
-
        boost::optional<ContentTime> position () const {
                return _position;
        }
index b59808728607680c94a2b24549daa23baa3e318b..51a747fa9343b66d11a6472ff2b6d833aee13530 100644 (file)
@@ -59,7 +59,6 @@ TextSubtitleDecoder::pass ()
 
        ContentTimePeriod const p = content_time_period (_subtitles[_next]);
        subtitle->emit_text (p, _subtitles[_next]);
-       subtitle->set_position (p.from);
 
        ++_next;
        return;
index 6ec479ad262ff088fa735fe0fabd821473d2087e..8f711e367292fcedf0151e8978eb0ea8e6c09f2e 100644 (file)
@@ -94,4 +94,6 @@ VideoDecoder::emit (shared_ptr<const ImageProxy> image, Frame frame)
        default:
                DCPOMATIC_ASSERT (false);
        }
+
+       _position = ContentTime::from_frames (frame, _content->active_video_frame_rate ());
 }
index e9bef24f81d61cd184ddfd3e81e83eeb282b796a..6609811e4339f804288feda8b68ed8068329dcda 100644 (file)
@@ -51,10 +51,6 @@ public:
        friend struct ffmpeg_pts_offset_test;
        friend void ffmpeg_decoder_sequential_test_one (boost::filesystem::path file, float fps, int gaps, int video_length);
 
-       void set_position (ContentTime position) {
-               _position = position;
-       }
-
        boost::optional<ContentTime> position () const {
                return _position;
        }
index 6ec71fce5e91634a2495b4a8ddf33fb7f78312e7..a4218dc5d7f64658e2c19a9537ee6a2cf0f73df3 100644 (file)
@@ -27,6 +27,7 @@
 
 using std::list;
 using boost::shared_ptr;
+using boost::bind;
 using boost::dynamic_pointer_cast;
 
 SubtitleView::SubtitleView (wxWindow* parent, shared_ptr<Film> film, shared_ptr<Decoder> decoder, DCPTime position)