aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2008-08-29 22:03:18 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2008-08-29 22:03:18 +0000
commit6298eb810de8364bbbd470abfb321a0416964b1d (patch)
tree440f981c1e3db6c49a4c5a1caa2abb477a6ae6ed
parent53440c621bb242478cf5a72703b64b68e253c504 (diff)
downloadffmpeg-6298eb810de8364bbbd470abfb321a0416964b1d.tar.gz
simplify size handling code
Originally committed as revision 15040 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/flvdec.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 309aacce45..1fc7146ca0 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -322,11 +322,13 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
if (type == FLV_TAG_TYPE_AUDIO) {
is_audio=1;
flags = get_byte(s->pb);
+ size--;
} else if (type == FLV_TAG_TYPE_VIDEO) {
is_audio=0;
flags = get_byte(s->pb);
+ size--;
if ((flags & 0xf0) == 0x50) { /* video info / command frame */
- url_fskip(s->pb, size - 1);
+ url_fskip(s->pb, size);
continue;
}
} else {
@@ -400,13 +402,13 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
get_be24(s->pb);
}
if (type == 0) {
- if ((ret = flv_get_extradata(s, st, size - 1)) < 0)
+ if ((ret = flv_get_extradata(s, st, size)) < 0)
return ret;
goto retry;
}
}
- ret= av_get_packet(s->pb, pkt, size - 1);
+ ret= av_get_packet(s->pb, pkt, size);
if (ret <= 0) {
return AVERROR(EIO);
}