summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-12-13 14:51:39 +0000
committerCarl Hetherington <cth@carlh.net>2017-04-19 23:04:32 +0100
commit22b13599407e45d85d1c83e0805aa14965b0ab19 (patch)
tree38aa5015affeca6ad390a7951c8ebf24d64f4d05 /src
parenta78b741c43830c84bcb4d18e3147746f13a668e5 (diff)
Post-merge tidy-up.
Diffstat (limited to 'src')
-rw-r--r--src/lib/audio_decoder.cc7
-rw-r--r--src/lib/audio_decoder.h6
-rw-r--r--src/lib/dcp_decoder.cc3
-rw-r--r--src/lib/dcp_subtitle_decoder.cc1
-rw-r--r--src/lib/ffmpeg_decoder.cc2
-rw-r--r--src/lib/image_decoder.cc1
-rw-r--r--src/lib/subtitle_decoder.cc1
-rw-r--r--src/lib/subtitle_decoder.h4
-rw-r--r--src/lib/text_subtitle_decoder.cc1
-rw-r--r--src/lib/video_decoder.cc2
-rw-r--r--src/lib/video_decoder.h4
-rw-r--r--src/wx/subtitle_view.cc1
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<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;
-}
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<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;
};
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<dcp::SubtitleString>
}
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> log
);
- void set_position (ContentTime position) {
- _position = position;
- }
-
boost::optional<ContentTime> 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<const ImageProxy> 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<ContentTime> 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> film, shared_ptr<Decoder> decoder, DCPTime position)