From ea910e250a0fb3b0ad3ce0cf32dd27b24c17cd1d Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 11 Dec 2013 10:31:18 +0000 Subject: Various work on better seeking (and seeking of audio). --- src/lib/image_decoder.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib/image_decoder.cc') diff --git a/src/lib/image_decoder.cc b/src/lib/image_decoder.cc index fb6053ae5..bf3bc344b 100644 --- a/src/lib/image_decoder.cc +++ b/src/lib/image_decoder.cc @@ -77,9 +77,9 @@ ImageDecoder::pass () } void -ImageDecoder::seek (VideoContent::Frame frame, bool) +ImageDecoder::seek (Time time, bool) { - _video_position = frame; + _video_position = _video_content->time_to_content_video_frames (time); } bool -- cgit v1.2.3 From 097a1fb413bbbb89182161d4c1a31daa5419ec96 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 13 Dec 2013 10:06:18 +0000 Subject: Time -> DCPTime. --- src/lib/analyse_audio_job.cc | 2 +- src/lib/analyse_audio_job.h | 2 +- src/lib/audio_content.cc | 4 +- src/lib/audio_content.h | 4 +- src/lib/audio_merger.h | 2 +- src/lib/content.cc | 18 ++++----- src/lib/content.h | 30 +++++++-------- src/lib/decoder.h | 2 +- src/lib/ffmpeg_content.cc | 2 +- src/lib/ffmpeg_content.h | 2 +- src/lib/ffmpeg_decoder.cc | 14 +++---- src/lib/ffmpeg_decoder.h | 4 +- src/lib/film.cc | 12 +++--- src/lib/film.h | 12 +++--- src/lib/image_content.cc | 2 +- src/lib/image_content.h | 2 +- src/lib/image_decoder.cc | 2 +- src/lib/image_decoder.h | 2 +- src/lib/job.cc | 2 +- src/lib/player.cc | 34 ++++++++--------- src/lib/player.h | 30 +++++++-------- src/lib/playlist.cc | 20 +++++----- src/lib/playlist.h | 6 +-- src/lib/sndfile_content.cc | 2 +- src/lib/sndfile_content.h | 2 +- src/lib/sndfile_decoder.cc | 2 +- src/lib/sndfile_decoder.h | 2 +- src/lib/subtitle_decoder.cc | 2 +- src/lib/subtitle_decoder.h | 6 +-- src/lib/timer.cc | 14 +++---- src/lib/timer.h | 18 ++++----- src/lib/types.h | 5 ++- src/lib/video_content.cc | 4 +- src/lib/video_content.h | 4 +- src/tools/server_test.cc | 2 +- src/wx/audio_plot.cc | 2 +- src/wx/film_editor.cc | 4 +- src/wx/film_editor.h | 6 +-- src/wx/film_viewer.cc | 8 ++-- src/wx/film_viewer.h | 4 +- src/wx/timecode.cc | 26 ++++++------- src/wx/timecode.h | 8 ++-- src/wx/timeline.cc | 86 +++++++++++++++++++++---------------------- src/wx/timeline.h | 10 ++--- src/wx/timeline_dialog.cc | 8 ++-- src/wx/timeline_dialog.h | 6 +-- src/wx/timing_panel.cc | 10 ++--- src/wx/timing_panel.h | 12 +++--- test/ffmpeg_seek_test.cc | 12 +++--- test/long_ffmpeg_seek_test.cc | 12 +++--- test/play_test.cc | 6 +-- 51 files changed, 247 insertions(+), 246 deletions(-) (limited to 'src/lib/image_decoder.cc') diff --git a/src/lib/analyse_audio_job.cc b/src/lib/analyse_audio_job.cc index 8186f9de4..3f84bf16d 100644 --- a/src/lib/analyse_audio_job.cc +++ b/src/lib/analyse_audio_job.cc @@ -81,7 +81,7 @@ AnalyseAudioJob::run () } void -AnalyseAudioJob::audio (shared_ptr b, Time) +AnalyseAudioJob::audio (shared_ptr b, DCPTime) { for (int i = 0; i < b->frames(); ++i) { for (int j = 0; j < b->channels(); ++j) { diff --git a/src/lib/analyse_audio_job.h b/src/lib/analyse_audio_job.h index 3d4881983..2e93ef500 100644 --- a/src/lib/analyse_audio_job.h +++ b/src/lib/analyse_audio_job.h @@ -33,7 +33,7 @@ public: void run (); private: - void audio (boost::shared_ptr, Time); + void audio (boost::shared_ptr, DCPTime); boost::weak_ptr _content; OutputAudioFrame _done; diff --git a/src/lib/audio_content.cc b/src/lib/audio_content.cc index 0c4586681..de743571b 100644 --- a/src/lib/audio_content.cc +++ b/src/lib/audio_content.cc @@ -39,7 +39,7 @@ int const AudioContentProperty::AUDIO_GAIN = 203; int const AudioContentProperty::AUDIO_DELAY = 204; int const AudioContentProperty::AUDIO_MAPPING = 205; -AudioContent::AudioContent (shared_ptr f, Time s) +AudioContent::AudioContent (shared_ptr f, DCPTime s) : Content (f, s) , _audio_gain (0) , _audio_delay (0) @@ -157,7 +157,7 @@ AudioContent::technical_summary () const * the `controlling' video content is active. */ AudioContent::Frame -AudioContent::time_to_content_audio_frames (Time t, Time at) const +AudioContent::time_to_content_audio_frames (DCPTime t, DCPTime at) const { shared_ptr film = _film.lock (); assert (film); diff --git a/src/lib/audio_content.h b/src/lib/audio_content.h index 10114e10d..e1b38bd97 100644 --- a/src/lib/audio_content.h +++ b/src/lib/audio_content.h @@ -43,7 +43,7 @@ class AudioContent : public virtual Content public: typedef int64_t Frame; - AudioContent (boost::shared_ptr, Time); + AudioContent (boost::shared_ptr, DCPTime); AudioContent (boost::shared_ptr, boost::filesystem::path); AudioContent (boost::shared_ptr, boost::shared_ptr); AudioContent (boost::shared_ptr, std::vector >); @@ -74,7 +74,7 @@ public: return _audio_delay; } - Frame time_to_content_audio_frames (Time, Time) const; + Frame time_to_content_audio_frames (DCPTime, DCPTime) const; private: /** Gain to apply to audio in dB */ diff --git a/src/lib/audio_merger.h b/src/lib/audio_merger.h index 6ad33fb37..2a1cc761b 100644 --- a/src/lib/audio_merger.h +++ b/src/lib/audio_merger.h @@ -102,7 +102,7 @@ public: } void - clear (Time t) + clear (DCPTime t) { _last_pull = t; _buffers.reset (new AudioBuffers (_buffers->channels(), 0)); diff --git a/src/lib/content.cc b/src/lib/content.cc index f09012765..7db349617 100644 --- a/src/lib/content.cc +++ b/src/lib/content.cc @@ -54,7 +54,7 @@ Content::Content (shared_ptr f) } -Content::Content (shared_ptr f, Time p) +Content::Content (shared_ptr f, DCPTime p) : _film (f) , _position (p) , _trim_start (0) @@ -83,9 +83,9 @@ Content::Content (shared_ptr f, shared_ptr node) _paths.push_back ((*i)->content ()); } _digest = node->string_child ("Digest"); - _position = node->number_child