diff options
author | waker <wakeroid@gmail.com> | 2011-05-20 11:35:39 +0200 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2011-05-20 11:35:39 +0200 |
commit | 4c6ee7ff8dcb31d07f4c8f012e8338a17ecbb119 (patch) | |
tree | ce1570a74fdefa9d3c54a728f39142996e92d613 | |
parent | 874fda0dc7041326d869938c8b18c7d87529c68b (diff) |
pass started_timestamp of previous track in songchanged event; unbreak scrobbler
-rw-r--r-- | deadbeef.h | 4 | ||||
-rw-r--r-- | streamer.c | 3 |
2 files changed, 3 insertions, 4 deletions
@@ -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 { @@ -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); |