Skip to content

Commit 8a85169

Browse files
authored
Filter out zero duration (#844)
1 parent e50e726 commit 8a85169

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/decoder/symphonia.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,12 @@ impl SymphoniaDecoder {
104104

105105
let mut decoder = symphonia::default::get_codecs()
106106
.make(&track.codec_params, &DecoderOptions::default())?;
107-
let total_duration = stream
107+
let total_duration: Option<Duration> = track
108108
.codec_params
109109
.time_base
110110
.zip(stream.codec_params.n_frames)
111-
.map(|(base, spans)| base.calc_time(spans).into());
111+
.map(|(base, spans)| base.calc_time(spans).into())
112+
.filter(|d: &Duration| !d.is_zero());
112113

113114
let decoded = loop {
114115
let current_span = match probed.format.next_packet() {

0 commit comments

Comments
 (0)