[MPlayer-cvslog] r31310 - trunk/libvo/vo_yuv4mpeg.c

Reinhard Tartler siretart at tauware.de
Thu Jun 3 23:06:15 CEST 2010


On Do, Jun 03, 2010 at 21:16:20 (CEST), Reimar Döffinger wrote:

> On Thu, Jun 03, 2010 at 07:37:58PM +0200, siretart wrote:
>> Author: siretart
>> Date: Thu Jun  3 19:37:58 2010
>> New Revision: 31310
>> 
>> Log:
>> vo_yuv4mpeg: disable RGB support when compiling against a shared libswscale
>> 
>> This avoids using swscale internals when compiling against a shared libswscale.
>
> This kind of hack certainly isn't user-friendly at all.
> And this particular way is just plain broken, it will accept RGB and write
> it as YUV.
> If you don't understand the code (and/or can't be bothered to try first),
> at least send a patch for review first.

okay, my fault then. Actually trying is hard, since AFAIUI, it is
necessary for zoran and similar hardware (which i don't have), right?

>> Patch inspired by Uoti Urpala's work in his git branch:
>> http://repo.or.cz/w/mplayer.git/commitdiff/cd4e8dc1fa2863dcce62a44dd9ea105f9f9288f4
>
> Well, he at least did it right, though understand what the code does, then either
> figuring out and documenting a way to do the same with video filters or alternatively
> fixing it to work with the proper swscale API sure is a far better
> solution.

hm. here are the missing hunks:

Index: vo_yuv4mpeg.c
===================================================================
--- vo_yuv4mpeg.c	(revision 31310)
+++ vo_yuv4mpeg.c	(working copy)
@@ -149,6 +149,7 @@
 		return -1;
 	}
 
+#ifdef CONFIG_LIBSWSCALE_A
 	if(using_format != IMGFMT_YV12)
 	{
 		sws_rgb2rgb_init(get_sws_cpuflags());
@@ -160,6 +161,7 @@
 			return -1;
 		}
 	}
+#endif
 
 	write_bytes = image_width * image_height * 3 / 2;
 	image = malloc(write_bytes);
@@ -464,9 +466,11 @@
 		{
 			case IMGFMT_YV12:
 				return VFCAP_CSP_SUPPORTED|VFCAP_OSD|VFCAP_ACCEPT_STRIDE;
+#ifdef CONFIG_LIBSWSCALE_A
 			case IMGFMT_BGR|24:
 			case IMGFMT_RGB|24:
 				return VFCAP_CSP_SUPPORTED|VFCAP_CSP_SUPPORTED_BY_HW|VFCAP_OSD|VFCAP_ACCEPT_STRIDE;
+#endif
 		}
 	}
 	else
@@ -476,9 +480,11 @@
 		{
 			case IMGFMT_YV12:
 				return VFCAP_CSP_SUPPORTED|VFCAP_CSP_SUPPORTED_BY_HW|VFCAP_OSD|VFCAP_ACCEPT_STRIDE;
+#ifdef CONFIG_LIBSWSCALE_A
     		case IMGFMT_BGR|24:
     		case IMGFMT_RGB|24:
         		return VFCAP_CSP_SUPPORTED|VFCAP_OSD|VFCAP_ACCEPT_STRIDE;
+#endif
     	}
 	}
 	return 0;


okay to apply?

otherwise, I see that you are about to remove most of the strange code here anyways

-- 
Gruesse/greetings,
Reinhard Tartler, KeyID 945348A4



More information about the MPlayer-cvslog mailing list