Bump version to use ffmpeg 5

This commit is contained in:
Polochon-street
2022-01-24 21:03:47 +01:00
parent 5ed41c84ff
commit 22ad8b9598
43 changed files with 310 additions and 102 deletions

View File

@ -1,13 +1,18 @@
use std::ops::{Deref, DerefMut};
#[cfg(not(feature = "ffmpeg_5_0"))]
use ffi::*;
#[cfg(not(feature = "ffmpeg_5_0"))]
use libc::c_int;
use super::Opened;
use codec::Context;
#[cfg(not(feature = "ffmpeg_5_0"))]
use frame;
use util::format;
use {packet, AudioService, ChannelLayout, Error};
#[cfg(not(feature = "ffmpeg_5_0"))]
use {packet, Error};
use {AudioService, ChannelLayout};
pub struct Audio(pub Opened);
@ -17,6 +22,7 @@ impl Audio {
note = "Underlying API avcodec_decode_audio4 has been deprecated since FFmpeg 3.1; \
consider switching to send_packet() and receive_frame()"
)]
#[cfg(not(feature = "ffmpeg_5_0"))]
pub fn decode<P: packet::Ref>(
&mut self,
packet: &P,
@ -91,8 +97,11 @@ impl Audio {
unsafe { (*self.as_ptr()).frame_size as u32 }
}
#[cfg(not(feature = "ffmpeg_5_0"))]
pub fn frame_start(&self) -> Option<usize> {
unsafe {
// Removed in ffmpeg >= 5.0 in favor of using encoder
// private options.
match (*self.as_ptr()).timecode_frame_start {
-1 => None,
n => Some(n as usize),