summaryrefslogtreecommitdiffstats
path: root/src/util/duration/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/duration/mod.rs')
-rw-r--r--src/util/duration/mod.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/util/duration/mod.rs b/src/util/duration/mod.rs
index 0a4e7a3..8353e49 100644
--- a/src/util/duration/mod.rs
+++ b/src/util/duration/mod.rs
@@ -1,5 +1,6 @@
use std::io;
+mod mkv;
mod mp3;
mod mp4;
@@ -7,6 +8,7 @@ use std::path::Path;
use mp3_metadata::MP3Metadata;
+use mkv::MkvDurationExtractor;
use mp3::Mp3DurationExtractor;
use mp4::Mp4DurationExtractor;
@@ -20,9 +22,10 @@ pub trait DurationExtractor {
fn try_read_duration(&self, path: &Path, mp3_metadata: &Option<MP3Metadata>) -> io::Result<Option<Duration>>;
}
-const EXTRACTORS: [&dyn DurationExtractor; 2] = [
+const EXTRACTORS: [&dyn DurationExtractor; 3] = [
&Mp3DurationExtractor,
&Mp4DurationExtractor,
+ &MkvDurationExtractor,
];
pub fn get_duration<T: AsRef<Path>>(path: T, mp3_metadata: &Option<MP3Metadata>) -> Option<Duration> {