1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-15 11:25:10 +00:00

Move requested format at top and shift all oters down

This method is better with recent negotiation code:
requested formats will be checked first.



git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25154 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
voroshil 2007-11-24 07:28:05 +00:00
parent fd10d43723
commit d0fa6cd8c8

View File

@ -3141,8 +3141,8 @@ static int control(priv_t * priv, int cmd, void *arg)
/* 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 cmd, void *arg)
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;