*: fix warnings

- Don't use deprecated function for packet dropping
- Fix compiler warning about values, which do not need to be mutable
This commit is contained in:
Tadas Barzdžius 2017-09-19 15:36:35 +03:00 committed by meh
parent 052d342baf
commit 7d980a693e
3 changed files with 4 additions and 4 deletions

View File

@ -264,7 +264,7 @@ impl Clone for Packet {
impl Drop for Packet {
fn drop(&mut self) {
unsafe {
av_free_packet(&mut self.0);
av_packet_unref(&mut self.0);
}
}
}

View File

@ -105,7 +105,7 @@ impl Subtitle {
(mem::size_of::<*const AVSubtitleRect>() * self.0.num_rects as usize) as size_t)
as *mut _;
let mut rect = av_mallocz(mem::size_of::<AVSubtitleRect>() as size_t) as *mut AVSubtitleRect;
let rect = av_mallocz(mem::size_of::<AVSubtitleRect>() as size_t) as *mut AVSubtitleRect;
(*rect).type_ = kind.into();
*self.0.rects.offset((self.0.num_rects - 1) as isize) = rect;

View File

@ -134,7 +134,7 @@ impl<'a> Parser<'a> {
pub fn input(mut self, name: &str, pad: usize) -> Result<Self, Error> {
unsafe {
let mut context = try!(self.graph.get(name).ok_or(Error::InvalidData));
let mut input = avfilter_inout_alloc();
let input = avfilter_inout_alloc();
if input.is_null() {
panic!("out of memory");
@ -161,7 +161,7 @@ impl<'a> Parser<'a> {
pub fn output(mut self, name: &str, pad: usize) -> Result<Self, Error> {
unsafe {
let mut context = try!(self.graph.get(name).ok_or(Error::InvalidData));
let mut output = avfilter_inout_alloc();
let output = avfilter_inout_alloc();
if output.is_null() {
panic!("out of memory");