aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwiso <wiso@svn>2010-04-21 16:59:57 +0000
committerwiso <wiso@svn>2010-04-21 16:59:57 +0000
commite046c29fc050a307d70d2957161ed2d02c539175 (patch)
treed3f7bfcfe5a548b382454be1e641d1788728d90e
parent8e1c0e8b5a0a6127045936e752ad273faf3b39cd (diff)
[WIN32] vgmstream: fixed bug when using our vfs
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@29416 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
-rw-r--r--xbmc/cores/paplayer/vgmstream/src/streamfile.c8
-rw-r--r--xbmc/cores/paplayer/vgmstream/win32/win32.vcproj2
2 files changed, 8 insertions, 2 deletions
diff --git a/xbmc/cores/paplayer/vgmstream/src/streamfile.c b/xbmc/cores/paplayer/vgmstream/src/streamfile.c
index dc174dcd86..e341ef34ec 100644
--- a/xbmc/cores/paplayer/vgmstream/src/streamfile.c
+++ b/xbmc/cores/paplayer/vgmstream/src/streamfile.c
@@ -4,6 +4,12 @@
#include "streamfile.h"
#include "util.h"
+#ifdef _WIN32
+#define IS_VALID_STREAM(stream) (stream != NULL && (stream->_ptr != NULL))
+#else
+#define IS_VALID_STREAM(stream) true
+#endif
+
typedef struct {
STREAMFILE sf;
FILE * infile;
@@ -144,7 +150,7 @@ static STREAMFILE *open_stdio(STDIOSTREAMFILE *streamFile,const char * const fil
return NULL;
// if same name, duplicate the file pointer we already have open
if (!strcmp(streamFile->name,filename)) {
- if (((newfd = dup(fileno(streamFile->infile))) >= 0) &&
+ if (IS_VALID_STREAM(streamFile->infile) && ((newfd = dup(fileno(streamFile->infile))) >= 0) &&
(newfile = fdopen( newfd, "rb" )))
{
newstreamFile = open_stdio_streamfile_buffer_by_FILE(newfile,filename,buffersize);
diff --git a/xbmc/cores/paplayer/vgmstream/win32/win32.vcproj b/xbmc/cores/paplayer/vgmstream/win32/win32.vcproj
index 60e1b22870..54636857a2 100644
--- a/xbmc/cores/paplayer/vgmstream/win32/win32.vcproj
+++ b/xbmc/cores/paplayer/vgmstream/win32/win32.vcproj
@@ -46,7 +46,7 @@
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;WIN32_EXPORTS;_CRT_SECURE_NO_WARNINGS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
- RuntimeLibrary="1"
+ RuntimeLibrary="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"