Skip to content

Commit

Permalink
Remove RENDITION_PREFIX from push URL (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKordic committed Oct 10, 2022
1 parent 2f85354 commit 17e8d6a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions handlers/misttriggers/live_tracklist.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ func (d *MistCallbackHandlersCollection) TriggerLiveTrackList(w http.ResponseWri
errors.WriteHTTPBadRequest(w, "PUSH_END trigger invoked for something that isn't a transcode stream: "+streamName, nil)
return
}
uniqueName := streamName[len(config.RENDITION_PREFIX):]

// Fetch the stream info from cache (cached when we kicked off the transcode process)
info := cache.DefaultStreamCache.Transcoding.Get(streamName)
Expand Down Expand Up @@ -146,7 +147,7 @@ func (d *MistCallbackHandlersCollection) TriggerLiveTrackList(w http.ResponseWri
continue
}

dirPath := fmt.Sprintf("%s_%dx%d/stream.m3u8", streamName, tracks[i].Width, tracks[i].Height)
dirPath := fmt.Sprintf("_%s_%dx%d/stream.m3u8", uniqueName, tracks[i].Width, tracks[i].Height)
dirPathUrl, err := url.JoinPath(info.UploadDir, dirPath)
if err != nil {
errors.WriteHTTPInternalServerError(w, "Failed to generate the upload directory path: "+streamName, err)
Expand Down Expand Up @@ -180,7 +181,7 @@ func (d *MistCallbackHandlersCollection) TriggerLiveTrackList(w http.ResponseWri
// Generate a sorted list for multivariant playlist (reverse order of bitrate then resolution):
sort.Sort(sort.Reverse(ByBitrate(trackList)))
manifest := createPlaylist(multivariantPlaylist, trackList)
err = uploadPlaylist(fmt.Sprintf("%s/%s-master.m3u8", rootPathUrl.String(), streamName), manifest)
err = uploadPlaylist(fmt.Sprintf("%s/%s-master.m3u8", rootPathUrl.String(), uniqueName), manifest)
if err != nil {
errors.WriteHTTPInternalServerError(w, "Failed to upload multivariant master playlist: "+streamName, err)
return
Expand Down

0 comments on commit 17e8d6a

Please sign in to comment.