Commit a9ad8fa5 authored by Max Kellermann's avatar Max Kellermann

decoder/ffmpeg: move code to IsSeekable(AVFormatContext)

parent 85427826
...@@ -464,6 +464,12 @@ FfmpegCheckTag(DecoderClient &client, InputStream *is, ...@@ -464,6 +464,12 @@ FfmpegCheckTag(DecoderClient &client, InputStream *is,
client.SubmitTag(is, tag.Commit()); client.SubmitTag(is, tag.Commit());
} }
static bool
IsSeekable(const AVFormatContext &format_context) noexcept
{
return (format_context.ctx_flags & AVFMTCTX_UNSEEKABLE) != 0;
}
static void static void
FfmpegDecode(DecoderClient &client, InputStream *input, FfmpegDecode(DecoderClient &client, InputStream *input,
AVFormatContext &format_context) AVFormatContext &format_context)
...@@ -521,7 +527,7 @@ FfmpegDecode(DecoderClient &client, InputStream *input, ...@@ -521,7 +527,7 @@ FfmpegDecode(DecoderClient &client, InputStream *input,
client.Ready(audio_format, client.Ready(audio_format,
input input
? input->IsSeekable() ? input->IsSeekable()
: (format_context.ctx_flags & AVFMTCTX_UNSEEKABLE) != 0, : IsSeekable(format_context),
total_time); total_time);
FfmpegParseMetaData(client, format_context, audio_stream); FfmpegParseMetaData(client, format_context, audio_stream);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment