Skip to content

Commit

Permalink
HLS: prepare: fail if number of channels doesn't match
Browse files Browse the repository at this point in the history
Fixes #59.

Signed-off-by: Stefan Westerfeld <stefan@space.twc.de>
  • Loading branch information
swesterfeld committed Apr 24, 2024
1 parent c4c5018 commit 0afd30a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/hls.cc
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,13 @@ hls_prepare (const string& in_dir, const string& out_dir, const string& filename
error ("audiowmark: hls segment '%s' is not encoded using AAC\n", segname.c_str());
return 1;
}
int segment_channels = atoi (params["channels"].c_str());
if (segment_channels != audio_master_data.n_channels())
{
error ("audiowmark: number of channels mismatch:\n - hls segment '%s' has %d channels\n - audio master '%s' has %d channels\n",
segname.c_str(), segment_channels, audio_master.c_str(), audio_master_data.n_channels());
return 1;
}

/* get segment parameters */
if (params["channel_layout"].empty())
Expand Down

0 comments on commit 0afd30a

Please sign in to comment.