summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2007-03-30 16:20:40 +0000
committerMichael Niedermayer <michaelni@gmx.at>2007-03-30 16:20:40 +0000
commit0c0d17f3ce9dc5bbf3a7c3b85f3fe95e3dbbb482 (patch)
tree0fb7ffc21561302bd2a127388d8457beb5bcf0e3 /libavformat
parent6cc65ab3c68d5db6245473fab13f83d6a5194f41 (diff)
downloadffmpeg-0c0d17f3ce9dc5bbf3a7c3b85f3fe95e3dbbb482.tar.gz
fix demuxing of IMAG0002.ASF
Originally committed as revision 8558 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/asf.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/libavformat/asf.c b/libavformat/asf.c
index a9531efe7c..498f6e79ea 100644
--- a/libavformat/asf.c
+++ b/libavformat/asf.c
@@ -541,7 +541,7 @@ static int asf_get_packet(AVFormatContext *s)
ASFContext *asf = s->priv_data;
ByteIOContext *pb = &s->pb;
uint32_t packet_length, padsize;
- int rsize = 9;
+ int rsize = 8;
int c, d, e, off;
off= (url_ftell(&s->pb) - s->data_offset) % asf->packet_size + 3;
@@ -558,23 +558,21 @@ static int asf_get_packet(AVFormatContext *s)
if (!url_feof(pb))
av_log(s, AV_LOG_ERROR, "ff asf bad header %x at:%"PRId64"\n", c, url_ftell(pb));
}
- if ((c & 0x0f) == 2) { // always true for now
+ if ((c & 0x8f) == 0x82) {
if (d || e) {
if (!url_feof(pb))
av_log(s, AV_LOG_ERROR, "ff asf bad non zero\n");
return -1;
}
+ c= get_byte(pb);
d= get_byte(pb);
- e= get_byte(pb);
- rsize+=2;
-/* }else{
- if (!url_feof(pb))
- printf("ff asf bad header %x at:%"PRId64"\n", c, url_ftell(pb));
- return AVERROR_IO;*/
+ rsize+=3;
+ }else{
+ url_fseek(pb, -1, SEEK_CUR); //FIXME
}
- asf->packet_flags = d;
- asf->packet_property = e;
+ asf->packet_flags = c;
+ asf->packet_property = d;
DO_2BITS(asf->packet_flags >> 5, packet_length, asf->packet_size);
DO_2BITS(asf->packet_flags >> 1, padsize, 0); // sequence ignored