Commit d5da9221 authored by michael's avatar michael

round pointer up to next packet_size multiple


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@4479 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent a42a7428
...@@ -422,8 +422,6 @@ static int asf_get_packet(AVFormatContext *s) ...@@ -422,8 +422,6 @@ static int asf_get_packet(AVFormatContext *s)
int rsize = 9; int rsize = 9;
int c; int c;
if((url_ftell(&s->pb) - s->data_offset) % asf->packet_size)
return -1;
assert((url_ftell(&s->pb) - s->data_offset) % asf->packet_size == 0); assert((url_ftell(&s->pb) - s->data_offset) % asf->packet_size == 0);
c = get_byte(pb); c = get_byte(pb);
...@@ -485,6 +483,8 @@ static int asf_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -485,6 +483,8 @@ static int asf_read_packet(AVFormatContext *s, AVPacket *pkt)
//asf->packet_size_left <= asf->packet_padsize) { //asf->packet_size_left <= asf->packet_padsize) {
int ret = asf->packet_size_left + asf->packet_padsize; int ret = asf->packet_size_left + asf->packet_padsize;
//printf("PacketLeftSize:%d Pad:%d Pos:%Ld\n", asf->packet_size_left, asf->packet_padsize, url_ftell(pb)); //printf("PacketLeftSize:%d Pad:%d Pos:%Ld\n", asf->packet_size_left, asf->packet_padsize, url_ftell(pb));
if((url_ftell(&s->pb) + ret - s->data_offset) % asf->packet_size)
ret += asf->packet_size - ((url_ftell(&s->pb) + ret - s->data_offset) % asf->packet_size);
/* fail safe */ /* fail safe */
url_fskip(pb, ret); url_fskip(pb, ret);
asf->packet_pos= url_ftell(&s->pb); asf->packet_pos= url_ftell(&s->pb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment