diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-05-27 16:38:28 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-05-27 16:38:28 +0100 |
| commit | 661de111c0dbc968ecb004eca5b26f8400b136f1 (patch) | |
| tree | 3097de840bd9b6acf48bc5cc857371998cb00bff /src | |
| parent | a28f926237c3de58c202843bea7913c276d0cbbc (diff) | |
FFmpegContent does not need audio_length().
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/audio_content.cc | 14 | ||||
| -rw-r--r-- | src/lib/audio_content.h | 3 | ||||
| -rw-r--r-- | src/lib/ffmpeg_content.cc | 14 | ||||
| -rw-r--r-- | src/lib/ffmpeg_content.h | 1 | ||||
| -rw-r--r-- | src/lib/single_stream_audio_content.cc | 1 | ||||
| -rw-r--r-- | src/lib/single_stream_audio_content.h | 2 | ||||
| -rw-r--r-- | src/wx/content_properties_dialog.cc | 7 |
7 files changed, 13 insertions, 29 deletions
diff --git a/src/lib/audio_content.cc b/src/lib/audio_content.cc index def123fb1..e4b5a804e 100644 --- a/src/lib/audio_content.cc +++ b/src/lib/audio_content.cc @@ -40,12 +40,11 @@ using boost::shared_ptr; using boost::dynamic_pointer_cast; int const AudioContentProperty::AUDIO_CHANNELS = 200; -int const AudioContentProperty::AUDIO_LENGTH = 201; -int const AudioContentProperty::AUDIO_FRAME_RATE = 202; -int const AudioContentProperty::AUDIO_GAIN = 203; -int const AudioContentProperty::AUDIO_DELAY = 204; -int const AudioContentProperty::AUDIO_MAPPING = 205; -int const AudioContentProperty::AUDIO_PROCESSOR = 206; +int const AudioContentProperty::AUDIO_FRAME_RATE = 201; +int const AudioContentProperty::AUDIO_GAIN = 202; +int const AudioContentProperty::AUDIO_DELAY = 203; +int const AudioContentProperty::AUDIO_MAPPING = 204; +int const AudioContentProperty::AUDIO_PROCESSOR = 205; AudioContent::AudioContent (shared_ptr<const Film> f) : Content (f) @@ -188,9 +187,8 @@ string AudioContent::technical_summary () const { return String::compose ( - "audio: channels %1, length %2 frames, content rate %3, resampled rate %4", + "audio: channels %1, content rate %2, resampled rate %3", audio_channels(), - audio_length(), audio_frame_rate(), resampled_audio_frame_rate() ); diff --git a/src/lib/audio_content.h b/src/lib/audio_content.h index ee5a7db7a..85728922a 100644 --- a/src/lib/audio_content.h +++ b/src/lib/audio_content.h @@ -40,7 +40,6 @@ class AudioContentProperty { public: static int const AUDIO_CHANNELS; - static int const AUDIO_LENGTH; static int const AUDIO_FRAME_RATE; static int const AUDIO_GAIN; static int const AUDIO_DELAY; @@ -65,8 +64,6 @@ public: /** @return number of audio channels in the content */ virtual int audio_channels () const = 0; - /** @return the length of the audio in the content */ - virtual Frame audio_length () const = 0; /** @return the frame rate of the content */ virtual int audio_frame_rate () const = 0; virtual AudioMapping audio_mapping () const = 0; diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc index 9acc883fd..1ca194f09 100644 --- a/src/lib/ffmpeg_content.cc +++ b/src/lib/ffmpeg_content.cc @@ -249,20 +249,6 @@ FFmpegContent::set_audio_stream (shared_ptr<FFmpegAudioStream> s) signal_changed (FFmpegContentProperty::AUDIO_STREAM); } -Frame -FFmpegContent::audio_length () const -{ - if (!audio_stream ()) { - return 0; - } - - /* We're talking about the content's audio length here, at the content's frame - rate. We assume it's the same as the video's length, and we can just convert - using the content's rates. - */ - return (video_length () / video_frame_rate ()) * audio_frame_rate (); -} - int FFmpegContent::audio_channels () const { diff --git a/src/lib/ffmpeg_content.h b/src/lib/ffmpeg_content.h index cff5eaed8..6d27c66ca 100644 --- a/src/lib/ffmpeg_content.h +++ b/src/lib/ffmpeg_content.h @@ -69,7 +69,6 @@ public: /* AudioContent */ int audio_channels () const; - Frame audio_length () const; int audio_frame_rate () const; AudioMapping audio_mapping () const; void set_audio_mapping (AudioMapping); diff --git a/src/lib/single_stream_audio_content.cc b/src/lib/single_stream_audio_content.cc index b470d1a99..76f6e00d9 100644 --- a/src/lib/single_stream_audio_content.cc +++ b/src/lib/single_stream_audio_content.cc @@ -89,7 +89,6 @@ SingleStreamAudioContent::take_from_audio_examiner (shared_ptr<AudioExaminer> ex } signal_changed (AudioContentProperty::AUDIO_CHANNELS); - signal_changed (AudioContentProperty::AUDIO_LENGTH); signal_changed (AudioContentProperty::AUDIO_FRAME_RATE); int const p = processed_audio_channels (); diff --git a/src/lib/single_stream_audio_content.h b/src/lib/single_stream_audio_content.h index d1d512d67..944d887b0 100644 --- a/src/lib/single_stream_audio_content.h +++ b/src/lib/single_stream_audio_content.h @@ -44,7 +44,7 @@ public: boost::mutex::scoped_lock lm (_mutex); return _audio_channels; } - + Frame audio_length () const { boost::mutex::scoped_lock lm (_mutex); return _audio_length; diff --git a/src/wx/content_properties_dialog.cc b/src/wx/content_properties_dialog.cc index 45593fd5b..c212eb50a 100644 --- a/src/wx/content_properties_dialog.cc +++ b/src/wx/content_properties_dialog.cc @@ -23,6 +23,7 @@ #include "lib/content.h" #include "lib/video_content.h" #include "lib/audio_content.h" +#include "lib/single_stream_audio_content.h" #include <boost/algorithm/string.hpp> using std::string; @@ -58,9 +59,13 @@ ContentPropertiesDialog::ContentPropertiesDialog (wxWindow* parent, shared_ptr<C _("Audio channels"), std_to_wx (raw_convert<string> (audio->audio_channels ())) ); + } + + shared_ptr<SingleStreamAudioContent> single = dynamic_pointer_cast<SingleStreamAudioContent> (content); + if (single) { add_property ( _("Audio length"), - std_to_wx (raw_convert<string> (audio->audio_length())) + " " + _("audio frames") + std_to_wx (raw_convert<string> (single->audio_length())) + " " + _("audio frames") ); } |
