@@ -504,7 +504,7 @@ func JoinURL(baseURL string, append string, debugLog bool) string {
504
504
*/
505
505
func GetFile (currentURL string , fileBaseURL string , fileLocation string , isByteRangeMPD bool , startRange int , endRange int ,
506
506
segmentNumber int , segmentDuration int , addSegDuration bool , quicBool bool , debugFile string , debugLog bool ,
507
- useTestbedBool bool , repRate int , saveFilesBool bool , AudioByteRange bool ) (time.Duration , int , string , string , float64 ) {
507
+ useTestbedBool bool , repRate int , saveFilesBool bool , AudioByteRange bool , profile string ) (time.Duration , int , string , string , float64 ) {
508
508
509
509
// create the string where we want to save this file
510
510
var createFile string
@@ -522,14 +522,17 @@ func GetFile(currentURL string, fileBaseURL string, fileLocation string, isByteR
522
522
base := path .Base (fileBaseURL )
523
523
524
524
// we need to create a file to save for the byte-range content
525
- if isByteRangeMPD && ! AudioByteRange {
525
+ // but only for the video byte range and not audio byte range
526
+ // if isByteRangeMPD && !AudioByteRange {
527
+ // for now, lets just save each segment
528
+ if isByteRangeMPD {
526
529
s := strings .Split (base , "." )
527
530
base = s [0 ] + "_segment" + strconv .Itoa (segmentNumber ) + ".m4s"
528
531
}
529
532
530
533
// create the new file location, or not
531
- if addSegDuration || AudioByteRange {
532
- createFile = fileLocation + "/" + strconv .Itoa (segmentDuration ) + "sec_" + base
534
+ if ! strings . Contains ( base , profile ) && ( addSegDuration || AudioByteRange ) {
535
+ createFile = fileLocation + "/" + strconv .Itoa (segmentDuration ) + "sec_" + profile + "_" + base
533
536
} else {
534
537
createFile = fileLocation + "/" + base
535
538
}
@@ -629,7 +632,7 @@ func GetFile(currentURL string, fileBaseURL string, fileLocation string, isByteR
629
632
* get the provided file from the online HTTP server and save to folder
630
633
* get a 1-second piece of each file
631
634
*/
632
- func GetFileProgressively (currentURL string , fileBaseURL string , fileLocation string , isByteRangeMPD bool , startRange int , endRange int , segmentNumber int , segmentDuration int , addSegDuration bool , debugLog bool , AudioByteRange bool ) (time.Duration , int ) {
635
+ func GetFileProgressively (currentURL string , fileBaseURL string , fileLocation string , isByteRangeMPD bool , startRange int , endRange int , segmentNumber int , segmentDuration int , addSegDuration bool , debugLog bool , AudioByteRange bool , profile string ) (time.Duration , int ) {
633
636
634
637
// create the string where we want to save this file
635
638
var createFile string
@@ -646,14 +649,16 @@ func GetFileProgressively(currentURL string, fileBaseURL string, fileLocation st
646
649
base := path .Base (fileBaseURL )
647
650
648
651
// we need to create a file to save for the byte-range content
649
- if isByteRangeMPD && ! AudioByteRange {
652
+ // if isByteRangeMPD && !AudioByteRange {
653
+ if isByteRangeMPD {
654
+ // for now, lets just save each segment
650
655
s := strings .Split (base , "." )
651
656
base = s [0 ] + "_segment" + strconv .Itoa (segmentNumber ) + ".m4s"
652
657
}
653
658
654
659
// create the new file location, or not
655
- if addSegDuration {
656
- createFile = fileLocation + "/" + strconv .Itoa (segmentDuration ) + "sec_" + base
660
+ if addSegDuration && ! strings . Contains ( base , profile ) {
661
+ createFile = fileLocation + "/" + strconv .Itoa (segmentDuration ) + "sec_" + profile + "_" + base
657
662
} else {
658
663
createFile = fileLocation + "/" + base
659
664
}
0 commit comments