LibMedia/Matroska: Move the definition get_codec_id_for_track up

The function is separated from the string-to-enum function it uses, and
the order is also inconsistent with header.
This commit is contained in:
Zaggy1024 2024-06-19 17:13:01 -05:00 committed by Andrew Kaster
parent 55fda2068b
commit bf1e0fac94
Notes: sideshowbarker 2024-07-16 23:34:49 +09:00

View file

@ -98,6 +98,12 @@ CodecID MatroskaDemuxer::get_codec_id_for_string(FlyString const& codec_id)
return CodecID::Unknown;
}
DecoderErrorOr<CodecID> MatroskaDemuxer::get_codec_id_for_track(Track track)
{
auto codec_id = TRY(m_reader.track_for_track_number(track.identifier()))->codec_id();
return get_codec_id_for_string(codec_id);
}
DecoderErrorOr<Optional<Duration>> MatroskaDemuxer::seek_to_most_recent_keyframe(Track track, Duration timestamp, Optional<Duration> earliest_available_sample)
{
// Removing the track status will cause us to start from the beginning.
@ -146,10 +152,4 @@ DecoderErrorOr<Duration> MatroskaDemuxer::duration()
return duration.value_or(Duration::zero());
}
DecoderErrorOr<CodecID> MatroskaDemuxer::get_codec_id_for_track(Track track)
{
auto codec_id = TRY(m_reader.track_for_track_number(track.identifier()))->codec_id();
return get_codec_id_for_string(codec_id);
}
}