diff options
author | ngc6302h <shortanemoia@protonmail.com> | 2021-06-28 17:13:31 +0200 |
---|---|---|
committer | Ali Mohammad Pur <Ali.mpfard@gmail.com> | 2021-06-30 00:58:06 +0430 |
commit | e2187f29563dbbdcc91e0ff6b84a9933621c0cda (patch) | |
tree | 74f7db1dec0f3b7aaf1f12d493382349f4500827 | |
parent | 80dba466db8b3f49bdefa097843729c45b4b0ee5 (diff) | |
download | serenity-e2187f29563dbbdcc91e0ff6b84a9933621c0cda.zip |
SoundPlayer: Don't limit duration inference to WAV files
-rw-r--r-- | Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.cpp b/Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.cpp index b0f2cd4751..c4728c5774 100644 --- a/Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.cpp +++ b/Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.cpp @@ -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 |