From 22b13599407e45d85d1c83e0805aa14965b0ab19 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 13 Dec 2016 14:51:39 +0000 Subject: [PATCH] Post-merge tidy-up. --- src/lib/audio_decoder.cc | 7 +------ src/lib/audio_decoder.h | 6 ++---- src/lib/dcp_decoder.cc | 3 --- src/lib/dcp_subtitle_decoder.cc | 1 - src/lib/ffmpeg_decoder.cc | 2 -- src/lib/image_decoder.cc | 1 - src/lib/subtitle_decoder.cc | 1 + src/lib/subtitle_decoder.h | 4 ---- src/lib/text_subtitle_decoder.cc | 1 - src/lib/video_decoder.cc | 2 ++ src/lib/video_decoder.h | 4 ---- src/wx/subtitle_view.cc | 1 + 12 files changed, 7 insertions(+), 26 deletions(-) diff --git a/src/lib/audio_decoder.cc b/src/lib/audio_decoder.cc index 6a795f3ac..90f731108 100644 --- a/src/lib/audio_decoder.cc +++ b/src/lib/audio_decoder.cc @@ -73,6 +73,7 @@ AudioDecoder::emit (AudioStreamPtr stream, shared_ptr 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; -} diff --git a/src/lib/audio_decoder.h b/src/lib/audio_decoder.h index 68e99608f..10d88d1ec 100644 --- a/src/lib/audio_decoder.h +++ b/src/lib/audio_decoder.h @@ -46,7 +46,6 @@ public: AudioDecoder (Decoder* parent, boost::shared_ptr, boost::shared_ptr log); boost::optional position () const; - void set_position (AudioStreamPtr stream, ContentTime position); void set_fast (); void flush (); @@ -55,11 +54,10 @@ public: boost::signals2::signal Data; - boost::optional position () const; - private: /** An AudioDecoderStream object to manage each stream in _audio_content */ - std::map > _streams; + typedef std::map > StreamMap; + StreamMap _streams; std::map _positions; }; diff --git a/src/lib/dcp_decoder.cc b/src/lib/dcp_decoder.cc index 665b5e560..25c805d3f 100644 --- a/src/lib/dcp_decoder.cc +++ b/src/lib/dcp_decoder.cc @@ -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 ()) { diff --git a/src/lib/dcp_subtitle_decoder.cc b/src/lib/dcp_subtitle_decoder.cc index 9db325401..ea24bb1c5 100644 --- a/src/lib/dcp_subtitle_decoder.cc +++ b/src/lib/dcp_subtitle_decoder.cc @@ -70,7 +70,6 @@ DCPSubtitleDecoder::pass () } subtitle->emit_text (p, s); - subtitle->set_position (p.from); } ContentTimePeriod diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index 57fe55892..32903a20e 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -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); diff --git a/src/lib/image_decoder.cc b/src/lib/image_decoder.cc index b0841688f..6d8f878ef 100644 --- a/src/lib/image_decoder.cc +++ b/src/lib/image_decoder.cc @@ -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; diff --git a/src/lib/subtitle_decoder.cc b/src/lib/subtitle_decoder.cc index c437ec945..2a9434370 100644 --- a/src/lib/subtitle_decoder.cc +++ b/src/lib/subtitle_decoder.cc @@ -75,6 +75,7 @@ SubtitleDecoder::emit_text (ContentTimePeriod period, list } TextData (ContentTextSubtitle (period, s)); + _position = period.from; } void diff --git a/src/lib/subtitle_decoder.h b/src/lib/subtitle_decoder.h index a1c4b3ddc..f44766393 100644 --- a/src/lib/subtitle_decoder.h +++ b/src/lib/subtitle_decoder.h @@ -48,10 +48,6 @@ public: boost::shared_ptr log ); - void set_position (ContentTime position) { - _position = position; - } - boost::optional position () const { return _position; } diff --git a/src/lib/text_subtitle_decoder.cc b/src/lib/text_subtitle_decoder.cc index b59808728..51a747fa9 100644 --- a/src/lib/text_subtitle_decoder.cc +++ b/src/lib/text_subtitle_decoder.cc @@ -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; diff --git a/src/lib/video_decoder.cc b/src/lib/video_decoder.cc index 6ec479ad2..8f711e367 100644 --- a/src/lib/video_decoder.cc +++ b/src/lib/video_decoder.cc @@ -94,4 +94,6 @@ VideoDecoder::emit (shared_ptr image, Frame frame) default: DCPOMATIC_ASSERT (false); } + + _position = ContentTime::from_frames (frame, _content->active_video_frame_rate ()); } diff --git a/src/lib/video_decoder.h b/src/lib/video_decoder.h index e9bef24f8..6609811e4 100644 --- a/src/lib/video_decoder.h +++ b/src/lib/video_decoder.h @@ -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 position () const { return _position; } diff --git a/src/wx/subtitle_view.cc b/src/wx/subtitle_view.cc index 6ec71fce5..a4218dc5d 100644 --- a/src/wx/subtitle_view.cc +++ b/src/wx/subtitle_view.cc @@ -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, shared_ptr decoder, DCPTime position) -- 2.30.2