playbin: Insert decoders without GstAVElement information between the other decoders
authorSebastian Dröge <sebastian@centricular.com>
Sat, 18 Jan 2014 12:31:06 +0000 (13:31 +0100)
committerSebastian Dröge <sebastian@centricular.com>
Sat, 18 Jan 2014 12:33:57 +0000 (13:33 +0100)
Otherwise they would be preferred over all decoders independent
of their ranks.

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

gst/playback/gstplaybin2.c

index 9233a4a..e4fe497 100644 (file)
@@ -3824,6 +3824,7 @@ create_decoders_list (GList * factory_list, GSequence * avelements)
 {
   GList *dec_list = NULL, *tmp;
   GList *ave_list = NULL;
+  GList *ave_free_list = NULL;
   GstAVElement *ave, *best_ave;
 
   g_return_val_if_fail (factory_list != NULL, NULL);
@@ -3852,7 +3853,10 @@ create_decoders_list (GList * factory_list, GSequence * avelements)
         /* There's at least raw */
         ave->n_comm_cf = 1;
 
-        dec_list = g_list_prepend (dec_list, factory);
+        ave_list = g_list_prepend (ave_list, ave);
+
+        /* We need to free these later */
+        ave_free_list = g_list_prepend (ave_free_list, ave);
         continue;
       }
 
@@ -3890,6 +3894,10 @@ create_decoders_list (GList * factory_list, GSequence * avelements)
   }
   g_list_free (ave_list);
 
+  for (tmp = ave_free_list; tmp; tmp = tmp->next)
+    g_slice_free (GstAVElement, tmp->data);
+  g_list_free (ave_free_list);
+
   dec_list = g_list_reverse (dec_list);
 
   return dec_list;