[MPlayer-cvslog] r25089 - trunk/stream/tvi_dshow.c
voroshil
subversion at mplayerhq.hu
Sun Nov 18 09:24:30 CET 2007
Author: voroshil
Date: Sun Nov 18 09:24:30 2007
New Revision: 25089
Log:
Ignore video formats which are supported by device
but not supported by dshow driver.
Modified:
trunk/stream/tvi_dshow.c
Modified: trunk/stream/tvi_dshow.c
==============================================================================
--- trunk/stream/tvi_dshow.c (original)
+++ trunk/stream/tvi_dshow.c Sun Nov 18 09:24:30 2007
@@ -2021,18 +2021,29 @@ static HRESULT get_available_formats_str
pBuf = (void **) malloc((count + 1) * sizeof(void *));
if (pBuf) {
+ int dst = 0;
memset(pBuf, 0, (count + 1) * sizeof(void *));
for (i = 0; i < count; i++) {
- pBuf[i] = malloc(size);
+ pBuf[dst] = malloc(size);
- if (!pBuf[i])
+ if (!pBuf[dst])
break;
hr = OLE_CALL_ARGS(pStreamConfig, GetStreamCaps, i,
- &(arpmt[i]), pBuf[i]);
+ &(arpmt[dst]), pBuf[dst]);
if (FAILED(hr))
break;
+ if(!memcmp(&(arpmt[dst]->majortype), &MEDIATYPE_Video, 16) && !subtype2imgfmt(&(arpmt[dst]->subtype)))
+ {
+ DisplayMediaType("Skipping unsupported video format", arpmt[dst]);
+ DeleteMediaType(arpmt[dst]);
+ free(pBuf[dst]);
+ arpmt[dst]=NULL;
+ pBuf[dst]=NULL;
+ continue;
+ }
+ dst++;
}
if (i == count) {
*parpmtMedia = arpmt;
More information about the MPlayer-cvslog
mailing list