mirror of
https://github.com/kilyabin/psysonic.git
synced 2026-07-22 14:35:41 +00:00
diag(audio): trace ranged-stream supersedion + abort paths
Skipping tracks while a RangedHttpSource is still in initial probe leaves no diagnostic trail today: RangedHttpSource::read returns Ok(0) on gen-mismatch (silent), ranged_download_task drops out the same way, and the `dl done` summary only fires under app_deprintln so release users never see partial/aborted downloads either. Add focused logs at the bail points without changing behaviour: - RangedHttpSource::read — log on each Ok(0) return that isn't the normal pos>=total_size EOF (superseded before/during wait, download done with no bytes ahead of cursor). Symphonia stops reading after Ok(0), so at most one log per source, no spam. - ranged_download_task — log on the gen-mismatch bail with track id + gen transition + downloaded/total bytes so we can tell "user skipped while downloading" apart from "stream stalled". - track_download_task — same gen-mismatch log for the legacy non-seekable path (consistency with ranged). - dl-done summary — split into release-visible `[stream] ranged dl ABORTED: …` (downloaded < total_size) vs the existing dev-only `[stream] dl done` for full completions. - audio_play — log on both supersedion-bail points around select_play_input so a silently-ending audio_play call leaves a trace. No semantics changed: every existing return / store / branch is intact. Pure additive logging to make the next reproduction of cucadmuh's ranged-stream toast diagnosable.
This commit is contained in:
@@ -147,11 +147,21 @@ pub async fn audio_play(
|
||||
&app,
|
||||
).await? {
|
||||
Some(input) => input,
|
||||
None => return Ok(()), // superseded — bail
|
||||
None => {
|
||||
crate::app_deprintln!(
|
||||
"[audio] audio_play superseded inside select_play_input: gen={} cur={} track_id={:?}",
|
||||
gen, state.generation.load(Ordering::SeqCst), cache_id_for_tasks
|
||||
);
|
||||
return Ok(());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
if state.generation.load(Ordering::SeqCst) != gen {
|
||||
crate::app_deprintln!(
|
||||
"[audio] audio_play superseded after select_play_input: gen={} cur={} track_id={:?}",
|
||||
gen, state.generation.load(Ordering::SeqCst), cache_id_for_tasks
|
||||
);
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user