Commit af5e8230 authored by bcoudurier's avatar bcoudurier

simplify size handling code

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@15040 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 3c6714cd
...@@ -322,11 +322,13 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -322,11 +322,13 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
if (type == FLV_TAG_TYPE_AUDIO) { if (type == FLV_TAG_TYPE_AUDIO) {
is_audio=1; is_audio=1;
flags = get_byte(s->pb); flags = get_byte(s->pb);
size--;
} else if (type == FLV_TAG_TYPE_VIDEO) { } else if (type == FLV_TAG_TYPE_VIDEO) {
is_audio=0; is_audio=0;
flags = get_byte(s->pb); flags = get_byte(s->pb);
size--;
if ((flags & 0xf0) == 0x50) { /* video info / command frame */ if ((flags & 0xf0) == 0x50) { /* video info / command frame */
url_fskip(s->pb, size - 1); url_fskip(s->pb, size);
continue; continue;
} }
} else { } else {
...@@ -400,13 +402,13 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -400,13 +402,13 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
get_be24(s->pb); get_be24(s->pb);
} }
if (type == 0) { if (type == 0) {
if ((ret = flv_get_extradata(s, st, size - 1)) < 0) if ((ret = flv_get_extradata(s, st, size)) < 0)
return ret; return ret;
goto retry; goto retry;
} }
} }
ret= av_get_packet(s->pb, pkt, size - 1); ret= av_get_packet(s->pb, pkt, size);
if (ret <= 0) { if (ret <= 0) {
return AVERROR(EIO); return AVERROR(EIO);
} }
......
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