[MPlayer-dev-eng] [PATCH] Ignore 0-len packets for muxer prebuffering

Tobias Diedrich ranma at tdiedrich.de
Sun Jun 26 16:59:25 CEST 2011


Ivan Kalvachev wrote:
> The functional part of the patch is OK.
> I've lost few hours yesterday to debug same problem.
> 
> In short, if for some reason mencoder tries to duplicate frame from
> the start, it will do this before the encoder is config()-ured, thus a
> lot of critical information is not set. avformat_write_header() errors
> out (aka "dimensions not set"), but mencoder doesn't handle the error
> code, goes on with writing packets and causes a crash.
> 
> Tobias, I see you in authors file. Will you be able to commit this on your own?

Committed.

> 
> /* If mencoder inserts "repeat last frame" chunks with len == 0
>  * before the encoder is configured and first real frame is output
>  * then muxer won't find needed info for writing initial header.
>  * Wait until the first real frame is seen. */

I slightly changed the comment to:

/* If mencoder inserts "repeat last frame" chunks with len == 0
 * before the encoder is configured and first real frame is output
 * or a broken file starts a stream with such frames, then muxer
 * won't find needed info for writing initial header.
 * Wait until the first real frame is seen. */

Since at least avi files can be broken in this way (like the one I
generated) and I could imagine some video editing tools to generated
files like this (I just hacked the avi muxer to generate it).


-- 
Tobias						PGP: http://8ef7ddba.uguu.de


More information about the MPlayer-dev-eng mailing list