|
|
@ -785,7 +785,7 @@ static int asf_read_header(AVFormatContext *s) |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} else if (!ff_guidcmp(&g, &ff_asf_marker_header)) { |
|
|
|
} else if (!ff_guidcmp(&g, &ff_asf_marker_header)) { |
|
|
|
asf_read_marker(s, gsize); |
|
|
|
asf_read_marker(s, gsize); |
|
|
|
} else if (url_feof(pb)) { |
|
|
|
} else if (avio_feof(pb)) { |
|
|
|
return AVERROR_EOF; |
|
|
|
return AVERROR_EOF; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if (!s->keylen) { |
|
|
|
if (!s->keylen) { |
|
|
@ -822,7 +822,7 @@ static int asf_read_header(AVFormatContext *s) |
|
|
|
avio_rl64(pb); |
|
|
|
avio_rl64(pb); |
|
|
|
avio_r8(pb); |
|
|
|
avio_r8(pb); |
|
|
|
avio_r8(pb); |
|
|
|
avio_r8(pb); |
|
|
|
if (url_feof(pb)) |
|
|
|
if (avio_feof(pb)) |
|
|
|
return AVERROR_EOF; |
|
|
|
return AVERROR_EOF; |
|
|
|
asf->data_offset = avio_tell(pb); |
|
|
|
asf->data_offset = avio_tell(pb); |
|
|
|
asf->packet_size_left = 0; |
|
|
|
asf->packet_size_left = 0; |
|
|
@ -922,20 +922,20 @@ static int asf_get_packet(AVFormatContext *s, AVIOContext *pb) |
|
|
|
* the stream. */ |
|
|
|
* the stream. */ |
|
|
|
if (pb->error == AVERROR(EAGAIN)) |
|
|
|
if (pb->error == AVERROR(EAGAIN)) |
|
|
|
return AVERROR(EAGAIN); |
|
|
|
return AVERROR(EAGAIN); |
|
|
|
if (!url_feof(pb)) |
|
|
|
if (!avio_feof(pb)) |
|
|
|
av_log(s, AV_LOG_ERROR, |
|
|
|
av_log(s, AV_LOG_ERROR, |
|
|
|
"ff asf bad header %x at:%"PRId64"\n", c, avio_tell(pb)); |
|
|
|
"ff asf bad header %x at:%"PRId64"\n", c, avio_tell(pb)); |
|
|
|
} |
|
|
|
} |
|
|
|
if ((c & 0x8f) == 0x82) { |
|
|
|
if ((c & 0x8f) == 0x82) { |
|
|
|
if (d || e) { |
|
|
|
if (d || e) { |
|
|
|
if (!url_feof(pb)) |
|
|
|
if (!avio_feof(pb)) |
|
|
|
av_log(s, AV_LOG_ERROR, "ff asf bad non zero\n"); |
|
|
|
av_log(s, AV_LOG_ERROR, "ff asf bad non zero\n"); |
|
|
|
return AVERROR_INVALIDDATA; |
|
|
|
return AVERROR_INVALIDDATA; |
|
|
|
} |
|
|
|
} |
|
|
|
c = avio_r8(pb); |
|
|
|
c = avio_r8(pb); |
|
|
|
d = avio_r8(pb); |
|
|
|
d = avio_r8(pb); |
|
|
|
rsize += 3; |
|
|
|
rsize += 3; |
|
|
|
} else if(!url_feof(pb)) { |
|
|
|
} else if(!avio_feof(pb)) { |
|
|
|
avio_seek(pb, -1, SEEK_CUR); // FIXME
|
|
|
|
avio_seek(pb, -1, SEEK_CUR); // FIXME
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1126,7 +1126,7 @@ static int asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt) |
|
|
|
ASFStream *asf_st = 0; |
|
|
|
ASFStream *asf_st = 0; |
|
|
|
for (;;) { |
|
|
|
for (;;) { |
|
|
|
int ret; |
|
|
|
int ret; |
|
|
|
if (url_feof(pb)) |
|
|
|
if (avio_feof(pb)) |
|
|
|
return AVERROR_EOF; |
|
|
|
return AVERROR_EOF; |
|
|
|
if (asf->packet_size_left < FRAME_HEADER_SIZE || |
|
|
|
if (asf->packet_size_left < FRAME_HEADER_SIZE || |
|
|
|
asf->packet_segments < 1 && asf->packet_time_start == 0) { |
|
|
|
asf->packet_segments < 1 && asf->packet_time_start == 0) { |
|
|
@ -1494,7 +1494,7 @@ static int asf_build_simple_index(AVFormatContext *s, int stream_index) |
|
|
|
* skip them until the simple index object is reached */ |
|
|
|
* skip them until the simple index object is reached */ |
|
|
|
while (ff_guidcmp(&g, &ff_asf_simple_index_header)) { |
|
|
|
while (ff_guidcmp(&g, &ff_asf_simple_index_header)) { |
|
|
|
int64_t gsize = avio_rl64(s->pb); |
|
|
|
int64_t gsize = avio_rl64(s->pb); |
|
|
|
if (gsize < 24 || url_feof(s->pb)) { |
|
|
|
if (gsize < 24 || avio_feof(s->pb)) { |
|
|
|
goto end; |
|
|
|
goto end; |
|
|
|
} |
|
|
|
} |
|
|
|
avio_skip(s->pb, gsize - 24); |
|
|
|
avio_skip(s->pb, gsize - 24); |
|
|
@ -1532,7 +1532,7 @@ static int asf_build_simple_index(AVFormatContext *s, int stream_index) |
|
|
|
asf->index_read = ict > 1; |
|
|
|
asf->index_read = ict > 1; |
|
|
|
} |
|
|
|
} |
|
|
|
end: |
|
|
|
end: |
|
|
|
// if (url_feof(s->pb)) {
|
|
|
|
// if (avio_feof(s->pb)) {
|
|
|
|
// ret = 0;
|
|
|
|
// ret = 0;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
avio_seek(s->pb, current_pos, SEEK_SET); |
|
|
|
avio_seek(s->pb, current_pos, SEEK_SET); |
|
|
|