mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-11 20:01:35 +00:00
playback/player: gtk-play: if title is NULL then use uri basename in toolbar label
If stream title is not available in the stream then use file basename in toolbar title label and full uri in window title bar.
This commit is contained in:
parent
a18cefb73c
commit
7a874938a0
1 changed files with 13 additions and 7 deletions
|
@ -1638,18 +1638,24 @@ media_info_updated_cb (GstPlayer * player, GstPlayerMediaInfo * media_info,
|
|||
{
|
||||
const gchar *title;
|
||||
GdkPixbuf *pixbuf;
|
||||
gchar *basename = NULL;
|
||||
gchar *filename = NULL;
|
||||
|
||||
title = gst_player_media_info_get_title (media_info);
|
||||
if (!title)
|
||||
title = g_path_get_basename (gst_player_media_info_get_uri (media_info));
|
||||
|
||||
if (!title) {
|
||||
filename = g_filename_from_uri(
|
||||
gst_player_media_info_get_uri (media_info), NULL, NULL);
|
||||
basename = g_path_get_basename (filename);
|
||||
}
|
||||
|
||||
gtk_label_set_label (play->title_label, title ? title : basename);
|
||||
set_title (play, title ? title : filename);
|
||||
g_free(basename);
|
||||
g_free(filename);
|
||||
|
||||
pixbuf = gtk_play_get_cover_image (media_info);
|
||||
|
||||
if (title) {
|
||||
gtk_label_set_label (play->title_label, title);
|
||||
set_title (play, title);
|
||||
}
|
||||
|
||||
if (pixbuf) {
|
||||
gtk_window_set_icon (GTK_WINDOW (play), pixbuf);
|
||||
g_object_unref (pixbuf);
|
||||
|
|
Loading…
Reference in a new issue