1
0
mirror of https://github.com/mpv-player/mpv synced 2025-04-01 14:50:07 +00:00

ad_lavc: respect AV_FRAME_FLAG_DISCARD

Since we set "skip_manual", we can actually get frames with this set.
Currently, only AV_PKT_FLAG_DISCARD will trigger this flag, and only
mov.c sets the latter flags, so this is related to FFmpeg's half-broken
mp4 edit list support.
This commit is contained in:
wm4 2017-01-24 08:04:53 +01:00
parent 00eadcec8d
commit 6be58df8d1

View File

@ -221,6 +221,11 @@ static bool receive_frame(struct dec_audio *da, struct mp_audio **out)
MP_ERR(da, "Error decoding audio.\n");
}
#if LIBAVCODEC_VERSION_MICRO >= 100
if (priv->avframe->flags & AV_FRAME_FLAG_DISCARD)
av_frame_unref(priv->avframe);
#endif
if (!priv->avframe->buf[0])
return true;