aboutsummaryrefslogtreecommitdiff
path: root/common/src/stream.rs
diff options
context:
space:
mode:
Diffstat (limited to 'common/src/stream.rs')
-rw-r--r--common/src/stream.rs18
1 files changed, 4 insertions, 14 deletions
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<usize>,
+ pub track: Vec<usize>,
pub format: StreamFormat,
pub webm: Option<bool>,
pub profile: Option<usize>,
@@ -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::<Vec<_>>()
- .join(",")
- )
- .unwrap();
+ for t in &self.track {
+ write!(u, "&track={}", t).unwrap();
}
if let Some(profile) = self.profile {
write!(u, "&profile={profile}").unwrap();