diff options
author | wm4 <wm4@nowhere> | 2019-05-22 21:45:54 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2019-09-19 20:37:04 +0200 |
commit | 32e303366615f4d70dd2c820c2ecc294378a2cf9 (patch) | |
tree | aad997927348a305c20804a3b0e3545024504c9b /audio | |
parent | 6f7260d29c9dd7f91e3190626056ec766815d3c0 (diff) | |
download | mpv-32e303366615f4d70dd2c820c2ecc294378a2cf9.tar.bz2 mpv-32e303366615f4d70dd2c820c2ecc294378a2cf9.tar.xz |
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.
Diffstat (limited to 'audio')
-rw-r--r-- | audio/decode/ad_lavc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/audio/decode/ad_lavc.c b/audio/decode/ad_lavc.c index 985fd58084..e323a6cbda 100644 --- a/audio/decode/ad_lavc.c +++ b/audio/decode/ad_lavc.c @@ -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); |