Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove RENDITION_PREFIX from push URL #56

Merged
merged 1 commit into from
Oct 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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