Commit Graph

9 Commits

Author SHA1 Message Date
Claude
78004b0327 Fix FLAC pk collision by ensuring full 1024 bytes are read
Problem Analysis:
- All FLAC files had the same pk (071c5713d5cf485ca688832207bef0f9)
- Root cause: read() can return < 1024 bytes on first call
- If read returned only 400 bytes:
  * header.len() = 400
  * 400 > 512 = false
  * Used header[..] (first 400 bytes = FLAC header)
  * All FLAC files have identical headers → same pk!

Solution:
- Added read_exact_or_eof() that loops until 1024 bytes read (or EOF)
- Guarantees we skip FLAC header and use actual audio content
- Works for small files (< 512 bytes) and large files (>= 1024 bytes)

Additional Feature:
- Added AudioSink::with_null_output() for testing without audio device
- Added --null-audio flag to play_and_cache example
- Allows testing in containerized environments

Changes:
1. pmocache/src/download.rs: Added read_exact_or_eof()
2. pmocache/src/cache.rs: Use read_exact_or_eof() for pk calculation
3. pmoaudio/src/nodes/audio_sink.rs: Added null output mode
4. pmoparadise/examples/play_and_cache.rs: Added --null-audio flag

Test Results:
- New pk: 83702c1cbca72074ebf7c123336786ea (was 071c...)
- Null audio output works correctly
- Ready for full testing
2025-11-07 07:24:19 +00:00
785f8d52a5 Update la web app pour tirer partie du nouveau systeme de cache 2025-10-29 22:36:36 +01:00
33761f1cef Refactoring du cache pour une meilleur gestion des metadonnées 2025-10-29 22:35:10 +01:00
ecb362ae48 refactoring des caches 2025-10-25 17:46:53 +02:00
b95bebdb6a Patch of the web logger 2025-10-20 19:50:58 +02:00
a809fca1ac Correction de la source radio paradise pour avoir un sous dossier par canal 2025-10-20 16:18:21 +02:00
455fc4ed21 Généralisation des caches permettant de passer des reader générique et pas seulement de flux http. 2025-10-20 16:18:21 +02:00
208fe8be76 amélioration de la webapp 2025-10-20 16:18:21 +02:00
9bd0cd173b Ajout de fonctionnalité de download asynchrone au pmocache 2025-10-17 22:14:30 +02:00