Skip to content

Commit

Permalink
fix segment downloads
Browse files Browse the repository at this point in the history
  • Loading branch information
frostbyte73 committed Jun 25, 2024
1 parent 055dae3 commit 4315da2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test/segments.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,17 @@ func (r *Runner) verifySegmentOutput(t *testing.T, p *config.PipelineConfig, fil

storedPlaylistPath := plName
localPlaylistPath := plName
storedPlaylistName := path.Base(plName)

// download from cloud storage
if uploadConfig := p.GetSegmentConfig().UploadConfig; uploadConfig != nil {
localPlaylistPath = path.Join(r.FilePrefix, storedPlaylistName)
localPlaylistPath = path.Join(r.FilePrefix, path.Base(storedPlaylistPath))
download(t, uploadConfig, localPlaylistPath, storedPlaylistPath)
if plType == m3u8.PlaylistTypeEvent {
// Only download segments once
base := storedPlaylistPath[:len(storedPlaylistPath)-5]
for i := 0; i < segmentCount; i++ {
cloudPath := fmt.Sprintf("%s_%05d.ts", base, i)
localPath := path.Join(r.FilePrefix, cloudPath)
localPath := path.Join(r.FilePrefix, path.Base(cloudPath))
download(t, uploadConfig, localPath, cloudPath)
}
}
Expand Down

0 comments on commit 4315da2

Please sign in to comment.