From 7d3efa894000bb7513152d2986ccbdef8b6f27ea Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 13 Oct 2012 17:13:13 +0200 Subject: 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. --- stream/stream.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'stream') 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 ========================= -- cgit v1.2.3