# HG changeset patch # User michael # Date 1102363422 0 # Node ID 1ab7b989f475fe9687c4b2a5bb5d41dbf177f463 # Parent 2f0de265bc5eb660ef39275b10010a4d2834e04f try to recover from errors instead of failing fataly diff -r 2f0de265bc5e -r 1ab7b989f475 rm.c --- 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; }