summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2011-05-20 11:35:39 +0200
committerGravatar waker <wakeroid@gmail.com>2011-05-20 11:35:39 +0200
commit4c6ee7ff8dcb31d07f4c8f012e8338a17ecbb119 (patch)
treece1570a74fdefa9d3c54a728f39142996e92d613
parent874fda0dc7041326d869938c8b18c7d87529c68b (diff)
pass started_timestamp of previous track in songchanged event; unbreak scrobbler
-rw-r--r--deadbeef.h4
-rw-r--r--streamer.c3
2 files changed, 3 insertions, 4 deletions
diff --git a/deadbeef.h b/deadbeef.h
index 47ee4325..2bd0287f 100644
--- a/deadbeef.h
+++ b/deadbeef.h
@@ -212,7 +212,7 @@ typedef struct {
ddb_event_t ev;
DB_playItem_t *track;
float playtime; // for SONGFINISHED event -- for how many seconds track was playing
- time_t started_timestamp; // result of calling time(NULL) on playback start
+ time_t started_timestamp; // time when "track" started playing
} ddb_event_track_t;
typedef struct {
@@ -220,7 +220,7 @@ typedef struct {
DB_playItem_t *from;
DB_playItem_t *to;
float playtime; // for SONGCHANGED event -- for how many seconds prev track was playing
- time_t started_timestamp; // result of calling time(NULL) on playback start
+ time_t started_timestamp; // time when "from" started playing
} ddb_event_trackchange_t;
typedef struct {
diff --git a/streamer.c b/streamer.c
index 6b98f8ac..588e5241 100644
--- a/streamer.c
+++ b/streamer.c
@@ -226,9 +226,9 @@ streamer_start_playback (playItem_t *from, playItem_t *it) {
pl_item_ref (playing_track);
playing_track->played = 1;
- started_timestamp = time (NULL);
trace ("from=%p (%s), to=%p (%s) [2]\n", from, from ? pl_find_meta (from, ":URI") : "null", it, it ? pl_find_meta (it, ":URI") : "null");
send_trackchanged (from, it);
+ started_timestamp = time (NULL);
}
if (from) {
pl_item_unref (from);
@@ -337,7 +337,6 @@ streamer_move_to_nextsong (int reason) {
streamer_playlist = p;
int r = str_get_idx_of (it);
if (r >= 0) {
- trace ("%s found in playlist %d\n", pl_find_meta (it, ":URI"), i);
pl_item_unref (it);
pl_unlock ();
streamer_set_nextsong (r, 3);