diff --git a/Cargo.toml b/Cargo.toml index 7a3d8ce..c6714bc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ffmpeg-the-third" -version = "5.1.1" +version = "1.0.0+ffmpeg-5.1.2" build = "build.rs" authors = ["meh. ", "Zhiming Wang "] @@ -120,9 +120,9 @@ libc = "0.2" bitflags = "1.2" [dependencies.image] -version = "0.23" +version = "0.24" optional = true [dependencies.ffmpeg-sys-the-third] -version = "5.1.1" +version = "1.0.0" default-features = false diff --git a/examples/chapters.rs b/examples/chapters.rs index 7da53d1..6599ebb 100644 --- a/examples/chapters.rs +++ b/examples/chapters.rs @@ -1,4 +1,4 @@ -extern crate ffmpeg_next as ffmpeg; +extern crate ffmpeg_the_third as ffmpeg; use std::env; diff --git a/examples/codec-info.rs b/examples/codec-info.rs index 2c1af74..756abc0 100644 --- a/examples/codec-info.rs +++ b/examples/codec-info.rs @@ -1,4 +1,4 @@ -extern crate ffmpeg_next as ffmpeg; +extern crate ffmpeg_the_third as ffmpeg; use std::env; diff --git a/examples/dump-frames.rs b/examples/dump-frames.rs index d3124ef..7491862 100644 --- a/examples/dump-frames.rs +++ b/examples/dump-frames.rs @@ -1,4 +1,4 @@ -extern crate ffmpeg_next as ffmpeg; +extern crate ffmpeg_the_third as ffmpeg; use ffmpeg::format::{input, Pixel}; use ffmpeg::media::Type; diff --git a/examples/metadata.rs b/examples/metadata.rs index 54eb8ab..fe7c157 100644 --- a/examples/metadata.rs +++ b/examples/metadata.rs @@ -1,4 +1,4 @@ -extern crate ffmpeg_next as ffmpeg; +extern crate ffmpeg_the_third as ffmpeg; use std::env; diff --git a/examples/remux.rs b/examples/remux.rs index b69f93b..3effa32 100644 --- a/examples/remux.rs +++ b/examples/remux.rs @@ -1,4 +1,4 @@ -extern crate ffmpeg_next as ffmpeg; +extern crate ffmpeg_the_third as ffmpeg; use std::env; diff --git a/examples/transcode-audio.rs b/examples/transcode-audio.rs index eff780c..f6ed634 100644 --- a/examples/transcode-audio.rs +++ b/examples/transcode-audio.rs @@ -1,4 +1,4 @@ -extern crate ffmpeg_next as ffmpeg; +extern crate ffmpeg_the_third as ffmpeg; use std::env; use std::path::Path; diff --git a/examples/transcode-x264.rs b/examples/transcode-x264.rs index 51929a8..e738ac3 100644 --- a/examples/transcode-x264.rs +++ b/examples/transcode-x264.rs @@ -15,7 +15,7 @@ // transcode-x264 input.flv output.mp4 // transcode-x264 input.mkv output.mkv 'preset=veryslow,crf=18' -extern crate ffmpeg_next as ffmpeg; +extern crate ffmpeg_the_third as ffmpeg; use std::collections::HashMap; use std::env; diff --git a/src/codec/context.rs b/src/codec/context.rs index 0d01c85..a933362 100644 --- a/src/codec/context.rs +++ b/src/codec/context.rs @@ -101,7 +101,7 @@ impl Context { unsafe { (*self.as_mut_ptr()).thread_type = config.kind.into(); (*self.as_mut_ptr()).thread_count = config.count as c_int; - (*self.as_mut_ptr()).thread_safe_callbacks = if config.safe { 1 } else { 0 }; + (*self.as_mut_ptr()).thread_safe_callbacks = i32::from(config.safe); } } diff --git a/src/codec/packet/packet.rs b/src/codec/packet/packet.rs index 0dd27f5..72a38ea 100644 --- a/src/codec/packet/packet.rs +++ b/src/codec/packet/packet.rs @@ -121,7 +121,7 @@ impl Packet { pub fn pts(&self) -> Option { match self.0.pts { AV_NOPTS_VALUE => None, - pts => Some(pts as i64), + pts => Some(pts), } } @@ -134,7 +134,7 @@ impl Packet { pub fn dts(&self) -> Option { match self.0.dts { AV_NOPTS_VALUE => None, - dts => Some(dts as i64), + dts => Some(dts), } } @@ -150,7 +150,7 @@ impl Packet { #[inline] pub fn duration(&self) -> i64 { - self.0.duration as i64 + self.0.duration } #[inline] diff --git a/src/codec/packet/side_data.rs b/src/codec/packet/side_data.rs index 1b4d854..3811cc8 100644 --- a/src/codec/packet/side_data.rs +++ b/src/codec/packet/side_data.rs @@ -192,6 +192,6 @@ impl<'a> SideData<'a> { } pub fn data(&self) -> &[u8] { - unsafe { slice::from_raw_parts((*self.as_ptr()).data, (*self.as_ptr()).size as usize) } + unsafe { slice::from_raw_parts((*self.as_ptr()).data, (*self.as_ptr()).size) } } } diff --git a/src/codec/subtitle/mod.rs b/src/codec/subtitle/mod.rs index c0c63b1..607d858 100644 --- a/src/codec/subtitle/mod.rs +++ b/src/codec/subtitle/mod.rs @@ -76,7 +76,7 @@ impl Subtitle { } pub fn start(&self) -> u32 { - self.0.start_display_time as u32 + self.0.start_display_time } pub fn set_start(&mut self, value: u32) { @@ -84,7 +84,7 @@ impl Subtitle { } pub fn end(&self) -> u32 { - self.0.end_display_time as u32 + self.0.end_display_time } pub fn set_end(&mut self, value: u32) { diff --git a/src/format/chapter/chapter.rs b/src/format/chapter/chapter.rs index 603452b..6e8d0ff 100644 --- a/src/format/chapter/chapter.rs +++ b/src/format/chapter/chapter.rs @@ -26,7 +26,7 @@ impl<'a> Chapter<'a> { } pub fn id(&self) -> i64 { - unsafe { (*self.as_ptr()).id as i64 } + unsafe { (*self.as_ptr()).id } } pub fn time_base(&self) -> Rational { diff --git a/src/lib.rs b/src/lib.rs index 4625e3c..ae9985e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,7 +5,7 @@ #[macro_use] extern crate bitflags; -pub extern crate ffmpeg_sys_next as sys; +pub extern crate ffmpeg_sys_the_third as sys; #[cfg(feature = "image")] extern crate image; extern crate libc; diff --git a/src/util/frame/audio.rs b/src/util/frame/audio.rs index 9c9a671..19672ff 100644 --- a/src/util/frame/audio.rs +++ b/src/util/frame/audio.rs @@ -69,7 +69,7 @@ impl Audio { #[inline] pub fn set_channel_layout(&mut self, value: ChannelLayout) { unsafe { - (*self.as_mut_ptr()).channel_layout = value.bits() as u64; + (*self.as_mut_ptr()).channel_layout = value.bits(); } } @@ -140,7 +140,7 @@ impl Audio { panic!("out of bounds"); } - if !::is_valid(self.format(), self.channels() as u16) { + if !::is_valid(self.format(), self.channels()) { panic!("unsupported type"); } @@ -153,7 +153,7 @@ impl Audio { panic!("out of bounds"); } - if !::is_valid(self.format(), self.channels() as u16) { + if !::is_valid(self.format(), self.channels()) { panic!("unsupported type"); } diff --git a/src/util/frame/mod.rs b/src/util/frame/mod.rs index 0f6a944..0ab7c38 100644 --- a/src/util/frame/mod.rs +++ b/src/util/frame/mod.rs @@ -79,8 +79,8 @@ impl Frame { pub fn packet(&self) -> Packet { unsafe { Packet { - duration: (*self.as_ptr()).pkt_duration as i64, - position: (*self.as_ptr()).pkt_pos as i64, + duration: (*self.as_ptr()).pkt_duration, + position: (*self.as_ptr()).pkt_pos, size: (*self.as_ptr()).pkt_size as usize, #[cfg(not(feature = "ffmpeg_5_0"))] @@ -95,7 +95,7 @@ impl Frame { unsafe { match (*self.as_ptr()).pts { AV_NOPTS_VALUE => None, - pts => Some(pts as i64), + pts => Some(pts), } } } @@ -112,7 +112,7 @@ impl Frame { unsafe { match (*self.as_ptr()).best_effort_timestamp { AV_NOPTS_VALUE => None, - t => Some(t as i64), + t => Some(t), } } } diff --git a/src/util/frame/side_data.rs b/src/util/frame/side_data.rs index a9ac82e..27b89c2 100644 --- a/src/util/frame/side_data.rs +++ b/src/util/frame/side_data.rs @@ -216,7 +216,7 @@ impl<'a> SideData<'a> { #[inline] pub fn data(&self) -> &[u8] { - unsafe { slice::from_raw_parts((*self.as_ptr()).data, (*self.as_ptr()).size as usize) } + unsafe { slice::from_raw_parts((*self.as_ptr()).data, (*self.as_ptr()).size) } } #[inline] diff --git a/src/util/time.rs b/src/util/time.rs index 373a5ea..9757953 100644 --- a/src/util/time.rs +++ b/src/util/time.rs @@ -3,12 +3,12 @@ use Error; #[inline(always)] pub fn current() -> i64 { - unsafe { av_gettime() as i64 } + unsafe { av_gettime() } } #[inline(always)] pub fn relative() -> i64 { - unsafe { av_gettime_relative() as i64 } + unsafe { av_gettime_relative() } } #[inline(always)]