aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/rtmppkt.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-06-01 23:56:17 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-06-01 23:56:22 +0200
commit6b9cbc9a1164988b3517f4f160f7937e1644cdc3 (patch)
tree18f7678940d2fb685312ba02cfdd4101ece5ba69 /libavformat/rtmppkt.c
parent8225bf95bc3ffc9757879d2eb092cf3fa9d6b26f (diff)
parent3b18857ab301d2a0b3e86e9d85eed76f0798a29c (diff)
downloadffmpeg-6b9cbc9a1164988b3517f4f160f7937e1644cdc3.tar.gz
Merge commit '3b18857ab301d2a0b3e86e9d85eed76f0798a29c'
* commit '3b18857ab301d2a0b3e86e9d85eed76f0798a29c': rtmppkt: Add method to read an AMF string that is not prefixed by its type Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/rtmppkt.c')
-rw-r--r--libavformat/rtmppkt.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/libavformat/rtmppkt.c b/libavformat/rtmppkt.c
index 65d5dd9d57..92172dc366 100644
--- a/libavformat/rtmppkt.c
+++ b/libavformat/rtmppkt.c
@@ -102,13 +102,11 @@ int ff_amf_read_number(GetByteContext *bc, double *val)
return 0;
}
-int ff_amf_read_string(GetByteContext *bc, uint8_t *str,
- int strsize, int *length)
+int ff_amf_get_string(GetByteContext *bc, uint8_t *str,
+ int strsize, int *length)
{
int stringlen = 0;
int readsize;
- if (bytestream2_get_byte(bc) != AMF_DATA_TYPE_STRING)
- return AVERROR_INVALIDDATA;
stringlen = bytestream2_get_be16(bc);
if (stringlen + 1 > strsize)
return AVERROR(EINVAL);
@@ -122,6 +120,14 @@ int ff_amf_read_string(GetByteContext *bc, uint8_t *str,
return 0;
}
+int ff_amf_read_string(GetByteContext *bc, uint8_t *str,
+ int strsize, int *length)
+{
+ if (bytestream2_get_byte(bc) != AMF_DATA_TYPE_STRING)
+ return AVERROR_INVALIDDATA;
+ return ff_amf_get_string(bc, str, strsize, length);
+}
+
int ff_amf_read_null(GetByteContext *bc)
{
if (bytestream2_get_byte(bc) != AMF_DATA_TYPE_NULL)