[Bug 750585] gst-play: Sorting directory entries when opening.

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Mon Jun 8 10:50:31 PDT 2015


https://bugzilla.gnome.org/show_bug.cgi?id=750585

Tim-Philipp Müller <t.i.m at zen.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #304798|none                        |needs-work
             status|                            |

--- Comment #1 from Tim-Philipp Müller <t.i.m at zen.co.uk> ---
Comment on attachment 304798
  --> https://bugzilla.gnome.org/attachment.cgi?id=304798
Patch filename

Thanks for the patch!

>       path = g_strconcat (filename, G_DIR_SEPARATOR_S, entry, NULL);
>-      add_to_playlist (playlist, path);
>+      files = g_list_append (files, g_strdup (path));
>       g_free (path);
>     }

Just use the newly-allocated path directly and remove the g_strdup() and
g_free().
Also use g_list_prepend(), it's faster and we're going to sort it later anyway.

>+    files = g_list_sort (files, compare);
>+
>+    for (idx = files; idx; idx = g_list_next (idx)) {
>+      gchar *path = (gchar *) idx->data;
>+      add_to_playlist (playlist, path);
>+    }
>+    g_list_free (files);

I think this leaks the path string in idx->data ?

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list