Fixed HLS non-subtitle output
This commit is contained in:
parent
42df4d136e
commit
71477f05d3
1 changed files with 12 additions and 1 deletions
|
@ -26,6 +26,13 @@ namespace Mist {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unsigned int vidTracks = 0;
|
unsigned int vidTracks = 0;
|
||||||
|
bool hasSubs = false;
|
||||||
|
for (std::map<unsigned int, DTSC::Track>::iterator it = myMeta.tracks.begin(); it != myMeta.tracks.end(); it++) {
|
||||||
|
if (it->second.codec == "subtitle"){
|
||||||
|
hasSubs = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
for (std::map<unsigned int, DTSC::Track>::iterator it = myMeta.tracks.begin(); it != myMeta.tracks.end(); it++) {
|
for (std::map<unsigned int, DTSC::Track>::iterator it = myMeta.tracks.begin(); it != myMeta.tracks.end(); it++) {
|
||||||
if (it->second.codec == "H264" || it->second.codec == "HEVC" || it->second.codec == "MPEG2") {
|
if (it->second.codec == "H264" || it->second.codec == "HEVC" || it->second.codec == "MPEG2") {
|
||||||
vidTracks++;
|
vidTracks++;
|
||||||
|
@ -36,7 +43,11 @@ namespace Mist {
|
||||||
if (audioId != -1) {
|
if (audioId != -1) {
|
||||||
bWidth += myMeta.tracks[audioId].bps;
|
bWidth += myMeta.tracks[audioId].bps;
|
||||||
}
|
}
|
||||||
|
if (!hasSubs){
|
||||||
|
result << "#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=" << (bWidth * 8) << "\r\n";
|
||||||
|
}else{
|
||||||
result << "#EXT-X-STREAM-INF:PROGRAM-ID=1,SUBTITLES=\"sub1\",BANDWIDTH=" << (bWidth * 8) << "\r\n";
|
result << "#EXT-X-STREAM-INF:PROGRAM-ID=1,SUBTITLES=\"sub1\",BANDWIDTH=" << (bWidth * 8) << "\r\n";
|
||||||
|
}
|
||||||
result << it->first;
|
result << it->first;
|
||||||
if (audioId != -1) {
|
if (audioId != -1) {
|
||||||
result << "_" << audioId;
|
result << "_" << audioId;
|
||||||
|
|
Loading…
Add table
Reference in a new issue