[FFmpeg-devel] [PATCH 2/2] avformat/mov: increase current_sample after reading, to avoid discontinuous sample

Michael Niedermayer michaelni at gmx.at
Tue Jun 2 01:26:18 CEST 2015


On Thu, May 21, 2015 at 12:31:21PM +0800, Zhang Rui wrote:
> Discontinuous sample could cause corrupted image if next video frame
> is non-key frame.
> 
> Mostly, avio_seek() fails on I/O error for http/ftp/... stream.
> In my opinion, retry is better than skip.
> 
> > -    /* must be done just before reading, to avoid infinite loop on sample */
> > -    sc->current_sample++;
> 
> This line was first introduced in 2006 by commit b72708f8f.
> I'm not sure if it worth an option to enable the new behaviour,
> and keep the default behaviour as before.

if its specific to avio_seek() should current_sample-- be done in
its error case instead ?
maybe with a retry count to limit retries in case the next sample
can be read but the current always fails

Iam not sure i fully understand the bug this fixes,
how can it be reproduced ?

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

Dictatorship naturally arises out of democracy, and the most aggravated
form of tyranny and slavery out of the most extreme liberty. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150602/9e07c8fa/attachment.asc>


More information about the ffmpeg-devel mailing list