Added RTMP unescaping code to fix Xsplit support for wildcard streams.
This commit is contained in:
parent
230772f125
commit
87e2c774fd
1 changed files with 34 additions and 1 deletions
|
@ -37,6 +37,39 @@ namespace Mist {
|
|||
|
||||
OutRTMP::~OutRTMP() {}
|
||||
|
||||
|
||||
/// Helper function for urlunescape.
|
||||
/// Takes a single char input and outputs its integer hex value.
|
||||
int unhex(char c) {
|
||||
return (c >= '0' && c <= '9' ? c - '0' : c >= 'A' && c <= 'F' ? c - 'A' + 10 : c - 'a' + 10);
|
||||
}
|
||||
|
||||
/// Unescapes URLencoded std::string data.
|
||||
std::string urlunescape(const std::string & in) {
|
||||
std::string out;
|
||||
for (unsigned int i = 0; i < in.length(); ++i) {
|
||||
if (in[i] == '%') {
|
||||
char tmp = 0;
|
||||
++i;
|
||||
if (i < in.length()) {
|
||||
tmp = unhex(in[i]) << 4;
|
||||
}
|
||||
++i;
|
||||
if (i < in.length()) {
|
||||
tmp += unhex(in[i]);
|
||||
}
|
||||
out += tmp;
|
||||
} else {
|
||||
if (in[i] == '+') {
|
||||
out += ' ';
|
||||
} else {
|
||||
out += in[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
void OutRTMP::parseVars(std::string data){
|
||||
std::string varname;
|
||||
std::string varval;
|
||||
|
@ -613,7 +646,7 @@ namespace Mist {
|
|||
int playTransaction = amfData.getContentP(1)->NumValue();
|
||||
int playMessageType = messageType;
|
||||
int playStreamId = streamId;
|
||||
streamName = amfData.getContentP(3)->StrValue();
|
||||
streamName = urlunescape(amfData.getContentP(3)->StrValue());
|
||||
reqUrl += "/"+streamName;//LTS
|
||||
|
||||
//handle variables
|
||||
|
|
Loading…
Add table
Reference in a new issue