[MPlayer-cvslog] r25154 - trunk/stream/tvi_dshow.c

voroshil subversion at mplayerhq.hu
Sat Nov 24 08:28:06 CET 2007


Author: voroshil
Date: Sat Nov 24 08:28:05 2007
New Revision: 25154

Log:
Move requested format at top and shift all oters down
This method is better with recent negotiation code:
requested formats will be checked first.



Modified:
   trunk/stream/tvi_dshow.c

Modified: trunk/stream/tvi_dshow.c
==============================================================================
--- trunk/stream/tvi_dshow.c	(original)
+++ trunk/stream/tvi_dshow.c	Sat Nov 24 08:28:05 2007
@@ -3141,8 +3141,8 @@ static int control(priv_t * priv, int cm
 /* need rewrite */
     case TVI_CONTROL_VID_SET_FORMAT:
 	{
-	    int fcc, i;
-	    void* tmp;
+	    int fcc, i,j;
+	    void* tmp,*tmp2;
 	    int result = TVI_CONTROL_TRUE;
 
 	    if (priv->state)
@@ -3185,13 +3185,16 @@ static int control(priv_t * priv, int cm
 		result = TVI_CONTROL_FALSE;
 	    }
 
-	    tmp = priv->chains[0]->arpmt[0];
-	    priv->chains[0]->arpmt[0] = priv->chains[0]->arpmt[i];
-	    priv->chains[0]->arpmt[i] = tmp;
 
-	    tmp = priv->chains[0]->arStreamCaps[0];
-	    priv->chains[0]->arStreamCaps[0] = priv->chains[0]->arStreamCaps[i];
-	    priv->chains[0]->arStreamCaps[i] = tmp;
+            tmp=priv->chains[0]->arpmt[i];
+            tmp2=priv->chains[0]->arStreamCaps[i];
+            for(j=i; j>0; j--)
+            {
+                priv->chains[0]->arpmt[j] = priv->chains[0]->arpmt[j-1];
+                priv->chains[0]->arStreamCaps[j] = priv->chains[0]->arStreamCaps[j-1];
+            }
+            priv->chains[0]->arpmt[0] = tmp;
+            priv->chains[0]->arStreamCaps[0] = tmp2;
 
 	    priv->chains[0]->nFormatUsed = 0;
 



More information about the MPlayer-cvslog mailing list