diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2016-08-01 10:15:04 +0300 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2016-08-16 16:42:18 +0300 |
commit | de89cafe912780e914d5069248e9a7658b132737 (patch) | |
tree | 43a915552764e8825f61984ac702655113277cd0 | |
parent | 56e3176e63379d31dd882a2035b54b93b347429b (diff) | |
download | gstreamer-plugins-bad-de89cafe912780e914d5069248e9a7658b132737.tar.gz |
amc: Use a GQueue for O(1) append instead of a GList
-rw-r--r-- | sys/androidmedia/gstamc.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/androidmedia/gstamc.c b/sys/androidmedia/gstamc.c index 53873c474..826174fd0 100644 --- a/sys/androidmedia/gstamc.c +++ b/sys/androidmedia/gstamc.c @@ -49,7 +49,7 @@ GST_DEBUG_CATEGORY (gst_amc_debug); GQuark gst_amc_codec_info_quark = 0; -static GList *codec_infos = NULL; +static GQueue codec_infos = G_QUEUE_INIT; #ifdef GST_AMC_IGNORE_UNKNOWN_COLOR_FORMATS static gboolean ignore_unknown_color_formats = TRUE; #else @@ -1398,7 +1398,7 @@ scan_codecs (GstPlugin * plugin) } } - codec_infos = g_list_append (codec_infos, gst_codec_info); + g_queue_push_tail (&codec_infos, gst_codec_info); } return TRUE; @@ -1852,7 +1852,7 @@ scan_codecs (GstPlugin * plugin) /* We need at least a valid supported type */ if (valid_codec) { GST_LOG ("Successfully scanned codec '%s'", name_str); - codec_infos = g_list_append (codec_infos, gst_codec_info); + g_queue_push_tail (&codec_infos, gst_codec_info); gst_codec_info = NULL; } @@ -1891,7 +1891,7 @@ scan_codecs (GstPlugin * plugin) valid_codec = TRUE; } - ret = codec_infos != NULL; + ret = codec_infos.length != 0; /* If successful we store a cache of the codec information in * the registry. Otherwise we would always load all codecs during @@ -1906,7 +1906,7 @@ scan_codecs (GstPlugin * plugin) g_value_init (&arr, GST_TYPE_ARRAY); - for (l = codec_infos; l; l = l->next) { + for (l = codec_infos.head; l; l = l->next) { GstAmcCodecInfo *gst_codec_info = l->data; GValue cv = { 0, }; GstStructure *cs = gst_structure_new_empty ("gst-amc-codec"); @@ -3187,7 +3187,7 @@ register_codecs (GstPlugin * plugin) GST_DEBUG ("Registering plugins"); - for (l = codec_infos; l; l = l->next) { + for (l = codec_infos.head; l; l = l->next) { GstAmcCodecInfo *codec_info = l->data; gboolean is_audio = FALSE; gboolean is_video = FALSE; |