player: Fix clearing track metadata
Luiz Augusto von Dentz
maintainerPATCH 1/1 player: Fix clearing track metadata
From: Luiz Augusto von Dentz <[email protected]>
The value stored in the hashtable is the path not the actual pointer of the item.
--- profiles/audio/player.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
profiles/audio/player.c +3 -1
@@ -1885,6 +1885,7 @@ struct media_item *media_player_set_playlist_item(struct media_player *mp, {struct media_folder *folder = mp->playlist;struct media_item *item; +char *path;DBG ("%" PRIu64"" , uid);
@@ -1903,7 +1904,8 @@ struct media_item *media_player_set_playlist_item(struct media_player *mp, mp->track =g_hash_table_ref (item->metadata); } -if (item ==g_hash_table_lookup (mp->track,"Item" )) + path =g_hash_table_lookup (mp->track,"Item" ); +if (!g_strcmp0 (path, item->path))return item;if (mp->process_id ==0 ) {
Signature · 1 line
2.13.6
Quoted 14 lines · Luiz Augusto von Dentz
From: Luiz Augusto von Dentz <[email protected]>
The value stored in the hashtable is the path not the actual pointer of
the item.--- profiles/audio/player.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)profiles/audio/player.c +0
-0
profiles/audio/player.c struct media_item · line 1889
Quoted 5 lines
profiles/audio/player.c +1
-0@@ -1885,6 +1885,7 @@ struct media_item *media_player_set_playlist_item(struct media_player *mp, { struct media_folder *folder = mp->playlist; struct media_item *item; + char *path;
const char *? So it's clear why you don't free it.
Quoted 13 lines
profiles/audio/player.c +2
-1DBG ("%" PRIu64"" , uid);@@ -1903,7 +1904,8 @@ struct media_item *media_player_set_playlist_item(struct media_player *mp, mp->track = g_hash_table_ref(item->metadata); } -if (item ==g_hash_table_lookup (mp->track,"Item" )) + path =g_hash_table_lookup (mp->track,"Item" ); +if (!g_strcmp0 (path, item->path))return item;if (
mp->process_id== 0) {
Luiz Augusto von Dentz
maintainerHi Bastien,
Quoted 10 lines · Bastien Nocera
Quoted 9 lines · Luiz Augusto von Dentz
From: Luiz Augusto von Dentz <[email protected]>
The value stored in the hashtable is the path not the actual pointer of
the item.--- profiles/audio/player.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Quoted 12 lines
profiles/audio/player.c struct media_item · line 1889
Quoted 10 lines
profiles/audio/player.c +1
-0@@ -1885,6 +1885,7 @@ struct media_item *media_player_set_playlist_item(struct media_player *mp, { struct media_folder *folder = mp->playlist; struct media_item *item; + char *path;const char *? So it's clear why you don't free it.
Sure.
Quoted 14 lines
Quoted 14 lines
profiles/audio/player.c +2
-1DBG ("%" PRIu64"" , uid);@@ -1903,7 +1904,8 @@ struct media_item *media_player_set_playlist_item(struct media_player *mp, mp->track = g_hash_table_ref(item->metadata); } -if (item ==g_hash_table_lookup (mp->track,"Item" )) + path =g_hash_table_lookup (mp->track,"Item" ); +if (!g_strcmp0 (path, item->path))return item;if (mp->process_id == 0) {
Signature · 1 line
Luiz Augusto von Dentz