Mercurial > libavformat.hg
changeset 610:1ab7b989f475 libavformat
try to recover from errors instead of failing fataly
author | michael |
---|---|
date | Mon, 06 Dec 2004 20:03:42 +0000 |
parents | 2f0de265bc5e |
children | 8fcecf36e64c |
files | rm.c |
diffstat | 1 files changed, 8 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/rm.c Mon Dec 06 18:57:59 2004 +0000 +++ b/rm.c Mon Dec 06 20:03:42 2004 +0000 @@ -744,18 +744,21 @@ st = s->streams[0]; } else { redo: - if(rm->remaining_len){ + if (url_feof(pb)) + return AVERROR_IO; + if(rm->remaining_len > 0){ num= rm->current_stream; len= rm->remaining_len; timestamp = AV_NOPTS_VALUE; flags= 0; }else{ - if (rm->nb_packets == 0) - return AVERROR_IO; - get_be16(pb); + if(get_byte(pb)) + goto redo; + if(get_byte(pb)) + goto redo; len = get_be16(pb); if (len < 12) - return AVERROR_IO; + goto redo; num = get_be16(pb); timestamp = get_be32(pb); res= get_byte(pb); /* reserved */ @@ -763,7 +766,6 @@ // av_log(s, AV_LOG_DEBUG, "%d %d %X %d\n", num, timestamp, flags, res); - rm->nb_packets--; len -= 12; }