From ab0d1bc942447cb4bd02be606ef6e7629c97c9a7 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 30 Apr 2009 18:41:44 +0200 Subject: qtdemux: micro optimize qtdemux a little Sprinkle some G_LIKELY around. Avoid traversing and dumping the tree when debugging is not activated. --- gst/qtdemux/qtdemux_types.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gst/qtdemux/qtdemux_types.c') diff --git a/gst/qtdemux/qtdemux_types.c b/gst/qtdemux/qtdemux_types.c index d2b7e5a7..ef79d1d2 100644 --- a/gst/qtdemux/qtdemux_types.c +++ b/gst/qtdemux/qtdemux_types.c @@ -146,11 +146,12 @@ qtdemux_type_get (guint32 fourcc) int i; for (i = 0; i < n_qt_node_types; i++) { - if (qt_node_types[i].fourcc == fourcc) + if (G_UNLIKELY (qt_node_types[i].fourcc == fourcc)) return qt_node_types + i; } GST_WARNING ("unknown QuickTime node type %" GST_FOURCC_FORMAT, GST_FOURCC_ARGS (fourcc)); + return qt_node_types + n_qt_node_types - 1; } -- cgit