summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
Diffstat (limited to 'stream')
-rw-r--r--stream/stream_file.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/stream/stream_file.c b/stream/stream_file.c
index e9bb3eb03a..28f8f975ce 100644
--- a/stream/stream_file.c
+++ b/stream/stream_file.c
@@ -173,6 +173,15 @@ static int open_f(stream_t *stream,int mode, void* opts, int* file_format) {
m_struct_free(&stream_opts,opts);
return STREAM_ERROR;
}
+#ifndef __MINGW32__
+ struct stat st;
+ if (fstat(f, &st) == 0 && S_ISDIR(st.st_mode)) {
+ mp_tmsg(MSGT_OPEN,MSGL_ERR,"File is a directory: '%s'\n",filename);
+ close(f);
+ m_struct_free(&stream_opts,opts);
+ return STREAM_ERROR;
+ }
+#endif
}
len=lseek(f,0,SEEK_END); lseek(f,0,SEEK_SET);