Opened 11 years ago

Last modified 10 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: altsysrq@… Owned by: reimar
Priority: unimportant Component: core
Version: HEAD Severity: minor
Keywords: Cc: yuri@…
Blocked By: Blocking:
Reproduced by developer: Analyzed by developer:

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)

FileNotFound_to_CantOpenFile.patch (646 bytes) - added by altsysrq@… 11 years ago.
Improved error message displaying for cases when file can't be opened.

Download all attachments as: .zip

Change History (5)

Changed 11 years ago by altsysrq@…

Improved error message displaying for cases when file can't be opened.

comment:1 Changed 11 years ago by altsysrq@…

comment:2 Changed 11 years ago by altsysrq@…

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.

...

comment:3 Changed 11 years ago by compn

this would be very nice to have, thanks for patch :)

comment:4 Changed 10 years ago by compn

  • Cc yuri@… added

* Bug 990 has been marked as a duplicate of this bug. *

Note: See TracTickets for help on using tickets.