Skip to content

Commit 58cd766

Browse files
committed
fix buffered SpanData::End crashing other sources + remove dbg!'s
1 parent 6447d9e commit 58cd766

File tree

4 files changed

+1
-6
lines changed

4 files changed

+1
-6
lines changed

src/source/buffered.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ where
125125
fn sample_rate(&self) -> SampleRate {
126126
match *self.current_span {
127127
Span::Data(SpanData { rate, .. }) => rate,
128-
Span::End => dbg!(0),
128+
Span::End => 1,
129129
Span::Input(_) => unreachable!(),
130130
}
131131
}

src/source/position.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,10 @@ where
7171
/// track_position after speedup's and delay's.
7272
#[inline]
7373
pub fn get_pos(&self) -> Duration {
74-
dbg!(self);
7574
let seconds = self.samples_counted as f64
7675
/ self.input.sample_rate() as f64
7776
/ self.input.channels().get() as f64
7877
+ self.offset_duration;
79-
dbg!(seconds);
8078
Duration::from_secs_f64(seconds)
8179
}
8280
}
@@ -96,7 +94,6 @@ where
9694
// At the end of a span add the duration of this span to
9795
// offset_duration and start collecting samples again.
9896
if self.parameters_changed() {
99-
dbg!(&self);
10097
self.offset_duration += self.samples_counted as f64
10198
/ self.current_span_sample_rate as f64
10299
/ self.current_span_channels.get() as f64;

tests/seek.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ fn seek_results_in_correct_remaining_playtime(
8181

8282
let decoder = get_music(format);
8383
let total_duration = time_remaining(decoder);
84-
dbg!(total_duration);
8584

8685
const SEEK_BEFORE_END: Duration = Duration::from_secs(5);
8786
let mut decoder = get_music(format);

tests/take_duration.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ fn fadeout() {
9393
.take_duration(span_duration.mul_f32(1.5))
9494
.with_fadeout(true)
9595
.collect::<Vec<_>>();
96-
dbg!(&fade_out);
9796
assert_eq!(fade_out.first(), Some(&1.0));
9897
// fade_out ends the step before zero
9998
assert!(fade_out.last().unwrap() > &0.0);

0 commit comments

Comments
 (0)