On 21 September 2013 02:47, Luca Barbato <[email protected]> wrote:
> Certain streaming servers do not preserve the order of the fields.
> ---
>
> Now assuming strict arrays do not have a key as string.
>
> libavformat/flvdec.c | 88
> ++++++++++++++++++++++++++++++++++++++++------------
> 1 file changed, 69 insertions(+), 19 deletions(-)
>
> diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
> index b8feeaf..051bdc9 100644
> --- a/libavformat/flvdec.c
> +++ b/libavformat/flvdec.c
> @@ -634,35 +634,84 @@ static void clear_index_entries(AVFormatContext *s,
> int64_t pos)
> }
> }
>
> +static int amf_skip_tag(AVIOContext *pb, AMFDataType type)
> +{
> + int nb = -1, ret, parse_name = 0;
> +
> + switch (type) {
> + case AMF_DATA_TYPE_NUMBER:
> + avio_skip(pb, 8);
> + break;
> + case AMF_DATA_TYPE_BOOL:
> + avio_skip(pb, 1);
> + break;
> + case AMF_DATA_TYPE_STRING:
> + avio_skip(pb, avio_rb16(pb));
> + break;
> + case AMF_DATA_TYPE_ARRAY:
> + parse_name = 1;
> + case AMF_DATA_TYPE_MIXEDARRAY:
> + avio_skip(pb, 4);
> + case AMF_DATA_TYPE_OBJECT:
> + while(!pb->eof_reached && (nb > 0 || type != AMF_DATA_TYPE_ARRAY)) {
nb is never set; it will always be -1.
> + if (parse_name) {
This will never be hit the way the code is currently written. The
parse_name conditions also look mixed up; probably it should default
to 1 and be set to 0 for plain arrays.
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel