diff options
author | voroshil <voroshil@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-11-24 07:28:05 +0000 |
---|---|---|
committer | voroshil <voroshil@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-11-24 07:28:05 +0000 |
commit | d0fa6cd8c83b91edf5ad516384d1575f77008416 (patch) | |
tree | d6722e7118766ded178247df16630ef7155b722d /stream | |
parent | fd10d437239195100b0f35c296023757ca1b52f7 (diff) | |
download | mpv-d0fa6cd8c83b91edf5ad516384d1575f77008416.tar.bz2 mpv-d0fa6cd8c83b91edf5ad516384d1575f77008416.tar.xz |
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
Diffstat (limited to 'stream')
-rw-r--r-- | stream/tvi_dshow.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/stream/tvi_dshow.c b/stream/tvi_dshow.c index ba684dd236..7f2a1a719e 100644 --- a/stream/tvi_dshow.c +++ b/stream/tvi_dshow.c @@ -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; |