no thumbnails via totem-video-thumbnailer: glycin uses g_file_replace_contents, invalidating the FD held by desktop-thumbnailer
I stopped seeing video thumbnails and investigated. I'm using Arch Linux. Package versions:
tumbler: 4.20.1-1 totem: 43.2-3 gdk-pixbuf2: 2.44.4-1 glycin: 2.0.7-1
In tumbler/plugins/desktop-thumbnailer.c, in desktop_thumbnailer_load_thumbnail a tmpfile is created:
tmpfile = g_file_new_tmp ("tumbler-XXXXXX.png", &stream, error);
It stays in the file system and also as an open file descriptor. This is apparent from
$ ls -l /proc/760268/fd/8
lrwx------ 1 rrika rrika 64 Jan 12 20:57 /proc/760268/fd/8 -> /tmp/tumbler-2SMWI3.png
The moment execution passes g_spawn_sync a few lines further down this changes to
$ ls -l /proc/760268/fd/8 /tmp/tumbler-2SMWI3.png
lrwx------ 1 rrika rrika 64 Jan 12 20:57 /proc/760268/fd/8 -> '/tmp/tumbler-2SMWI3.png (deleted)'
-rw------- 1 rrika rrika 17490 Jan 12 21:50 /tmp/tumbler-2SMWI3.png
despite the fact that a file of the correct name exists. A few lines further down
source = gdk_pixbuf_new_from_stream (g_io_stream_get_input_stream (G_IO_STREAM (stream)),
cancellable, error);
returns zero because 'stream' references an FD with size 0.
The desktop thumbnailer is based on /usr/share/thumbnailers/totem.thumbnailer. Its first lines are this:
[Thumbnailer Entry]
TryExec=/usr/bin/totem-video-thumbnailer
Exec=/usr/bin/totem-video-thumbnailer -s %s %u %o
In totem/totem-video-thumbnailer.c, gdk_pixbuf_save is used to save the image.
In gdk-pixbuf/io-glycin-utils.c, glycin_image_save calls g_file_replace_contents which invalidates the FD held by tumbler.