Opened 16 years ago
Last modified 16 years ago
#1102 new enhancement
[PATCH] When file can't be opened MPlayer always displays "File not found" error, even on other error reasons (e.g. permissions).
Reported by: | Owned by: | reimar | |
---|---|---|---|
Priority: | unimportant | Component: | core |
Version: | HEAD | Severity: | minor |
Keywords: | Cc: | yuri@… | |
Blocked By: | Blocking: | ||
Reproduced by developer: | no | Analyzed by developer: | no |
Description
When MPlayer fails to to open file, it always write "File not found" error message. This looks confusing for cases, when file cannot be open by some other reason (not enough permissions for example).
Problem in stream/stream_file.c:150:
f=open(filename,m, openmode);
if(f<0) {
mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_FileNotFound,filename);
...
I modified it to:
f=open(filename,m, openmode);
if(f<0) {
mp_msg(MSGT_OPEN,MSGL_ERR,MSGTR_CantOpenFileError, filename, strerror(errno));
...
Should be noted that 'MSGTR_CantOpenFileError' message is marked in help/help_mp-en.h as message from codec-cfg.c, so maybe also some rearrangements of messsages is required...
Attachments (1)
Change History (5)
by , 16 years ago
Attachment: | FileNotFound_to_CantOpenFile.patch added |
---|
comment:1 by , 16 years ago
comment:2 by , 16 years ago
Bug reproduction example:
$ ls -l file.avi
--w------- 1 bob users 100497498 2008-02-08 02:12 file.avi
Not patched MPlayer:
$ mplayer file.avi
...
Playing file.avi.
File not found: 'file.avi'
Failed to open file.avi.
...
Patched with provided patch MPlayer:
$ mplayer file.avi
...
Playing file.avi.
Can't open 'file.avi': Permission denied
Failed to open file.avi.
...
Improved error message displaying for cases when file can't be opened.