[vlc-commits] qt: playlist: use item title if available
Romain Vimont
git at videolan.org
Thu Apr 22 09:04:35 UTC 2021
vlc | branch: master | Romain Vimont <rom1v at videolabs.io> | Tue Apr 20 17:26:28 2021 +0200| [03674aee047f5b9e41d6f267592f79c7790326b1] | committer: Pierre Lamot
qt: playlist: use item title if available
Use the meta title if it is available, use the item name otherwise.
Fixes #25648
Signed-off-by: Pierre Lamot <pierre at videolabs.io>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=03674aee047f5b9e41d6f267592f79c7790326b1
---
modules/gui/qt/playlist/playlist_item.cpp | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/modules/gui/qt/playlist/playlist_item.cpp b/modules/gui/qt/playlist/playlist_item.cpp
index 0d7d460abe..18ba080d3c 100644
--- a/modules/gui/qt/playlist/playlist_item.cpp
+++ b/modules/gui/qt/playlist/playlist_item.cpp
@@ -73,15 +73,20 @@ QUrl PlaylistItem::getUrl() const
void PlaylistItem::sync() {
input_item_t *media = vlc_playlist_item_GetMedia(d->item.get());
vlc_mutex_lock(&media->lock);
- d->title = media->psz_name;
d->duration = media->i_duration;
d->url = media->psz_uri;
if (media->p_meta) {
+ d->title = vlc_meta_Get(media->p_meta, vlc_meta_Title);
d->artist = vlc_meta_Get(media->p_meta, vlc_meta_Artist);
d->album = vlc_meta_Get(media->p_meta, vlc_meta_Album);
d->artwork = vlc_meta_Get(media->p_meta, vlc_meta_ArtworkURL);
}
+
+ if (d->title.isNull())
+ /* If there is no title, use the item name */
+ d->title = media->psz_name;
+
vlc_mutex_unlock(&media->lock);
}
More information about the vlc-commits
mailing list