address AVStream::codec deprecation

The codec -> codecpar move was sufficiently long ago (libavformat
57.5.0 on 2016-04-11) that I think we can just get away with requiring
the new version. Let's try it.

But if someone complains, AVCodecParameters and AVCodecContext look
sufficiently similar we could probably just use one or the other based on
the version we're compiling with.
This commit is contained in:
Scott Lamb
2019-12-29 08:35:39 -06:00
parent 7179ea04e3
commit 6fb346cc8b
4 changed files with 28 additions and 26 deletions

View File

@@ -123,7 +123,7 @@ impl Opener<FfmpegStream> for Ffmpeg {
{
let s = input.streams();
for i in 0 .. s.len() {
if s.get(i).codec().codec_type().is_video() {
if s.get(i).codecpar().codec_type().is_video() {
debug!("Video stream index is {}", i);
video_i = Some(i);
break;
@@ -161,7 +161,7 @@ impl Stream for FfmpegStream {
if tb.num != 1 || tb.den != 90000 {
bail!("video stream has timebase {}/{}; expected 1/90000", tb.num, tb.den);
}
let codec = video.codec();
let codec = video.codecpar();
let codec_id = codec.codec_id();
if !codec_id.is_h264() {
bail!("stream's video codec {:?} is not h264", codec_id);