mirror of
https://github.com/encounter/rust-ffmpeg.git
synced 2026-07-10 21:18:39 -07:00
*: 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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
+2
-2
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user