diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index 925aebfc7d..84f7842381 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -559,7 +559,8 @@ Playback Control The solution is to feed a previous packet to the decoder each time, and then discard the output. This option controls how many packets to feed. The ``auto`` choice is currently hardcoded to 0 for video, and uses 1 for lossy - audio, 0 for lossless audio. + audio, 0 for lossless audio. As a hack, it sets it to 2 for Opus, which + requires this for unknown reasons. ``--video-backward-overlap`` can potentially handle intra-refresh video, depending on the exact conditions. You may have to use the diff --git a/demux/demux.c b/demux/demux.c index 48626b7b53..2b58ca00cf 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -952,8 +952,11 @@ static void demux_add_sh_stream_locked(struct demux_internal *in, switch (ds->type) { case STREAM_AUDIO: ds->back_preroll = in->opts->audio_back_preroll; - if (ds->back_preroll < 0) // auto + if (ds->back_preroll < 0) { // auto ds->back_preroll = mp_codec_is_lossless(sh->codec->codec) ? 0 : 1; + if (sh->codec->codec && strcmp(sh->codec->codec, "opus") == 0) + ds->back_preroll = 2; + } break; case STREAM_VIDEO: ds->back_preroll = in->opts->video_back_preroll;