Files
aes67-ESP32-P4/main/hls.h
T
bsncubed c6ecbbeb25 Player: auto mode fails over between Spotify and HLS
No Spotify session (or paused, with failover_on_pause) for failover_delay_s
switches to HLS; Spotify playing switches back within ~1 s. Switches fade
out/in over 30 ms and flush the ring. HLS is suspended while Spotify plays.
cspot is held back instead of drained while it isn't Spotify's turn: it keeps
decoding on pause, so dropping its frames let it race through the queue.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 22:36:11 +10:00

19 lines
663 B
C

// HLS client: playlists, variant choice, live segment loop. Segment bytes go to a sink callback.
#pragma once
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include "esp_err.h"
// Receives segment data in chunks (MPEG-TS etc.). Return false to abort the segment.
typedef bool (*hls_sink_t)(const uint8_t *data, size_t len, bool segment_start);
esp_err_t hls_start(hls_sink_t sink);
// Stop fetching (current download is abandoned) until resumed. Reasons are independent:
// fetching runs only when no reason holds it.
#define HLS_SUSPEND_OTA (1 << 0)
#define HLS_SUSPEND_FAILOVER (1 << 1)
void hls_suspend(unsigned reason, bool suspend);