Throw if time given to AudioScheduledSourceNode.stop is negative

This commit is contained in:
Fernando Jiménez Moreno 2018-09-24 11:53:36 +02:00
parent bbc3565900
commit bc6586a9d0
2 changed files with 8 additions and 4 deletions

View file

@ -200,10 +200,6 @@ impl AudioBufferSourceNodeMethods for AudioBufferSourceNode {
offset: Option<Finite<f64>>,
duration: Option<Finite<f64>>,
) -> Fallible<()> {
if *when < 0. {
return Err(Error::Range("'when' must be a positive value".to_owned()));
}
if let Some(offset) = offset {
if *offset < 0. {
return Err(Error::Range("'offset' must be a positive value".to_owned()));