diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-05-20 16:21:55 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-05-20 16:21:55 +0100 |
| commit | 0c66eaeac227d6aeb63a7a36e202ef87081dc222 (patch) | |
| tree | fe59970e8ca5d6bfc7859fa6f901b1f1ed04eb33 /src/lib/ffmpeg_content.cc | |
| parent | 56aa7eef1572e48c96ff198ee52a5a5fe17a6bf0 (diff) | |
Some basics of AudioMapping.
Diffstat (limited to 'src/lib/ffmpeg_content.cc')
| -rw-r--r-- | src/lib/ffmpeg_content.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/lib/ffmpeg_content.cc b/src/lib/ffmpeg_content.cc index f0df15193..d730f3ecb 100644 --- a/src/lib/ffmpeg_content.cc +++ b/src/lib/ffmpeg_content.cc @@ -1,3 +1,5 @@ +/* -*- c-basic-offset: 8; default-tab-width: 8; -*- */ + /* Copyright (C) 2013 Carl Hetherington <cth@carlh.net> @@ -88,6 +90,7 @@ FFmpegContent::as_xml (xmlpp::Node* node) const node->add_child("Type")->add_child_text ("FFmpeg"); Content::as_xml (node); VideoContent::as_xml (node); + AudioContent::as_xml (node); boost::mutex::scoped_lock lm (_mutex); @@ -263,6 +266,7 @@ operator== (FFmpegAudioStream const & a, FFmpegAudioStream const & b) } FFmpegAudioStream::FFmpegAudioStream (shared_ptr<const cxml::Node> node) + : mapping (node->node_child ("Mapping")) { name = node->string_child ("Name"); id = node->number_child<int> ("Id"); @@ -277,6 +281,7 @@ FFmpegAudioStream::as_xml (xmlpp::Node* root) const root->add_child("Id")->add_child_text (lexical_cast<string> (id)); root->add_child("FrameRate")->add_child_text (lexical_cast<string> (frame_rate)); root->add_child("Channels")->add_child_text (lexical_cast<string> (channels)); + mapping.as_xml (root->add_child("Mapping")); } /** Construct a SubtitleStream from a value returned from to_string(). @@ -308,3 +313,13 @@ FFmpegContent::length (shared_ptr<const Film> film) const FrameRateConversion frc (video_frame_rate (), film->dcp_video_frame_rate ()); return video_length() * frc.factor() * TIME_HZ / film->dcp_video_frame_rate (); } + +AudioMapping +FFmpegContent::audio_mapping () const +{ + if (!_audio_stream) { + return AudioMapping (); + } + + return _audio_stream->mapping; +} |
