Commit c047a41b authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '33f28a3b'

* commit '33f28a3b':
  rtmp: Add a function for writing AMF strings based on two substrings
  rtmp: Return a proper error code in handle_invoke_error
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents d079d1d3 33f28a3b
......@@ -47,6 +47,19 @@ void ff_amf_write_string(uint8_t **dst, const char *str)
bytestream_put_buffer(dst, str, strlen(str));
}
void ff_amf_write_string2(uint8_t **dst, const char *str1, const char *str2)
{
int len1 = 0, len2 = 0;
if (str1)
len1 = strlen(str1);
if (str2)
len2 = strlen(str2);
bytestream_put_byte(dst, AMF_DATA_TYPE_STRING);
bytestream_put_be16(dst, len1 + len2);
bytestream_put_buffer(dst, str1, len1);
bytestream_put_buffer(dst, str2, len2);
}
void ff_amf_write_null(uint8_t **dst)
{
bytestream_put_byte(dst, AMF_DATA_TYPE_NULL);
......
......@@ -203,6 +203,15 @@ void ff_amf_write_number(uint8_t **dst, double num);
*/
void ff_amf_write_string(uint8_t **dst, const char *str);
/**
* Write a string consisting of two parts in AMF format to a buffer.
*
* @param dst pointer to the input buffer (will be modified)
* @param str1 first string to write, may be null
* @param str2 second string to write, may be null
*/
void ff_amf_write_string2(uint8_t **dst, const char *str1, const char *str2);
/**
* Write AMF NULL value to buffer.
*
......
......@@ -1530,7 +1530,7 @@ static int handle_invoke_error(URLContext *s, RTMPPacket *pkt)
level = AV_LOG_WARNING;
ret = 0;
} else
ret = -1;
ret = AVERROR_UNKNOWN;
av_log(s, level, "Server error: %s\n", tmpstr);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment