format: context::{input,output}::dump: fix url/path printing
Previously the unwrapped CString did not have long enough lifetime to be printed; not sure why there's no compiler warning.
This commit is contained in:
parent
f024eaea37
commit
545180cad0
@ -1,7 +1,6 @@
|
||||
use std::ffi::CString;
|
||||
use std::mem;
|
||||
use std::ops::{Deref, DerefMut};
|
||||
use std::ptr;
|
||||
|
||||
use super::common::Context;
|
||||
use super::destructor;
|
||||
@ -183,7 +182,7 @@ pub fn dump(ctx: &Input, index: i32, url: Option<&str>) {
|
||||
av_dump_format(
|
||||
ctx.as_ptr() as *mut _,
|
||||
index,
|
||||
url.map(|u| u.as_ptr()).unwrap_or(ptr::null()),
|
||||
url.unwrap_or_else(|| CString::new("").unwrap()).as_ptr(),
|
||||
0,
|
||||
);
|
||||
}
|
||||
|
@ -174,7 +174,7 @@ pub fn dump(ctx: &Output, index: i32, url: Option<&str>) {
|
||||
av_dump_format(
|
||||
ctx.as_ptr() as *mut _,
|
||||
index,
|
||||
url.map(|u| u.as_ptr()).unwrap_or(ptr::null()),
|
||||
url.unwrap_or_else(|| CString::new("").unwrap()).as_ptr(),
|
||||
1,
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user