mirror of
https://github.com/mpv-player/mpv.git
synced 2026-06-06 20:10:30 +00:00
Get rid of deprecated AVFrame accessors
Fist we were required to use them for ABI compat. reasons (and other BS), now they're deprecated and we're supposed to access them directly again.
This commit is contained in:
+3
-3
@@ -358,8 +358,8 @@ struct mp_audio *mp_audio_from_avframe(struct AVFrame *avframe)
|
||||
|
||||
#if LIBAVUTIL_VERSION_MICRO >= 100
|
||||
// FFmpeg being stupid POS again
|
||||
if (lavc_chmap.num != av_frame_get_channels(avframe))
|
||||
mp_chmap_from_channels(&lavc_chmap, av_frame_get_channels(avframe));
|
||||
if (lavc_chmap.num != avframe->channels)
|
||||
mp_chmap_from_channels(&lavc_chmap, avframe->channels);
|
||||
#endif
|
||||
|
||||
new->rate = avframe->sample_rate;
|
||||
@@ -473,7 +473,7 @@ int mp_audio_to_avframe(struct mp_audio *frame, struct AVFrame *avframe)
|
||||
goto fail;
|
||||
#if LIBAVUTIL_VERSION_MICRO >= 100
|
||||
// FFmpeg being a stupid POS again
|
||||
av_frame_set_channels(avframe, frame->channels.num);
|
||||
avframe->channels = frame->channels.num;
|
||||
#endif
|
||||
avframe->sample_rate = frame->rate;
|
||||
|
||||
|
||||
@@ -265,7 +265,7 @@ static void get_metadata_from_av_frame(struct af_instance *af, AVFrame *frame)
|
||||
if (!p->metadata)
|
||||
p->metadata = talloc_zero(p, struct mp_tags);
|
||||
|
||||
mp_tags_copy_from_av_dictionary(p->metadata, av_frame_get_metadata(frame));
|
||||
mp_tags_copy_from_av_dictionary(p->metadata, frame->metadata);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -1292,7 +1292,7 @@ static bool decode_frame(struct dec_video *vd)
|
||||
|
||||
#if LIBAVCODEC_VERSION_MICRO >= 100
|
||||
mpi->pkt_duration =
|
||||
mp_pts_from_av(av_frame_get_pkt_duration(ctx->pic), &ctx->codec_timebase);
|
||||
mp_pts_from_av(ctx->pic->pkt_duration, &ctx->codec_timebase);
|
||||
#endif
|
||||
|
||||
update_image_params(vd, ctx->pic, &mpi->params);
|
||||
|
||||
@@ -326,7 +326,7 @@ static void get_metadata_from_av_frame(struct vf_instance *vf, AVFrame *frame)
|
||||
if (!p->metadata)
|
||||
p->metadata = talloc_zero(p, struct mp_tags);
|
||||
|
||||
mp_tags_copy_from_av_dictionary(p->metadata, av_frame_get_metadata(frame));
|
||||
mp_tags_copy_from_av_dictionary(p->metadata, frame->metadata);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user