diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2009-07-10 20:24:14 +0100 |
---|---|---|
committer | Wim Taymans <wim@metal.(none)> | 2009-07-10 20:26:22 +0100 |
commit | bede11dbc36b7ae176e5ca776a0791d575ce60f7 (patch) | |
tree | 3aeb26b8abef01a8b8cea88d5123391cd255f0b4 | |
parent | 4403cf4efbd332ab98060ce306ab7e11e89cc0b9 (diff) | |
download | gstreamer-plugins-base-bede11dbc36b7ae176e5ca776a0791d575ce60f7.tar.gz |
uridecodebin: Fix template construction
Fix the construction of the temporary filename construction as the application
name can be NULL and we don't want a separator between the prgname and the
template.
-rw-r--r-- | gst/playback/gsturidecodebin.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/gst/playback/gsturidecodebin.c b/gst/playback/gsturidecodebin.c index 47251bc98..f37515597 100644 --- a/gst/playback/gsturidecodebin.c +++ b/gst/playback/gsturidecodebin.c @@ -1247,16 +1247,26 @@ type_found (GstElement * typefind, guint probability, decoder->download); if (IS_DOWNLOAD_MEDIA (media_type) && decoder->download) { - gchar *temp_template; + gchar *temp_template, *filename; + const gchar *tmp_dir, *prgname; + + tmp_dir = g_get_tmp_dir (); + prgname = g_get_prgname (); + if (prgname == NULL) + prgname = "GStreamer"; + + filename = g_strdup_printf ("%s-XXXXXX", prgname); /* build our filename */ - temp_template = - g_build_filename (g_get_tmp_dir (), g_get_prgname (), "-XXXXXX", NULL); + temp_template = g_build_filename (tmp_dir, filename, NULL); + + GST_DEBUG_OBJECT (decoder, "enable download buffering in %s (%s, %s, %s)", + temp_template, tmp_dir, prgname, filename); - GST_DEBUG_OBJECT (decoder, "enable download buffering in %s", - temp_template); /* configure progressive download for selected media types */ g_object_set (G_OBJECT (queue), "temp-template", temp_template, NULL); + + g_free (filename); g_free (temp_template); } |