GNOME Bugzilla – Bug 316032
Unable to change default "Open With" application for MP3 files
Last modified: 2005-09-13 18:20:15 UTC
Please describe the problem: After a clean installation of GNOME 2.12.0 from sources I noticed that it is not possible to select the default "Open With" application for MP3 files. Right clicking an MP3 file, selecting Properties, selecting the Open With tab and clicking on a radio button to make a program the default Open With application does not do anything. For other file types (like OGG files) it does work correctly. I investigated this problem further and noticed that after clicking the radio button Nautilus DOES set the new program as the default in ~/.local/share/applications/defaults.list but it does not take this setting into use (the radio button is not ever selected and the old program still is the default Open With program). It seems that Nautilus and GNOME-VFS do recognize MP3 files as audio/x-mp3 files. Because I remember seeing some other MIME types for MP3s as well I checked the MIME database to see if there were other MIME types for MP3s which might make Nautilus confused. And yes: in $PREFIX/share/mime/aliases there is a line audio/x-mp3 audio/mpeg Removing this line, removing <alias type="audio/x-mp3"/> from $PREFIX/share/mime/packages/freedesktop.org.xml and running update-mime-database fixes the problem. I don't know why though. GNOME-VFS and Nautilus still recognize MP3s as audio/x-mp3s. I suspect that if the alias exists for some reason Nautilus uses the Open With program defined for audio/mpeg even though it edits the program for audio/x-mp3. Steps to reproduce: 1. Install GNOME 2.12.0 including the latest freedesktop.org stuff from scratch 2. Right click on an MP3 file in Nautilus 3. Select Properties 4. Select Open With 5. Click on a radio button for a program that is not yet selected as default Actual results: Nothing - the new program is not selected to be the default as it should. A line audio/x-mp3=myprogram.desktop is written to ~/.local/share/applications/defaults.list though but Nautilus does not "obey" it. Expected results: I'd expect the selected program to become the default Open With program like happens with other file types. Does this happen every time? Yes. Other information:
Actually my workaround was not adequate. After removing the alias I noticed that Nautilus actually recognizes some of the MP3 files as "audio/mpeg" and some as "audio/x-mp3". In this case it refused to open the audio/mpeg ones with the following error message: --- Cannot open filename.mp3 The filename "filename.mp3" indicates that this file is of type "MP3 audio". The contents of the file indicate that the file is of type "MP3 audio". If you open this file, the file might present a security risk to your system. Do not open the file unless you created the file yourself, or received the file from a trusted source. To open the file, rename the file to the correct extension for "MP3 audio", then open the file normally. Alternatively, use the Open With menu to choose a specific application for the file. --- The ones recognized as audio/x-mp3s could be played. I readded the alias lines in the shared-mime-info files and Nautilus went back to its original behaviour: it shows all MP3 files as audio/x-mp3s and I'm not able to change the default Open With application using the GUI. The reason is now clear: even though the GUI always shows the file type as audio/x-mp3 and Nautilus writes that to ~/.local/share/applications/defaults.list it still actually uses the program defined to open audio/mpeg files. I'm now sure of this because if I edit defaults.list by hand and change the audio/mpeg line instead of the audio/x-mp3 line I am able to change the default Open With application.
Thanks for your bug report I suppose the eel MIME selection is a bit broken. What I don't get is why in the first place those items are recognized as "audio/x-mp3" instead of "audio/mpeg". Since you compiled GNOME from sources (welcome to the club), maybe you could try whether for the affected files running gtk/xdgmime/test-mime <file.mp3> within the GTK+ source code directory returns "audio/x-mp3" or "audio/mpeg"?
test-mime reports all the affected files to be audio/x-mp3. BTW I'm using shared-mime-info 0.16.
OK, thanks for your feedback. This is essentially a symptom of bug 161773. *** This bug has been marked as a duplicate of 161773 ***