From 81c872efc0ecc2228f01b9dc55cb152a30b277f9 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 27 Sep 2019 21:24:24 +0200 Subject: ad_lavc: log on failure to read AVFrame This can be due to unsupported sample formats (see previous commits), minor allocation failures, and similar things. For identifying the exact cause it's buried too deep in abstractions. But most time it doesn't happen anyway, since it's extremely rare that new audio formats are added. --- audio/decode/ad_lavc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/audio/decode/ad_lavc.c b/audio/decode/ad_lavc.c index e323a6cbda..fbd6ad32ac 100644 --- a/audio/decode/ad_lavc.c +++ b/audio/decode/ad_lavc.c @@ -214,8 +214,10 @@ static bool receive_frame(struct mp_filter *da, struct mp_frame *out) double out_pts = mp_pts_from_av(priv->avframe->pts, &priv->codec_timebase); struct mp_aframe *mpframe = mp_aframe_from_avframe(priv->avframe); - if (!mpframe) + if (!mpframe) { + MP_ERR(da, "Converting libavcodec frame to mpv frame failed.\n"); return true; + } if (priv->force_channel_map.num) mp_aframe_set_chmap(mpframe, &priv->force_channel_map); -- cgit v1.2.3