diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-05-16 23:46:51 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-05-18 11:50:29 +0100 |
| commit | d60b9d006fee94fab80ee86fe1149de7f2e76750 (patch) | |
| tree | e7821dc323ec6e3b53bf25266350e355c4de0fc0 /src/lib/content_factory.cc | |
| parent | 3ce77bc8f0f047725f40a5f1725833fce5f8db63 (diff) | |
Remove Sndfile code and use FFmpeg instead.
Diffstat (limited to 'src/lib/content_factory.cc')
| -rw-r--r-- | src/lib/content_factory.cc | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/src/lib/content_factory.cc b/src/lib/content_factory.cc index c3278e30e..e21a4c0d0 100644 --- a/src/lib/content_factory.cc +++ b/src/lib/content_factory.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net> + Copyright (C) 2013-2016 Carl Hetherington <cth@carlh.net> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -22,12 +22,13 @@ */ #include "ffmpeg_content.h" +#include "audio_content.h" #include "image_content.h" -#include "sndfile_content.h" #include "text_subtitle_content.h" #include "dcp_content.h" #include "dcp_subtitle_content.h" #include "util.h" +#include "ffmpeg_audio_stream.h" #include "film.h" #include "log_entry.h" #include "log.h" @@ -57,11 +58,29 @@ content_factory (shared_ptr<const Film> film, cxml::NodePtr node, int version, l boost::shared_ptr<Content> content; if (type == "FFmpeg") { + /* SndfileContent is now handled by the FFmpeg code rather than by + separate libsndfile-based code. + */ content.reset (new FFmpegContent (film, node, version, notes)); } else if (type == "Image") { content.reset (new ImageContent (film, node, version)); } else if (type == "Sndfile") { - content.reset (new SndfileContent (film, node, version)); + /* SndfileContent is now handled by the FFmpeg code rather than by + separate libsndfile-based code. + */ + content.reset (new FFmpegContent (film, node, version, notes)); + + content->audio->set_stream ( + AudioStreamPtr ( + new FFmpegAudioStream ( + "Stream", 0, + node->number_child<int> ("AudioFrameRate"), + node->number_child<Frame> ("AudioLength"), + AudioMapping (node->node_child ("AudioMapping"), version) + ) + ) + ); + } else if (type == "SubRip" || type == "TextSubtitle") { content.reset (new TextSubtitleContent (film, node, version)); } else if (type == "DCP") { @@ -137,8 +156,6 @@ content_factory (shared_ptr<const Film> film, boost::filesystem::path path) if (valid_image_file (path)) { content.reset (new ImageContent (film, path)); - } else if (SndfileContent::valid_file (path)) { - content.reset (new SndfileContent (film, path)); } else if (ext == ".srt" || ext == ".ssa") { content.reset (new TextSubtitleContent (film, path)); } else if (ext == ".xml") { |
