[FFmpeg-devel] [PATCH 06/28] fixed: #5585 Media file gets played twice. we assume avi EOF when we can't find the next streams index entry for non interleaved files.

Michael Niedermayer michaelni
Thu Jul 1 01:22:15 CEST 2010


On Wed, Jun 30, 2010 at 10:09:34AM +0100, Mans Rullgard wrote:
> From: Cory Fields <theuni-nospam- at xbmc.org>
> 
> ---
>  libavformat/avidec.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/libavformat/avidec.c b/libavformat/avidec.c
> index 730b3b7..befaa79 100644
> --- a/libavformat/avidec.c
> +++ b/libavformat/avidec.c
> @@ -738,7 +738,8 @@ static int avi_read_packet(AVFormatContext *s, AVPacket *pkt)
>          if(i>=0){
>              int64_t pos= best_st->index_entries[i].pos;
>              pos += best_ast->packet_size - best_ast->remaining;
> -            url_fseek(s->pb, pos + 8, SEEK_SET);
> +            if(url_fseek(s->pb, pos + 8, SEEK_SET) < 0)
> +              return AVERROR_EOF;

changing every error code to EOf feels a bit odd


>  //        av_log(s, AV_LOG_DEBUG, "pos=%"PRId64"\n", pos);
>  
>              assert(best_ast->remaining <= best_ast->packet_size);
> @@ -748,6 +749,8 @@ static int avi_read_packet(AVFormatContext *s, AVPacket *pkt)
>                  best_ast->packet_size=
>                  best_ast->remaining= best_st->index_entries[i].size;
>          }
> +        else
> +          return AVERROR_EOF;

do you have a sample that needs this?

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Observe your enemies, for they first find out your faults. -- Antisthenes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100701/4c6c2885/attachment.pgp>



More information about the ffmpeg-devel mailing list