From b48fb6c86c671f9bbb8b65e4025a0aa111cde681 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Sun, 5 Jul 2026 16:12:40 +0200 Subject: [PATCH] demux_lavf: seek avfc only on seekable streams in drop_buffers Disc streams are only seekable through the higher-level stream controls, a byte seek on the slave can only fail and log errors. avformat_flush() below already resets the demuxer state. --- demux/demux_lavf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/demux/demux_lavf.c b/demux/demux_lavf.c index a1ccf20cc2..ce20fcf1cc 100644 --- a/demux/demux_lavf.c +++ b/demux/demux_lavf.c @@ -1800,7 +1800,8 @@ static void reset_dovi_split_state(demuxer_t *demuxer) static void demux_drop_buffers_lavf(demuxer_t *demuxer) { lavf_priv_t *priv = demuxer->priv; - av_seek_frame(priv->avfc, -1, 0, 1); + if (!priv->stream || priv->stream->seekable) + av_seek_frame(priv->avfc, -1, 0, 1); demux_flush(demuxer); stream_drop_buffers(priv->stream); avio_flush(priv->avfc->pb);