summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-10-13 17:13:13 +0200
committerwm4 <wm4@nowhere>2012-10-14 22:28:51 +0200
commit7d3efa894000bb7513152d2986ccbdef8b6f27ea (patch)
tree0e04d5233560fb605f31fbb76a28e921250b42bd /stream
parenta19f197cb14a0ceec4bc1fe977502b8f8ab8f94e (diff)
downloadmpv-7d3efa894000bb7513152d2986ccbdef8b6f27ea.tar.bz2
mpv-7d3efa894000bb7513152d2986ccbdef8b6f27ea.tar.xz
stream: remove NULL checks for open calls
open_stream() and open_output_stream() checked for filename==NULL, and if true, printed an error message asking to report this as bug. Internal logic errors should just crash. Use assert() instead.
Diffstat (limited to 'stream')
-rw-r--r--stream/stream.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/stream/stream.c b/stream/stream.c
index ab0039e581..837378fcae 100644
--- a/stream/stream.c
+++ b/stream/stream.c
@@ -205,6 +205,8 @@ stream_t *open_stream_full(const char *filename, int mode,
stream_t* s;
char *redirected_url = NULL;
+ assert(filename);
+
int dummy;
if (!file_format)
file_format = &dummy;
@@ -250,24 +252,12 @@ stream_t *open_stream_full(const char *filename, int mode,
stream_t* open_stream(const char *filename, struct MPOpts *options,
int *file_format)
{
-
-if(!filename) {
- mp_msg(MSGT_OPEN,MSGL_ERR,"NULL filename, report this bug\n");
- return NULL;
-}
-
return open_stream_full(filename,STREAM_READ,options,file_format);
}
stream_t *open_output_stream(const char *filename, struct MPOpts *options)
{
- int file_format; //unused
- if(!filename) {
- mp_msg(MSGT_OPEN,MSGL_ERR,"open_output_stream(), NULL filename, report this bug\n");
- return NULL;
- }
-
- return open_stream_full(filename,STREAM_WRITE,options,&file_format);
+ return open_stream_full(filename,STREAM_WRITE,options,NULL);
}
//=================== STREAMER =========================