summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-11-19 22:37:27 +0000
committerCarl Hetherington <cth@carlh.net>2013-11-19 22:37:27 +0000
commit633a7e06b94fc04f24d0945aec05b2f9b9d1ea8e (patch)
treef71c86693e41d64c4a9c0d13b0f55b85a708757e /src/lib
parent2af7c2d9d839fb43d96e1373deff2c68721e425f (diff)
Increase probe duration for FFmpeg content so that there is more chance of all streams being found in MPEG files.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/ffmpeg.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/ffmpeg.cc b/src/lib/ffmpeg.cc
index 596703a01..e9c41ea18 100644
--- a/src/lib/ffmpeg.cc
+++ b/src/lib/ffmpeg.cc
@@ -33,6 +33,7 @@ using std::string;
using std::cout;
using std::stringstream;
using boost::shared_ptr;
+using boost::lexical_cast;
boost::mutex FFmpeg::_mutex;
@@ -68,7 +69,14 @@ FFmpeg::setup_general ()
{
av_register_all ();
- if (avformat_open_input (&_format_context, _ffmpeg_content->path().string().c_str(), 0, 0) < 0) {
+ AVDictionary* options = 0;
+ /* These durations are in microseconds, and represent how far into the content file
+ we will look for streams.
+ */
+ av_dict_set (&options, "analyzeduration", lexical_cast<string> (5 * 60 * 1e6).c_str(), 0);
+ av_dict_set (&options, "probesize", lexical_cast<string> (5 * 60 * 1e6).c_str(), 0);
+
+ if (avformat_open_input (&_format_context, _ffmpeg_content->path().string().c_str(), 0, &options) < 0) {
throw OpenFileError (_ffmpeg_content->path().string ());
}