format/context/output: return the Dictionary on write_header_with

This commit is contained in:
meh 2017-02-25 19:30:08 +01:00
parent 8562de8e44
commit ef11b2bec4

View File

@ -45,15 +45,13 @@ impl Output {
}
}
pub fn write_header_with(&mut self, options: Dictionary) -> Result<(), Error> {
pub fn write_header_with(&mut self, options: Dictionary) -> Result<Dictionary, Error> {
unsafe {
let mut opts = options.disown();
let res = avformat_write_header(self.as_mut_ptr(), &mut opts);
Dictionary::own(opts);
match res {
0 => Ok(()),
0 => Ok(Dictionary::own(opts)),
e => Err(Error::from(e)),
}
}