diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-03-08 19:09:46 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-03-08 19:09:46 +0000 |
| commit | 3190fb98298ebdd29c41b2cf6019a381e71a6248 (patch) | |
| tree | c92a2332400ac7e38e5f30fe0497796866955cce /src/lib | |
| parent | 04bfeac6ccfe4e4c981a241f53138c765a0864a7 (diff) | |
Name audio analyses with stream ID so that you can see analyses
for different streams correctly.
Reported-by: Markus Raab
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/audio_content.cc | 4 | ||||
| -rw-r--r-- | src/lib/audio_content.h | 2 | ||||
| -rw-r--r-- | src/lib/ffmpeg_content.cc | 20 | ||||
| -rw-r--r-- | src/lib/ffmpeg_content.h | 1 | ||||
| -rw-r--r-- | src/lib/film.cc | 6 | ||||
| -rw-r--r-- | src/lib/film.h | 2 |
6 files changed, 28 insertions, 7 deletions
diff --git a/src/lib/audio_content.cc b/src/lib/audio_content.cc index b4c4f34b6..b96300e15 100644 --- a/src/lib/audio_content.cc +++ b/src/lib/audio_content.cc @@ -141,7 +141,9 @@ AudioContent::audio_analysis_path () const return boost::filesystem::path (); } - return film->audio_analysis_path (dynamic_pointer_cast<const AudioContent> (shared_from_this ())); + boost::filesystem::path p = film->audio_analysis_dir (); + p /= digest (); + return p; } string diff --git a/src/lib/audio_content.h b/src/lib/audio_content.h index ca4a1f234..d30db02d7 100644 --- a/src/lib/audio_content.h +++ b/src/lib/audio_content.h @@ -57,9 +57,9 @@ public: virtual int output_audio_frame_rate () const = 0; virtual AudioMapping audio_mapping () const = 0; virtual void set_audio_mapping (AudioMapping) = 0; + virtual boost::filesystem::path audio_analysis_path () const; boost::signals2::connection analyse_audio (boost::function<void()>); - boost::filesystem::path audio_analysis_path () const; void set_audio_gain (float); void set_audio_delay (int); diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc index 4ae5546c2..47fe4f807 100644 --- a/src/lib/ffmpeg_content.cc +++ b/src/lib/ffmpeg_content.cc @@ -477,3 +477,23 @@ FFmpegContent::identifier () const return s.str (); } +boost::filesystem::path +FFmpegContent::audio_analysis_path () const +{ + shared_ptr<const Film> film = _film.lock (); + if (!film) { + return boost::filesystem::path (); + } + + /* We need to include the stream ID in this path so that we get different + analyses for each stream. + */ + + boost::filesystem::path p = film->audio_analysis_dir (); + string name = digest (); + if (audio_stream ()) { + name += "_" + audio_stream()->identifier (); + } + p /= name; + return p; +} diff --git a/src/lib/ffmpeg_content.h b/src/lib/ffmpeg_content.h index 6dbff41d1..9600666b3 100644 --- a/src/lib/ffmpeg_content.h +++ b/src/lib/ffmpeg_content.h @@ -150,6 +150,7 @@ public: int output_audio_frame_rate () const; AudioMapping audio_mapping () const; void set_audio_mapping (AudioMapping); + boost::filesystem::path audio_analysis_path () const; void set_filters (std::vector<Filter const *> const &); diff --git a/src/lib/film.cc b/src/lib/film.cc index 1b724b27e..da48bc9b2 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -232,11 +232,9 @@ Film::filename_safe_name () const } boost::filesystem::path -Film::audio_analysis_path (shared_ptr<const AudioContent> c) const +Film::audio_analysis_dir () const { - boost::filesystem::path p = dir ("analysis"); - p /= c->digest(); - return p; + return dir ("analysis"); } /** Add suitable Jobs to the JobManager to create a DCP for this Film */ diff --git a/src/lib/film.h b/src/lib/film.h index 7e65ecb16..e5840621a 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -63,7 +63,7 @@ public: boost::filesystem::path info_path (int, Eyes) const; boost::filesystem::path internal_video_mxf_dir () const; boost::filesystem::path internal_video_mxf_filename () const; - boost::filesystem::path audio_analysis_path (boost::shared_ptr<const AudioContent>) const; + boost::filesystem::path audio_analysis_dir () const; boost::filesystem::path video_mxf_filename () const; boost::filesystem::path audio_mxf_filename () const; |
