# HG changeset patch # User reimar # Date 1396810426 0 # Node ID 43a8e37a3dcf755d6d5c0d4c700cb3a4abc9e0ee # Parent ef0fa4caac9c4b9593e3432679486fb4432b9a5b stream: Move variables into lowest possible scope. diff -r ef0fa4caac9c -r 43a8e37a3dcf stream/stream.c --- a/stream/stream.c Sun Apr 06 18:48:45 2014 +0000 +++ b/stream/stream.c Sun Apr 06 18:53:46 2014 +0000 @@ -219,19 +219,19 @@ stream_t* open_stream_full(const char* filename,int mode, char** options, int* file_format) { - int i,j,l,r; - const stream_info_t* sinfo; - stream_t* s; - char *redirected_url = NULL; + int i,j; for(i = 0 ; auto_open_streams[i] ; i++) { - sinfo = auto_open_streams[i]; + const stream_info_t *sinfo = auto_open_streams[i]; for(j = 0 ; sinfo->protocols[j] ; j++) { - l = strlen(sinfo->protocols[j]); + int l = strlen(sinfo->protocols[j]); // l == 0 => Don't do protocol matching (ie network and filenames) if((l == 0 && !strstr(filename, "://")) || ((strncasecmp(sinfo->protocols[j],filename,l) == 0) && (strncmp("://",filename+l,3) == 0))) { + int r; + char *redirected_url = NULL; + stream_t* s; *file_format = DEMUXER_TYPE_UNKNOWN; s = open_stream_plugin(sinfo,filename,mode,options,file_format,&r, &redirected_url);