diff options
author | Zdenek Kabelac <kabi@informatics.muni.cz> | 2002-11-05 17:16:41 +0000 |
---|---|---|
committer | Zdenek Kabelac <kabi@informatics.muni.cz> | 2002-11-05 17:16:41 +0000 |
commit | acbe6cfa47c14da8671c88c61b6677efe04d0d57 (patch) | |
tree | 795e2407002aad27b454a0e528ccc0fe685fdad1 /libav/asf.c | |
parent | ff29712a3d4aaf7cdfe8efe8904eaa564e4f34ae (diff) | |
download | ffmpeg-acbe6cfa47c14da8671c88c61b6677efe04d0d57.tar.gz |
* calculating with the full packet size
Originally committed as revision 1170 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libav/asf.c')
-rw-r--r-- | libav/asf.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libav/asf.c b/libav/asf.c index a4a6054407..de34e99428 100644 --- a/libav/asf.c +++ b/libav/asf.c @@ -1001,6 +1001,8 @@ static int asf_get_packet(AVFormatContext *s) asf->packet_segsizetype = 0x80; } asf->packet_size_left = packet_length - padsize - rsize; + if (packet_length < asf->hdr.min_pktsize) + padsize += asf->hdr.min_pktsize - packet_length; asf->packet_padsize = padsize; #ifdef DEBUG printf("packet: size=%d padsize=%d left=%d\n", asf->packet_size, asf->packet_padsize, asf->packet_size_left); @@ -1046,9 +1048,11 @@ static int asf_read_packet(AVFormatContext *s, AVPacket *pkt) // it should be always at least 8 bytes - FIXME validate asf->packet_obj_size = get_le32(pb); asf->packet_frag_timestamp = get_le32(pb); // timestamp + if (asf->packet_replic_size > 8) + url_fskip(pb, asf->packet_replic_size - 8); rsize += asf->packet_replic_size; // FIXME - check validity } else { - // multipacket - frag_offset is beginig timestamp + // multipacket - frag_offset is begining timestamp asf->packet_time_start = asf->packet_frag_offset; asf->packet_frag_offset = 0; asf->packet_frag_timestamp = asf->packet_timestamp; @@ -1060,6 +1064,7 @@ static int asf_read_packet(AVFormatContext *s, AVPacket *pkt) } if (asf->packet_flags & 0x01) { DO_2BITS(asf->packet_segsizetype >> 6, asf->packet_frag_size, 0); // 0 is illegal +#undef DO_2BITS //printf("Fragsize %d\n", asf->packet_frag_size); } else { asf->packet_frag_size = asf->packet_size_left - rsize; @@ -1072,7 +1077,6 @@ static int asf_read_packet(AVFormatContext *s, AVPacket *pkt) continue; } } -#undef DO_2BITS asf->packet_size_left -= rsize; //printf("___objsize____ %d %d rs:%d\n", asf->packet_obj_size, asf->packet_frag_offset, rsize); |