[FFmpeg-devel] [PATCH] non-interleaved AVI read packet fix

Michael Niedermayer michaelni
Wed Sep 2 18:44:40 CEST 2009


On Wed, Sep 02, 2009 at 09:22:42AM +0300, Maksym Veremeyenko wrote:
> Hi,
>
> I faced a problem with decoding of non-interleaved AVI files (described in 
> bug-tracker issue #1343).
>
> The problem happens if audio stream is shorter then video. So best stream 
> selecting code select audio stream that is finished. As result code branch 
> to resync part and resulting video file has duplicated multiple times 
> original last frame.
>
> As solution proposed patch, that check if stream is not "End Of" to exclude 
> that one from best stream selecting loop.
>
> -- 
> ________________________________________
> Maksym Veremeyenko
>

>  avidec.c |    6 ++++++
>  1 file changed, 6 insertions(+)
> 0d8d919f05a37634591c4b04bf29f0db95fef958  avidec_non_interleaved_read_packet_fix_v3.patch
> Index: libavformat/avidec.c
> ===================================================================
> --- libavformat/avidec.c	(revision 19698)
> +++ libavformat/avidec.c	(working copy)
> @@ -682,6 +682,12 @@
>  
>              if(ast->sample_size)
>                  ts /= ast->sample_size;
> +
> +            /* skip finished stream */
> +            if(!ast->remaining)
> +                if(av_index_search_timestamp(st, ts, AVSEEK_FLAG_ANY) < 0)
> +                    continue;
> +

you dont need a av_index_search_timestamp() call to test the last index entry

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.
-------------- 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/20090902/eb69053e/attachment.pgp>



More information about the ffmpeg-devel mailing list