File tree 1 file changed +9
-4
lines changed
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -348,11 +348,16 @@ impl Read for AudioFileStreaming {
348
348
impl Seek for AudioFileStreaming {
349
349
fn seek ( & mut self , pos : SeekFrom ) -> io:: Result < u64 > {
350
350
self . position = try!( self . read_file . seek ( pos) ) ;
351
+ // Do not seek past EOF
352
+ if ( self . position as usize % CHUNK_SIZE ) != 0 {
353
+ // Notify the fetch thread to get the correct block
354
+ // This can fail if fetch thread has completed, in which case the
355
+ // block is ready. Just ignore the error.
356
+ let _ = self . seek . unbounded_send ( self . position ) ;
357
+ } else {
358
+ warn ! ( "Trying to seek past EOF" ) ;
359
+ }
351
360
352
- // Notify the fetch thread to get the correct block
353
- // This can fail if fetch thread has completed, in which case the
354
- // block is ready. Just ignore the error.
355
- let _ = self . seek . unbounded_send ( self . position ) ;
356
361
Ok ( self . position )
357
362
}
358
363
}
You can’t perform that action at this time.
0 commit comments