[totem/wip/hadess/recent-no-mime-type] recent: Fix warning for videos without known mime-types




commit e1fd55e78554b6accc76c83325a753bfd180d08d
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Feb 1 19:36:03 2022 +0100

    recent: Fix warning for videos without known mime-types
    
    When playing http://samples.mplayerhq.hu/yuv4mpeg2/example.y4m.bz2
    the recent plugin would warn that:
    (totem:2254517): Gtk-WARNING **: 19:27:38.141: Attempting to add 'file:///home/hadess/Videos/example.y4m' 
to the list of recently used resources, but no MIME type was defined
    (totem:2254517): Totem-WARNING **: 19:27:38.141: Couldn't add recent file for 
'file:///home/hadess/Videos/example.y4m'
    
    Use our app-specific mime-type to handle those cases.

 src/plugins/recent/totem-recent.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/src/plugins/recent/totem-recent.c b/src/plugins/recent/totem-recent.c
index cdca378ab..37ebded81 100644
--- a/src/plugins/recent/totem-recent.c
+++ b/src/plugins/recent/totem-recent.c
@@ -70,6 +70,8 @@ recent_info_cb (GFile *file,
                groups[0] = (gchar*) "TotemStreams";
        } else {
                data.mime_type = g_strdup (g_file_info_get_content_type (file_info));
+               if (!data.mime_type)
+                       data.mime_type = g_strdup ("video/x-totem-stream");
                data.display_name = g_strdup (g_file_info_get_display_name (file_info));
                g_object_unref (file_info);
                groups[0] = (gchar*) "Totem";


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]