diff options
author | Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> | 2010-06-15 11:20:21 +0200 |
---|---|---|
committer | Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> | 2010-06-15 11:30:45 +0200 |
commit | a60af008d5871e5d65333e7f991e3fc708b852a1 (patch) | |
tree | 8316b54b4f4c34dcb559a91e8a8eb5e840aea4e8 /gst/mpeg4videoparse | |
parent | cd018e544037b3898c1e8cac610aa71fce9d6abd (diff) | |
download | gstreamer-plugins-bad-a60af008d5871e5d65333e7f991e3fc708b852a1.tar.gz |
mpeg4videoparse: sprinkle some branch prediction
Diffstat (limited to 'gst/mpeg4videoparse')
-rw-r--r-- | gst/mpeg4videoparse/mpeg4videoparse.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gst/mpeg4videoparse/mpeg4videoparse.c b/gst/mpeg4videoparse/mpeg4videoparse.c index e13f82ddc..af63b5894 100644 --- a/gst/mpeg4videoparse/mpeg4videoparse.c +++ b/gst/mpeg4videoparse/mpeg4videoparse.c @@ -482,7 +482,7 @@ gst_mpeg4vparse_push (GstMpeg4VParse * parse, gsize size) out_buf = gst_adapter_take_buffer (parse->adapter, parse->offset); GST_BUFFER_TIMESTAMP (out_buf) = parse->timestamp; - if (out_buf) { + if (G_LIKELY (out_buf)) { /* Set GST_BUFFER_FLAG_DELTA_UNIT if it's not an intra frame */ if (!parse->intra_frame) { GST_BUFFER_FLAG_SET (out_buf, GST_BUFFER_FLAG_DELTA_UNIT); @@ -491,12 +491,12 @@ gst_mpeg4vparse_push (GstMpeg4VParse * parse, gsize size) guint64 diff; /* init */ - if (!GST_CLOCK_TIME_IS_VALID (parse->last_report)) { + if (G_UNLIKELY (!GST_CLOCK_TIME_IS_VALID (parse->last_report))) { parse->last_report = timestamp; } /* insert on intra frames */ - if (timestamp > parse->last_report) + if (G_LIKELY (timestamp > parse->last_report)) diff = timestamp - parse->last_report; else diff = 0; @@ -509,7 +509,7 @@ gst_mpeg4vparse_push (GstMpeg4VParse * parse, gsize size) "interval since last config %" GST_TIME_FORMAT, GST_TIME_ARGS (diff)); - if (GST_TIME_AS_SECONDS (diff) >= parse->interval) { + if (G_UNLIKELY (GST_TIME_AS_SECONDS (diff) >= parse->interval)) { /* we need to send config now first */ GstBuffer *superbuf; @@ -522,7 +522,7 @@ gst_mpeg4vparse_push (GstMpeg4VParse * parse, gsize size) gst_buffer_unref (out_buf); out_buf = superbuf; - if (timestamp != -1) { + if (G_UNLIKELY (timestamp != -1)) { parse->last_report = timestamp; } } |