From c0ba30314a06de10c9b98ac130676dcbc9f287fa Mon Sep 17 00:00:00 2001 From: metamuffin Date: Mon, 29 Jan 2024 15:03:18 +0100 Subject: rename stream spec param --- common/src/stream.rs | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'common') diff --git a/common/src/stream.rs b/common/src/stream.rs index d0b1373..3314cb0 100644 --- a/common/src/stream.rs +++ b/common/src/stream.rs @@ -11,7 +11,7 @@ use serde::{Deserialize, Serialize}; #[derive(Debug, Clone, Deserialize, Serialize)] #[cfg_attr(feature = "rocket", derive(FromForm, UriDisplayQuery))] pub struct StreamSpec { - pub tracks: Vec, + pub track: Vec, pub format: StreamFormat, pub webm: Option, pub profile: Option, @@ -36,7 +36,7 @@ pub enum StreamFormat { impl Default for StreamSpec { fn default() -> Self { Self { - tracks: Vec::new(), + track: Vec::new(), format: StreamFormat::Matroska, webm: Some(true), profile: None, @@ -50,18 +50,8 @@ impl StreamSpec { use std::fmt::Write; let mut u = String::new(); write!(u, "format={}", self.format.ident()).unwrap(); - - if !self.tracks.is_empty() { - write!( - u, - "&tracks={}", - self.tracks - .iter() - .map(|s| s.to_string()) - .collect::>() - .join(",") - ) - .unwrap(); + for t in &self.track { + write!(u, "&track={}", t).unwrap(); } if let Some(profile) = self.profile { write!(u, "&profile={profile}").unwrap(); -- cgit v1.2.3-70-g09d2