Skip to content

Commit

Permalink
Update buffer.go
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelGoerentz authored Aug 21, 2024
1 parent b04d3a8 commit 6517934
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/buffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,8 @@ func bufferingStream(playlistID, streamingURL, backupStreamingURL1, backupStream

client.Connection = 1
activeClientCount += 1
if activePlaylistCount == 0 {
activePlaylistCount = 1
}
activePlaylistCount += 1

stream.URL = streamingURL
stream.BackupChannel1URL = backupStreamingURL1
stream.BackupChannel2URL = backupStreamingURL2
Expand Down Expand Up @@ -518,7 +517,11 @@ func killClientConnection(streamID int, playlistID string, force bool) {
showInfo(fmt.Sprintf("Streaming Status:Channel: %s (Clients: %d)", stream.ChannelName, clients.Connection))

if clients.Connection <= 0 {
activePlaylistCount -= 1
if activePlaylistCount > 0 {
activePlaylistCount -= 1
} else {
activePlaylistCount = 0
}
BufferClients.Delete(playlistID + stream.MD5)
delete(playlist.Streams, streamID)
delete(playlist.Clients, streamID)
Expand Down

0 comments on commit 6517934

Please sign in to comment.