Refactor audio pipeline for multi-client streaming and improved error handling
Refactor the audio pipeline to support multi-client streaming with new OggFlacStreamHandle and StreamingOggFlacSink. - Replace DirectOggFlacSink with StreamingOggFlacSink in pipeline - Update documentation and comments to reflect multi-client support - Add detailed warning logs for buffer underruns and client disconnections - Remove TimerBufferNode from pipeline as it's no longer needed - Update connect() calls to subscribe() for new streaming behavior This change enables multiple clients to subscribe to the same audio stream, with each subscription getting a live feed from the current point in time.
This commit is contained in:
@@ -29,8 +29,8 @@ pub struct WebRendererInstance {
|
||||
pub udn: String,
|
||||
pub device_instance: Arc<DeviceInstance>,
|
||||
pub state: SharedState,
|
||||
/// Handle vers le sink OGG-FLAC — clonable, reconnectable à chaque Play.
|
||||
pub flac_handle: pmoaudio_ext::sinks::DirectOggFlacHandle,
|
||||
/// Handle vers le sink OGG-FLAC — clonable, chaque subscribe() donne un flux live.
|
||||
pub flac_handle: pmoaudio_ext::sinks::OggFlacStreamHandle,
|
||||
pub pipeline: PipelineHandle,
|
||||
pub created_at: SystemTime,
|
||||
}
|
||||
@@ -116,11 +116,11 @@ impl RendererRegistry {
|
||||
Ok((stream_url, udn))
|
||||
}
|
||||
|
||||
/// Retourne le DirectOggFlacHandle pour l'endpoint /stream (clonable).
|
||||
/// Retourne le OggFlacStreamHandle pour l'endpoint /stream (clonable).
|
||||
pub fn get_flac_handle(
|
||||
&self,
|
||||
instance_id: &str,
|
||||
) -> Option<pmoaudio_ext::sinks::DirectOggFlacHandle> {
|
||||
) -> Option<pmoaudio_ext::sinks::OggFlacStreamHandle> {
|
||||
self.instances
|
||||
.read()
|
||||
.get(instance_id)
|
||||
|
||||
Reference in New Issue
Block a user