factorize packet skip code

Originally committed as revision 15041 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Baptiste Coudurier 2008-08-29 22:07:01 +00:00
parent 6298eb810d
commit 3d9aecb0d7

View File

@ -327,15 +327,14 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
is_audio=0; is_audio=0;
flags = get_byte(s->pb); flags = get_byte(s->pb);
size--; size--;
if ((flags & 0xf0) == 0x50) { /* video info / command frame */ if ((flags & 0xf0) == 0x50) /* video info / command frame */
url_fskip(s->pb, size); goto skip;
continue;
}
} else { } else {
if (type == FLV_TAG_TYPE_META && size > 13+1+4) if (type == FLV_TAG_TYPE_META && size > 13+1+4)
flv_read_metabody(s, next); flv_read_metabody(s, next);
else /* skip packet */ else /* skip packet */
av_log(s, AV_LOG_ERROR, "skipping flv packet: type %d, size %d, flags %d\n", type, size, flags); av_log(s, AV_LOG_ERROR, "skipping flv packet: type %d, size %d, flags %d\n", type, size, flags);
skip:
url_fseek(s->pb, next, SEEK_SET); url_fseek(s->pb, next, SEEK_SET);
continue; continue;
} }