GNOME Bugzilla – Bug 607739
[queue2] Temporary file is removed although code claims the opposite
Last modified: 2010-01-22 17:01:34 UTC
The queue2 temporary file is removed by queue2 although the code claims the opposite for a good reason: static void gst_queue2_close_temp_location_file (GstQueue2 * queue) { /* nothing to do */ if (queue->temp_file == NULL) return; GST_DEBUG_OBJECT (queue, "closing temp file"); /* we don't remove the file so that the application can use it as a cache * later on */ fflush (queue->temp_file); fclose (queue->temp_file); remove (queue->temp_location); queue->temp_file = NULL; } The remove() call should probably be removed or at least be made optional by adding a new property, because applications probably really want to use the temporary file later.
I'd prefer a property, but OTOH the file is probably stored on a temporary dir, so leaving it there always shouldn't be a problem.
Leaving it there always can be a problem for devices not having a big /tmp. Especially when you play HD trailers :) The user won't be happy if he finds out loads of big files cluttering /tmp, IMHO. A property would be fine I think.
Removing it would be fine by me. If the app wants to keep it, they can either keep on of its fd open, or do a hard link to it in the same directory.
commit 183ffdc126f1d9280bced8b59fef1368441ad631 Author: Wim Taymans <wim.taymans@collabora.co.uk> Date: Fri Jan 22 17:55:39 2010 +0100 queue2: add option to remove the temp-file Add an option to automatically remove the temp file (TRUE by default). This should make it possible for the application to keep the temp file by other means than hardlinking or holding an fd open. Fixes #607739