summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2005-07-27 07:31:40 +0000
committerMichael Niedermayer <michaelni@gmx.at>2005-07-27 07:31:40 +0000
commit47627aec613106be39a462b9485c51c548da147e (patch)
tree1522f1d380d142fa4b0f0a4204957ebe30f8f638
parent51fd379af22f31a5ee11ac085d41e0d91d13729e (diff)
round pointer up to next packet_size multiple
Originally committed as revision 4479 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/asf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/asf.c b/libavformat/asf.c
index 12d2a5ed32..19265ac6a6 100644
--- a/libavformat/asf.c
+++ b/libavformat/asf.c
@@ -422,8 +422,6 @@ static int asf_get_packet(AVFormatContext *s)
int rsize = 9;
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);
c = get_byte(pb);
@@ -485,6 +483,8 @@ static int asf_read_packet(AVFormatContext *s, AVPacket *pkt)
//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));
+ 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 */
url_fskip(pb, ret);
asf->packet_pos= url_ftell(&s->pb);