mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-11 01:06:01 +03:00
SoundPlayer: Don't limit duration inference to WAV files
This commit is contained in:
parent
80dba466db
commit
e2187f2956
Notes:
sideshowbarker
2024-07-18 11:15:53 +09:00
Author: https://github.com/ngc6302h Commit: https://github.com/SerenityOS/serenity/commit/e2187f29563 Pull-request: https://github.com/SerenityOS/serenity/pull/8296 Reviewed-by: https://github.com/alimpfard Reviewed-by: https://github.com/kleinesfilmroellchen
@ -302,10 +302,8 @@ void SoundPlayerWidgetAdvancedView::try_fill_missing_info(Vector<M3UEntry>& entr
|
||||
if (!entry.extended_info->track_display_title.has_value())
|
||||
entry.extended_info->track_display_title = LexicalPath(entry.path).title();
|
||||
if (!entry.extended_info->track_length_in_seconds.has_value()) {
|
||||
if (entry_path.has_extension("wav")) {
|
||||
auto wav_reader = Audio::Loader::create(entry.path);
|
||||
entry.extended_info->track_length_in_seconds = wav_reader->total_samples() / wav_reader->sample_rate();
|
||||
}
|
||||
if (auto reader = Audio::Loader::create(entry.path); !reader->has_error())
|
||||
entry.extended_info->track_length_in_seconds = reader->total_samples() / reader->sample_rate();
|
||||
//TODO: Implement embedded metadata extractor for other audio formats
|
||||
}
|
||||
//TODO: Implement a metadata parser for the uncomfortably numerous popular embedded metadata formats
|
||||
|
Loading…
Reference in New Issue
Block a user