Bug 125688 - fails to properly play files with names containing '#' character
Summary: fails to properly play files with names containing '#' character
Status: RESOLVED FIXED
Alias: None
Product: kaffeine
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR normal with 121 votes (vote)
Target Milestone: ---
Assignee: Christophe Thommeret
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-16 20:45 UTC by Fathi Boudra
Modified: 2009-11-01 19:25 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Escape URLs passed at the command line or file->open (174 bytes, patch)
2007-01-07 16:02 UTC, Enrico
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fathi Boudra 2006-04-16 20:45:22 UTC
Version:           0.8.1 (using KDE KDE 3.5.2)
Installed from:    Debian testing/unstable Packages
OS:                Linux

This is a forwarded bug :
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=362807

Attempting to play files with a '#' in their name in this version of kaffeine 
sometimes results in the following error message:

'The specified file or url was not found. Please check it.'

After locating the problem, I tried the following two commands on working test 
files. I included single quotes for shell protection.

1) kaffeine '#.mpg'
2) kaffeine '# .mpg'

Both of these commands result in kaffeine essentially ignoring the existence 
of the files and not playing anything. When working with longer filenames I 
was able to convince kaffeine to display the error message above, but only 
intermittently. Other times the audio stream played but without a video 
stream. To rule out interference from bash, I also tried the same things using 
backslash escapes but no change was observed.
Comment 1 Thiago Macieira 2006-04-18 20:46:15 UTC
This probably means Kaffeine is not parsing its command-line arguments correctly.
Comment 2 Matthew Hall 2006-04-19 01:29:38 UTC
While that seems like a possibility, I wouldn't count on it. '#'s in filnames likewise cause Xine-UI to generate spurious errors; they just do not happen to inhibit the file from being played.

In addition I should mention that versions of kaffeine prior to 0.8.xx release generated spurious errors but still were able to play the files.
Comment 3 Thiago Macieira 2006-04-19 09:32:13 UTC
Does the same problem happen for ? in filenames?
Comment 4 Fathi Boudra 2006-04-19 09:45:03 UTC
> This probably means Kaffeine is not parsing its command-line arguments correctly.

Not only command-line, same behavior with file->open...

> '#'s in filnames likewise cause Xine-UI to generate spurious errors

i confirm, i've got a warning but xine-ui plays the file.

> Assigned to:  Jürgen Kofler

Jürgen seems no more active on kaffeine, Christophe Thommeret is the current maintainer.
Comment 5 Fathi Boudra 2006-04-22 16:29:02 UTC
* after the error message, the file is played anyway :
 * just look the elapsed time, it is incremented.
 * if i switch to the player window, player list or audio cd -> i've got the file  playing

In fact, the file is played, but we have the error message and the correct behavior (switch to player window) doesn't happen.
Comment 6 Fathi Boudra 2006-04-22 16:33:36 UTC
> Does the same problem happen for ? in filenames?

not exactly :
* we didn't have the error message (this is the only difference)
* the file is played
* but as '#' case correct behavior (switch to player window) doesn't happen

we stay in "start" window and must switch manually to player window.
Comment 7 Fathi Boudra 2006-04-22 17:27:29 UTC
tested same cases with xine-ui :
* '#' -> gives error message, play the file
* '?' -> gives no error message, play the file

exactly like kaffeine.

the bug isn't "fails to properly play files with names containing '#' character" but : "correct behavior (switch to player window) doesn't happen for files with names containing '#' or '?'"

i built kaffeine with enable-debug=full but couldn't debug it, gdb gives me :
kaffeine not in executable format: file format not recognized

Comment 8 Christian D. 2006-07-11 16:36:26 UTC
I can confirm this for 0.7.1 on KDE 3.5.2 (Ubuntu packages)

Kaffeine displays an error message (file/url not found) on some files containing the # character. The file can be played without further problems after clicking on ok.

To reproduce, rename a video file to e.g: "demo # 1.avi"
Comment 9 Enrico 2007-01-07 16:02:19 UTC
Created attachment 19156 [details]
Escape URLs passed at the command line or file->open

The attached patch offers a way to play files with characters such as '?' or
'#' when passed from the command line or file->open menu.
It applies to kaffeine-0.8.3/kaffeine/src/kaffeine.cpp
Comment 10 Christoph Pfister 2007-02-17 12:35:30 UTC
SVN commit 634455 by pfister:

fix bug with file names containing #
patch based on comment #9 but without (hopefully) introducing any regressions
BUG: 125688


 M  +8 -13     kaffeine.cpp  


--- trunk/extragear/multimedia/kaffeine/src/kaffeine.cpp #634454:634455
@@ -302,7 +302,7 @@
 			url = path.absFilePath(url);
 #endif
 		}
-		urls.append(url);
+		urls.append(KURL::fromPathOrURL(url).url());
 	}
 	loadTMP(urls);
 
