work around #10 with advanced_editlist=false

I think this is an ffmpeg bug, which I plan to report. In the meantime, this
makes the tests pass. Long-term, even if ffmpeg fixes this, I probably don't
want to continue doing acceptance tests against whatever version of ffmpeg
happens to be installed - my real targets of interest are the latest versions
of Chrome, Firefox, Safari, QuickTime, and VLC.
This commit is contained in:
Scott Lamb 2017-10-09 21:44:48 -07:00
parent 711f7b3409
commit 5bb3dde74e

View File

@ -82,10 +82,20 @@ impl Opener<FfmpegStream> for Ffmpeg {
use moonfire_ffmpeg::InputFormatContext;
let (mut input, discard_first) = match src {
#[cfg(test)]
Source::File(filename) =>
(InputFormatContext::open(&CString::new(format!("file:{}", filename)).unwrap(),
&mut moonfire_ffmpeg::Dictionary::new())?,
false),
Source::File(filename) => {
let mut open_options = moonfire_ffmpeg::Dictionary::new();
// Work around https://github.com/scottlamb/moonfire-nvr/issues/10
open_options.set(c_str!("advanced_editlist"), c_str!("false")).unwrap();
let url = format!("file:{}", filename);
let i = InputFormatContext::open(&CString::new(url.clone()).unwrap(),
&mut open_options)?;
if !open_options.empty() {
warn!("While opening URL {}, some options were not understood: {}",
url, open_options);
}
(i, false)
}
Source::Rtsp(url) => {
let mut open_options = moonfire_ffmpeg::Dictionary::new();
open_options.set(c_str!("rtsp_transport"), c_str!("tcp")).unwrap();