util/dictionary: refactor and make more sound

This commit is contained in:
meh
2015-09-08 18:26:29 +02:00
parent 620958d684
commit f2fb08e491
16 changed files with 297 additions and 179 deletions

View File

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