diff --git a/src-tauri/src/audio.rs b/src-tauri/src/audio.rs index 6535097c..6030dbed 100644 --- a/src-tauri/src/audio.rs +++ b/src-tauri/src/audio.rs @@ -890,7 +890,13 @@ impl MediaSource for SizedCursorSource { // Implements Iterator + Source — identical interface to // rodio::Decoder, so the rest of the source chain is unchanged. +/// Max retries for IO/packet-read errors (fatal — network drop, truncated file). const DECODE_MAX_RETRIES: usize = 3; +/// Max *consecutive* DecodeErrors before giving up on a file. +/// Non-fatal errors like "invalid main_data offset" are silently dropped up to +/// this limit so a handful of corrupt MP3 frames never aborts an otherwise +/// playable track (VLC-style frame dropping). +const MAX_CONSECUTIVE_DECODE_ERRORS: usize = 100; struct SizedDecoder { decoder: Box, @@ -899,6 +905,9 @@ struct SizedDecoder { total_duration: Option