Skip to content

Commit

Permalink
feat(core): add FLV streams in requireStreams messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibaultBee committed Apr 8, 2024
1 parent a8e8d13 commit 685295e
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,10 @@ class FlvMuxer(
* Check that there shall be no more than one audio and one video stream
*/
private fun requireStreams() {
require(streams.count { it.config.mimeType.isAudio } <= 1) { "Only one audio stream is supported by FLV" }
require(streams.count { it.config.mimeType.isVideo } <= 1) { "Only one video stream is supported by FLV" }
val audioStreams = streams.filter { it.config.mimeType.isAudio }
require(audioStreams.size <= 1) { "Only one audio stream is supported by FLV but got $audioStreams" }
val videoStreams = streams.filter { it.config.mimeType.isVideo }
require(videoStreams.size <= 1) { "Only one video stream is supported by FLV but got $videoStreams" }
}

private data class Stream(val config: Config) {
Expand Down

0 comments on commit 685295e

Please sign in to comment.