[FFmpeg-devel] [PATCH] fix wc3 xan decoder
Sat Mar 1 03:17:44 CET 2008
On Fri, Feb 29, 2008 at 05:50:10PM -0800, Mike Melanson wrote:
> Michael Niedermayer wrote:
> > On Fri, Feb 29, 2008 at 05:40:19PM -0800, Mike Melanson wrote:
> >> Hi,
> >> This patch fixes the WC3 Xan decoder by correcting the frame accounting.
> >> Previously, it would only decode the first frame and then complain about
> >> not being able to get another frame.
> >> (Kostya: I haven't forgotten about your WC4 Xan patch. One day. :) )
> >> --
> >> -Mike Melanson
> >> Index: libavcodec/xan.c
> >> ===================================================================
> >> --- libavcodec/xan.c (revision 12279)
> >> +++ libavcodec/xan.c (working copy)
> >> @@ -435,12 +435,13 @@
> >> if (s->last_frame.data)
> >> avctx->release_buffer(avctx, &s->last_frame);
> >> + *data_size = sizeof(AVFrame);
> >> + *(AVFrame*)data = s->current_frame;
> >> +
> >> /* shuffle frames */
> >> s->last_frame = s->current_frame;
> > Copying the frames around like that is a recipe for problems
> > you should shuffle pointers not memcpy structs.
> I'm a bit confused. Where am I doing struct memcpy() operations in the
not in the patch, the patch works around it by setting data to zero
dont copy it and it will be zero (from release_buffer)
That is i think your patch is a hack not a fix :)
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
It is not what we do, but why we do it that matters.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: Digital signature
More information about the ffmpeg-devel