After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 607739 - [queue2] Temporary file is removed although code claims the opposite
[queue2] Temporary file is removed although code claims the opposite
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal blocker
: 0.10.26
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-01-22 09:28 UTC by Sebastian Dröge (slomo)
Modified: 2010-01-22 17:01 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sebastian Dröge (slomo) 2010-01-22 09:28:19 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.
Comment 1 Thiago Sousa Santos 2010-01-22 10:26:33 UTC
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.
Comment 2 Philippe Normand 2010-01-22 11:45:21 UTC
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.
Comment 3 Bastien Nocera 2010-01-22 11:50:09 UTC
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.
Comment 4 Wim Taymans 2010-01-22 17:01:34 UTC
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