[FFmpeg-devel] [PATCH] recover from truncated aiff

Michael Niedermayer michaelni
Wed Nov 26 21:43:25 CET 2008


On Wed, Nov 26, 2008 at 01:50:55PM +0200, Maksym Veremeyenko wrote:
> Michael Niedermayer ???????(??):
> > On Wed, Nov 26, 2008 at 01:21:59PM +0200, Maksym Veremeyenko wrote:
> [...]
[...]
> >> What method is preferable to fixing issue with truncated file contains 
> >> broken sample? Fixing pcm.c?
> > 
> > yes
> 
> Is that way:
> 
> Index: libavcodec/pcm.c
> ===================================================================
> --- libavcodec/pcm.c    (revision 15899)
> +++ libavcodec/pcm.c    (working copy)
> @@ -358,9 +358,9 @@
> 
>       n = avctx->channels * sample_size;
> 
> -    if(n && buf_size % n){
> -        av_log(avctx, AV_LOG_ERROR, "invalid PCM packet\n");
> -        return -1;
> +    if(n > 1 && buf_size % n){
> +        buf_size -= buf_size % n;
> +        av_log(avctx, AV_LOG_WARNING, "invalid PCM packet\n");
>       }
> 
>       buf_size= FFMIN(buf_size, *data_size/2);
> 
> is correct?

i think yes

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

Frequently ignored awnser#1 FFmpeg bugs should be sent to our bugtracker. User
questions about the command line tools should be sent to the ffmpeg-user ML.
And questions about how to use libav* should be sent to the libav-user ML.
-------------- 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/20081126/9f9bc15b/attachment.pgp>



More information about the ffmpeg-devel mailing list