decoder/ffmpeg: move code to IsAudio()
This commit is contained in:
parent
70986bc120
commit
d1c5bb956a
|
@ -76,13 +76,19 @@ ffmpeg_init(gcc_unused const config_param ¶m)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gcc_pure
|
||||||
|
static bool
|
||||||
|
IsAudio(const AVStream &stream)
|
||||||
|
{
|
||||||
|
return stream.codec->codec_type == AVMEDIA_TYPE_AUDIO;
|
||||||
|
}
|
||||||
|
|
||||||
gcc_pure
|
gcc_pure
|
||||||
static int
|
static int
|
||||||
ffmpeg_find_audio_stream(const AVFormatContext &format_context)
|
ffmpeg_find_audio_stream(const AVFormatContext &format_context)
|
||||||
{
|
{
|
||||||
for (unsigned i = 0; i < format_context.nb_streams; ++i)
|
for (unsigned i = 0; i < format_context.nb_streams; ++i)
|
||||||
if (format_context.streams[i]->codec->codec_type ==
|
if (IsAudio(*format_context.streams[i]))
|
||||||
AVMEDIA_TYPE_AUDIO)
|
|
||||||
return i;
|
return i;
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Reference in New Issue