Commit 5af1caec authored by michael's avatar michael

try to recover from errors instead of failing fataly


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@3735 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 66b75985
...@@ -744,18 +744,21 @@ static int rm_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -744,18 +744,21 @@ static int rm_read_packet(AVFormatContext *s, AVPacket *pkt)
st = s->streams[0]; st = s->streams[0];
} else { } else {
redo: redo:
if(rm->remaining_len){ if (url_feof(pb))
return AVERROR_IO;
if(rm->remaining_len > 0){
num= rm->current_stream; num= rm->current_stream;
len= rm->remaining_len; len= rm->remaining_len;
timestamp = AV_NOPTS_VALUE; timestamp = AV_NOPTS_VALUE;
flags= 0; flags= 0;
}else{ }else{
if (rm->nb_packets == 0) if(get_byte(pb))
return AVERROR_IO; goto redo;
get_be16(pb); if(get_byte(pb))
goto redo;
len = get_be16(pb); len = get_be16(pb);
if (len < 12) if (len < 12)
return AVERROR_IO; goto redo;
num = get_be16(pb); num = get_be16(pb);
timestamp = get_be32(pb); timestamp = get_be32(pb);
res= get_byte(pb); /* reserved */ res= get_byte(pb); /* reserved */
...@@ -763,7 +766,6 @@ static int rm_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -763,7 +766,6 @@ static int rm_read_packet(AVFormatContext *s, AVPacket *pkt)
// av_log(s, AV_LOG_DEBUG, "%d %d %X %d\n", num, timestamp, flags, res); // av_log(s, AV_LOG_DEBUG, "%d %d %X %d\n", num, timestamp, flags, res);
rm->nb_packets--;
len -= 12; len -= 12;
} }
......
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