if (f) {
first_audio = ContentTime (f.get ());
}
+ codec_name = node->optional_string_child("CodecName");
}
void
if (first_audio) {
root->add_child("FirstAudio")->add_child_text (raw_convert<string> (first_audio.get().get ()));
}
+ if (codec_name) {
+ root->add_child("CodecName")->add_child_text (codec_name.get());
+ }
}
, AudioStream (frame_rate, length, channels)
{}
+ FFmpegAudioStream (std::string name, std::string codec_name_, int id, int frame_rate, Frame length, int channels)
+ : FFmpegStream (name, id)
+ , AudioStream (frame_rate, length, channels)
+ , codec_name (codec_name_)
+ {}
+
FFmpegAudioStream (std::string name, int id, int frame_rate, Frame length, AudioMapping mapping)
: FFmpegStream (name, id)
, AudioStream (frame_rate, length, mapping)
/* XXX: should probably be locked */
boost::optional<ContentTime> first_audio;
+ boost::optional<std::string> codec_name;
private:
friend struct ffmpeg_pts_offset_test;
}
DCPOMATIC_ASSERT (_format_context->duration != AV_NOPTS_VALUE);
+ DCPOMATIC_ASSERT (s->codec->codec);
+ DCPOMATIC_ASSERT (s->codec->codec->name);
_audio_streams.push_back (
shared_ptr<FFmpegAudioStream> (
new FFmpegAudioStream (
stream_name (s),
+ s->codec->codec->name,
s->id,
s->codec->sample_rate,
(double (_format_context->duration) / AV_TIME_BASE) * s->codec->sample_rate,
int c = 0;
BOOST_FOREACH (shared_ptr<const AudioStream> i, ac.front()->audio->streams()) {
shared_ptr<const FFmpegAudioStream> f = dynamic_pointer_cast<const FFmpegAudioStream> (i);
- groups.push_back (AudioMappingView::Group (c, c + i->channels() - 1, f ? f->name : ""));
+ string name = "";
+ if (f) {
+ name = f->name;
+ if (f->codec_name) {
+ name += " (" + f->codec_name.get() + ")";
+ }
+ }
+ groups.push_back (AudioMappingView::Group (c, c + i->channels() - 1, name));
c += i->channels ();
}
_mapping->set_input_groups (groups);