[FFmpeg-devel] [PATCH] Fix return value for sws_setColorspaceDetails()

Michael Niedermayer michaelni
Fri Apr 17 14:08:09 CEST 2009


On Fri, Apr 17, 2009 at 12:11:43AM +0200, Stefano Sabatini wrote:
> On date Thursday 2009-04-16 20:21:31 +0200, Michael Niedermayer encoded:
> > On Thu, Apr 16, 2009 at 06:05:29PM +0200, Stefano Sabatini wrote:
> > > On date Tuesday 2009-04-14 11:57:14 +0200, Stefano Sabatini encoded:
> > > > Hi,
> > > > I'm still in the process of figuring out how the whole thing works,
> > > > but the fix looks obvious.
> > > > 
> > > > Regards.
> > > > -- 
> > > > FFmpeg = Fostering & Friendly Mind-dumbing Purposeless Ecumenical Geisha
> > > 
> > > > Index: ffmpeg/libswscale/swscale.c
> > > > ===================================================================
> > > > --- ffmpeg.orig/libswscale/swscale.c	2009-04-14 11:54:53.000000000 +0200
> > > > +++ ffmpeg/libswscale/swscale.c	2009-04-14 11:54:57.000000000 +0200
> > > > @@ -2299,7 +2299,7 @@
> > > >      c->saturation= saturation;
> > > >      c->srcRange  = srcRange;
> > > >      c->dstRange  = dstRange;
> > > > -    if (isYUV(c->dstFormat) || isGray(c->dstFormat)) return 0;
> > > > +    if (isYUV(c->dstFormat) || isGray(c->dstFormat)) return -1;
> > > >  
> > > >      c->uOffset=   0x0400040004000400LL;
> > > >      c->vOffset=   0x0400040004000400LL;
> > > 
> > > Ping?
> > 
> > what about fixing the case instead of failing?
> 
> I have no time for a full fix now but maybe later (uh what about after
> libavfilter integration ;-)), also if you have a plan for fixing it I
> as well as others I think would be interested to hear it, as I already
> said I'm quite naive about the lsws internals.

in the remaining cases, if ths source is not yuv, the stuff can be merged
into the RGB->YUV coefficients, else contrast and saturation can ba merged
into the scaling filters and the rest needs an explicit loop added.


> 
> So I suggest to immediately apply the patch, at least it fixes the
> function behavior.

well, iam not happy about it but if you dont want to fix it i guess
you are right that it at least should fail clearly

[...]
-- 
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/20090417/01afb960/attachment.pgp>



More information about the ffmpeg-devel mailing list