Commit e1ddb630 authored by Max Kellermann's avatar Max Kellermann

lib/xiph/FlacStreamMetadata: move code to Scan(FLAC__StreamMetadata_StreamInfo)

parent 24b14c5a
......@@ -131,6 +131,14 @@ flac_duration(const FLAC__StreamMetadata_StreamInfo *stream_info) noexcept
stream_info->sample_rate);
}
static void
Scan(const FLAC__StreamMetadata_StreamInfo &stream_info,
TagHandler &handler) noexcept
{
if (stream_info.sample_rate > 0)
handler.OnDuration(flac_duration(&stream_info));
}
void
flac_scan_metadata(const FLAC__StreamMetadata *block,
TagHandler &handler) noexcept
......@@ -142,8 +150,7 @@ flac_scan_metadata(const FLAC__StreamMetadata *block,
break;
case FLAC__METADATA_TYPE_STREAMINFO:
if (block->data.stream_info.sample_rate > 0)
handler.OnDuration(flac_duration(&block->data.stream_info));
Scan(block->data.stream_info, handler);
break;
default:
......
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