@@ -1159,20 +1159,15 @@
 		fileFilter.prepend(DEFAULT_FILTER);
 
 	KURL::List kurlList = KFileDialog::getOpenURLs(":kaffeine_openFile", fileFilter, 0, i18n("Open File(s)"));
+
+	for (KURL::List::Iterator it = kurlList.begin(); it != kurlList.end(); ++it)
+		if ((*it).isLocalFile() && (*it).path().endsWith(".iso", false))
+			(*it).setProtocol("dvd");
+
 	QStringList urlList = kurlList.toStringList();
-	for ( QStringList::Iterator it = urlList.begin(); it != urlList.end(); ++it )
-	{
-		KURL suburl = *it;
-		if (suburl.protocol() == "file")
-			*it = suburl.path();
-		if ( suburl.path().endsWith(".iso",false) ) {
-			*it = suburl.path().prepend("dvd://");
-		}
 
-	}
-	if (!urlList.count())
-		return;
-	load(urlList);
+	if (urlList.count() > 0)
+		load(urlList);
 }
 
 void Kaffeine::slotTogglePlaylist()
Comment 11 gmud 2007-03-16 19:53:13 UTC
The patch doesn't work for me. If I have filenames like
"my great song #1.ogg" I cannot drag and drop it into the player window. Also, I cannot open it via File->Open. It gives no errors and just does nothing and doesn't give any errors on console.
Comment 12 Toni Helenius 2007-04-14 02:18:43 UTC
I can confirm this bug happening in Kubuntu Feisty. Kaffeine 0.8.3.
Comment 13 Maciej Pilichowski 2007-05-03 09:15:27 UTC
Christoph, could you tell in what stable version this fix should appear?

I use 0.8.3, if the # is in the middle of the filename Kaffeine reports the file is missing, if the # is the leading character Kaffeine simply ignores it -- I mean, Kaffeine just starts and that's it. No playback, no error report, nothing. Just like I would open Kaffeine.

So, in short -- this bug still bites.
Comment 14 Maciej Pilichowski 2007-05-03 09:27:59 UTC
PS. 0.8.4, no change.
Comment 15 Christoph Pfister 2007-05-08 21:54:01 UTC
argh - can confirm it ... seems that there's somewhere a regression in the url passing chain (because I'm pretty sure it worked when I tested it ;) - will deal with that tomorrow
Comment 16 Smeagal 2007-05-27 19:08:33 UTC
Same happens if the "#" is in the foldername with version0.8.3. For example:
folder: /home/user/test - version #1/some.avi cant be opened with doubleklick, Kaffeine error : (/home/user/test - version) not found.
Somehow Krusader doesnot like the "#" as well, shows error like Folder doesnot exist on startup.
Comment 17 Christoph Pfister 2007-05-27 19:25:11 UTC
actually i found out the regression - but fixing it is quite tricky so this will happen in 0.9 ...
Comment 18 Cláudio da Silveira Pinheiro 2007-07-29 08:57:17 UTC
I confirm the bug in Feisty i386, Kaffeine 0.8.4 instead of 0.8.3.
I have files with names just like that of comment #11, same behavior.
Comment 19 Chris Hawley 2007-08-11 19:55:49 UTC
I have encountered Kaffeine 0.8.3 on Feisty i386 having problems dropping files with '?' in their name into the playlist. No error is given but it ignores the file. Double clicking the file in the filebrowser does, however, start it playing and add it to the playlist.
Comment 20 Oleg Atamanenko 2007-11-14 18:32:17 UTC
I confirm the bug in Debian Unstable, Kaffeine 0.8.5.
Comment 21 Arno Kohlsdorf 2008-02-07 20:24:29 UTC
The bus exists in gentoo, too. kaffeine 0.8.5
Comment 22 Christoph Pfister 2009-10-25 13:49:11 UTC
very likely not a problem in 1.0-pre1 anymore
Comment 23 Alvaro Tanarro 2009-10-25 20:01:14 UTC
Doesn't still work on revision 1040174
Comment 24 Christoph Pfister 2009-10-27 18:45:53 UTC
are you sure that you're using a 1.0-* version? (help --> about kaffeine)
Comment 25 Alvaro Tanarro 2009-10-27 18:58:41 UTC
(In reply to comment #24)
> are you sure that you're using a 1.0-* version? (help --> about kaffeine)

1.0-svn2 
It's a compiled version by myself.

When i try to open a file with the # character in the name i get the follow output in console:

  xine is asking to seek behind the end of the data stream
  xine is asking to seek behind the end of the data stream
  xine is asking to seek behind the end of the data stream
  xine is asking to seek behind the end of the data stream

Is there any way to get more debug information?

Thanks
Comment 26 Alvaro Tanarro 2009-11-01 19:25:13 UTC
Solved in last rev.
Thanks