From 2d8c76eb1f1c198e81c36a95c0d56e55cc1f4c5a Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sat, 3 Nov 2012 05:35:35 +0100 Subject: [PATCH] asfdec: parse payload extension list Signed-off-by: Michael Niedermayer --- libavformat/asf.h | 8 ++++++++ libavformat/asfdec.c | 14 ++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/libavformat/asf.h b/libavformat/asf.h index 822cd6bbea..528d4c1773 100644 --- a/libavformat/asf.h +++ b/libavformat/asf.h @@ -28,6 +28,11 @@ #define PACKET_SIZE 3200 +typedef struct ASFPayload { + uint8_t type; + uint16_t size; +} ASFPayload; + typedef struct ASFStream { int num; unsigned char seq; @@ -47,6 +52,9 @@ typedef struct ASFStream { int palette_changed; uint32_t palette[256]; + + int payload_ext_ct; + ASFPayload payload[8]; } ASFStream; typedef struct ASFMainHeader { diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c index 9f56818312..4ad5c2dfd7 100644 --- a/libavformat/asfdec.c +++ b/libavformat/asfdec.c @@ -512,8 +512,10 @@ static int asf_read_ext_stream_properties(AVFormatContext *s, int64_t size) stream_ct = avio_rl16(pb); //stream-name-count payload_ext_ct = avio_rl16(pb); //payload-extension-system-count - if (stream_num < 128) + if (stream_num < 128) { asf->stream_bitrates[stream_num] = leak_rate; + asf->streams[stream_num].payload_ext_ct = 0; + } for (i=0; istreams[stream_num].payload)) { + ASFPayload *p = &asf->streams[stream_num].payload[i]; + p->type = g[0]; + p->size = size; + av_log(s, AV_LOG_DEBUG, "Payload extension %x %d\n", g[0], p->size ); + asf->streams[stream_num].payload_ext_ct ++; + } } return 0;