mirror of
				https://github.com/jhbruhn/jellyfin-radio.git
				synced 2025-10-31 11:26:03 +00:00 
			
		
		
		
	Allow broken file playback
This commit is contained in:
		
							parent
							
								
									b862d08167
								
							
						
					
					
						commit
						aa3518807a
					
				
					 2 changed files with 7 additions and 10 deletions
				
			
		|  | @ -1,4 +1,3 @@ | |||
| use awedio::Sound; | ||||
| use bytes::Buf; | ||||
| use serde::Deserialize; | ||||
| 
 | ||||
|  |  | |||
|  | @ -95,17 +95,15 @@ impl Sound for Player { | |||
|             self.was_empty = false; | ||||
|             return Ok(NextSample::MetadataChanged); | ||||
|         } | ||||
|         let next_sample = match next_sound.next_sample() { | ||||
|             Ok(s) => s, | ||||
|             Err(e) => { | ||||
|                 self.sounds.remove(0); | ||||
|                 return Err(e); | ||||
|             } | ||||
|         }; | ||||
|         
 | ||||
|         let next_sample = next_sound.next_sample(); | ||||
|         if let Err(e) = &next_sample { | ||||
|             println!("Error playing track: {:?}", e); | ||||
|         } | ||||
| 
 | ||||
|         let ret = match next_sample { | ||||
|             NextSample::Sample(_) | NextSample::MetadataChanged | NextSample::Paused => next_sample, | ||||
|             NextSample::Finished => { | ||||
|             Ok(NextSample::Sample(_) | NextSample::MetadataChanged | NextSample::Paused) => next_sample.unwrap(), | ||||
|             Ok(NextSample::Finished) | Err(_) => { // Just ignore the error
 | ||||
|                 self.sounds.remove(0); | ||||
|                 if self.sounds.is_empty() { | ||||
|                     NextSample::Finished | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue