1
mirror of https://github.com/mpv-player/mpv synced 2024-11-14 22:48:35 +01:00

ad_lavc: skip fully skipped frames

Fixes stupid messages with a opus/mkv test file that had an absurdly
huge codec delay.

This file fully skips several frames at the start. ad_lavc.c trimmed
these frames to 0 samples and returned them. The next layer
(f_decoder_wrapper.c) saw discontinuous PTS values, because the PTS
values increased by a frame, but amounted to 0 audio samples. This was
harmless, but logged PTS discontinuity errors.
This commit is contained in:
wm4 2019-05-22 21:45:54 +02:00
parent 6f7260d29c
commit 32e3033666

View File

@ -254,7 +254,11 @@ static bool receive_frame(struct mp_filter *da, struct mp_frame *out)
priv->trim_samples -= trim;
}
*out = MAKE_FRAME(MP_FRAME_AUDIO, mpframe);
if (mp_aframe_get_size(mpframe) > 0) {
*out = MAKE_FRAME(MP_FRAME_AUDIO, mpframe);
} else {
talloc_free(mpframe);
}
av_frame_unref(priv->avframe);