From a9ad8fa505c7f8c398c0c92ab323089576b5f878 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 22 Feb 2021 13:33:24 +0100 Subject: [PATCH] decoder/ffmpeg: move code to IsSeekable(AVFormatContext) --- src/decoder/plugins/FfmpegDecoderPlugin.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/decoder/plugins/FfmpegDecoderPlugin.cxx b/src/decoder/plugins/FfmpegDecoderPlugin.cxx index e82bff450..b274ae4fb 100644 --- a/src/decoder/plugins/FfmpegDecoderPlugin.cxx +++ b/src/decoder/plugins/FfmpegDecoderPlugin.cxx @@ -464,6 +464,12 @@ FfmpegCheckTag(DecoderClient &client, InputStream *is, client.SubmitTag(is, tag.Commit()); } +static bool +IsSeekable(const AVFormatContext &format_context) noexcept +{ + return (format_context.ctx_flags & AVFMTCTX_UNSEEKABLE) != 0; +} + static void FfmpegDecode(DecoderClient &client, InputStream *input, AVFormatContext &format_context) @@ -521,7 +527,7 @@ FfmpegDecode(DecoderClient &client, InputStream *input, client.Ready(audio_format, input ? input->IsSeekable() - : (format_context.ctx_flags & AVFMTCTX_UNSEEKABLE) != 0, + : IsSeekable(format_context), total_time); FfmpegParseMetaData(client, format_context, audio_stream);