On 20 September 2013 10:17, Martin Storsjö <[email protected]> wrote: > On Fri, 20 Sep 2013, Luca Barbato wrote: > >> --- >> >> I'm not so sure we support the other kind of array btw... > > > Indeed, the handling of the other type of array seems wrong here. OBJECT and > MIXEDARRAY should be pretty much the same, right? While ARRAY doesn't have > string objects before each value object. >
The ARRAY type is also supposed to be prefixed with the array length as an AMF int32, something the current code doesn't handle properly. > >> libavformat/rtmppkt.c | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/libavformat/rtmppkt.c b/libavformat/rtmppkt.c >> index 643d80f..9c14edc 100644 >> --- a/libavformat/rtmppkt.c >> +++ b/libavformat/rtmppkt.c >> @@ -379,6 +379,7 @@ int ff_amf_tag_size(const uint8_t *data, const uint8_t >> *data_end) >> case AMF_DATA_TYPE_STRING: return 3 + AV_RB16(data); >> case AMF_DATA_TYPE_LONG_STRING: return 5 + AV_RB32(data); >> case AMF_DATA_TYPE_NULL: return 1; >> + case AMF_DATA_TYPE_MIXEDARRAY: >> case AMF_DATA_TYPE_ARRAY: >> data += 4; >> case AMF_DATA_TYPE_OBJECT: >> @@ -501,6 +502,7 @@ static void amf_tag_contents(void *ctx, const uint8_t >> *data, >> case AMF_DATA_TYPE_NULL: >> av_log(ctx, AV_LOG_DEBUG, " NULL\n"); >> return; >> + case AMF_DATA_TYPE_MIXEDARRAY: >> case AMF_DATA_TYPE_ARRAY: >> data += 4; >> case AMF_DATA_TYPE_OBJECT: >> -- >> 1.8.3.2 > > > I guess this works right (assuming you tested it in some way)... Also OK with me if tested/fixes something. _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
