mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-11-23 11:07:52 -05:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user