This forum has been archived. All content is frozen. Please use KDE Discuss instead.

patch for "file not found" errors

Tags: None
(comma "," separated)
John
Karma
0

patch for "file not found" errors

Thu Jun 23, 2005 7:36 am
I\'ve noticed that when amarok is unable to open the sound device or if some files in the playlist have moved, it will popup an error notification for each file. They are the ones that go away when you click on them. Usually there are too many to even attempt to close them out.

This is all with the xine engine. I don\'t know if it applies to the others.

I noticed that the engine doesn\'t send much information back to the application and can only run a callback that pops up the error message. It then roars through the rest of the playlist.

I put together a small patch that slows the roar down a bit. It keeps a timer and the type of the last message and prevents amarok from popping up the same error twice in a row less than 10 seconds apart.

I meant to send it in a couple of weeks ago but the site probs got in the way. So for what it\'s worth, here\'s the patch....

I don\'t know how friendly the forum posts are to patches, if you\'d like this by email or some other mechanism, let me know.....

--john

ps. Amarok is the best audio player I\'ve ever used. I appreciate the amount of work you guys have put into it. the wiki tab in 1.3 is really nice!

------cut here------
diff -Naur amarok-1.2.4-orig/amarok/src/engine/xine/xine-engine.cpp amarok-1.2.4/amarok/src/engine/xine/xine-engine.cpp
--- amarok-1.2.4-orig/amarok/src/engine/xine/xine-engine.cpp 2005-06-10 09:47:10.000000000 -0500
+++ amarok-1.2.4/amarok/src/engine/xine/xine-engine.cpp 2005-06-10 09:09:51.000000000 -0500
@@ -518,9 +518,14 @@
}
}

+static time_t last_error_time = 0; // hysteresis on xine errors
+static int last_error = XINE_MSG_NO_ERROR;
+
void
XineEngine::XineEventListener( void *p, const xine_event_t* xineEvent )
{
+ time_t current;
+
if( !p ) return;

#define xe static_cast(p)
@@ -612,7 +617,17 @@

explain:

- if(data->explanation)
+
+ if((last_error_time + 10) > time(&current) &&
+ data->type == last_error)
+ {
+ last_error_time = current;
+ return;
+ }
+ last_error_time = current;
+ last_error = data->type;
+
+ if(data->explanation)
{
message.prepend( \"\" );
message += \":\";
@@ -624,6 +639,15 @@

param:

+ if((last_error_time + 10) > time(&current) &&
+ data->type == last_error)
+ {
+ last_error_time = current;
+ return;
+ }
+ last_error_time = current;
+ last_error = data->type;
+
message.prepend( \"\" );
message += \"\";
User avatar
markey
KDE Developer
Posts
2286
Karma
3
OS
Interesting patch! But you were right, the formatting got screwed.

Could you please send it to amarok-devel@lists.sf.net

TIA.


--
Mark Kretschmann - Amarok Developer


Bookmarks



Who is online

Registered users: bancha, Bing [Bot], daret, Evergrowing, Google [Bot], lockheed, sandyvee, Sogou [Bot]