mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +02:00
parse header chunk in a loop (don't depend on a fixed chunk ordering)
Originally committed as revision 10792 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
af704ee420
commit
f8cab062ca
@ -162,17 +162,16 @@ static int process_ea_header(AVFormatContext *s) {
|
|||||||
uint32_t blockid, size = 0;
|
uint32_t blockid, size = 0;
|
||||||
EaDemuxContext *ea = s->priv_data;
|
EaDemuxContext *ea = s->priv_data;
|
||||||
ByteIOContext *pb = &s->pb;
|
ByteIOContext *pb = &s->pb;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i=0; i<5 && (!ea->audio_codec || !ea->video_codec); i++) {
|
||||||
|
unsigned int startpos = url_ftell(pb);
|
||||||
|
|
||||||
blockid = get_le32(pb);
|
blockid = get_le32(pb);
|
||||||
if (blockid == MVhd_TAG) {
|
|
||||||
size = get_le32(pb);
|
size = get_le32(pb);
|
||||||
process_video_header_vp6(s);
|
|
||||||
url_fskip(pb, size-32);
|
switch (blockid) {
|
||||||
blockid = get_le32(pb);
|
case SCHl_TAG :
|
||||||
}
|
|
||||||
if (blockid != SCHl_TAG)
|
|
||||||
return 0;
|
|
||||||
size += get_le32(pb);
|
|
||||||
blockid = get_le32(pb);
|
blockid = get_le32(pb);
|
||||||
if (blockid == GSTR_TAG) {
|
if (blockid == GSTR_TAG) {
|
||||||
url_fskip(pb, 4);
|
url_fskip(pb, 4);
|
||||||
@ -182,9 +181,17 @@ static int process_ea_header(AVFormatContext *s) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
process_audio_header_elements(s);
|
process_audio_header_elements(s);
|
||||||
|
break;
|
||||||
|
|
||||||
/* skip to the start of the data */
|
case MVhd_TAG :
|
||||||
url_fseek(pb, size, SEEK_SET);
|
process_video_header_vp6(s);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
url_fseek(pb, startpos + size, SEEK_SET);
|
||||||
|
}
|
||||||
|
|
||||||
|
url_fseek(pb, 0, SEEK_SET);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user