summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorvoroshil <voroshil@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-11-18 08:24:30 +0000
committervoroshil <voroshil@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-11-18 08:24:30 +0000
commitb7ad0227fb0e5afdc5dff68a862426eb8f927a8d (patch)
treee4b29caaa76203e3f943257db456d22892c91832 /stream
parent78a0719de90a2eb977be4ffc63e40d430c08afbd (diff)
downloadmpv-b7ad0227fb0e5afdc5dff68a862426eb8f927a8d.tar.bz2
mpv-b7ad0227fb0e5afdc5dff68a862426eb8f927a8d.tar.xz
Ignore video formats which are supported by device
but not supported by dshow driver. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25089 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream')
-rw-r--r--stream/tvi_dshow.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/stream/tvi_dshow.c b/stream/tvi_dshow.c
index 6e30258920..ab721ef6ab 100644
--- a/stream/tvi_dshow.c
+++ b/stream/tvi_dshow.c
@@ -2021,18 +2021,29 @@ static HRESULT get_available_formats_stream(IAMStreamConfig *
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;