raw1394: sprinkle branch likeliness macros accross the code.
This commit is contained in:
parent
279be94321
commit
ef02d1da1d
@ -392,7 +392,7 @@ gst_dv1394src_iec61883_receive (unsigned char *data, int len,
|
|||||||
{
|
{
|
||||||
GstDV1394Src *dv1394src = GST_DV1394SRC (cbdata);
|
GstDV1394Src *dv1394src = GST_DV1394SRC (cbdata);
|
||||||
|
|
||||||
if (!GST_PAD_CAPS (GST_BASE_SRC_PAD (dv1394src))) {
|
if (G_UNLIKELY (!GST_PAD_CAPS (GST_BASE_SRC_PAD (dv1394src)))) {
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
unsigned char *p = data;
|
unsigned char *p = data;
|
||||||
|
|
||||||
@ -418,9 +418,10 @@ gst_dv1394src_iec61883_receive (unsigned char *data, int len,
|
|||||||
gst_pad_set_caps (GST_BASE_SRC_PAD (dv1394src), caps);
|
gst_pad_set_caps (GST_BASE_SRC_PAD (dv1394src), caps);
|
||||||
gst_caps_unref (caps);
|
gst_caps_unref (caps);
|
||||||
}
|
}
|
||||||
|
|
||||||
dv1394src->frame = NULL;
|
dv1394src->frame = NULL;
|
||||||
if ((dv1394src->frame_sequence + 1) % (dv1394src->skip +
|
if (G_LIKELY ((dv1394src->frame_sequence + 1) % (dv1394src->skip +
|
||||||
dv1394src->consecutive) < dv1394src->consecutive) {
|
dv1394src->consecutive) < dv1394src->consecutive)) {
|
||||||
if (complete && len == dv1394src->frame_size) {
|
if (complete && len == dv1394src->frame_size) {
|
||||||
gint64 i64;
|
gint64 i64;
|
||||||
guint8 *bufdata;
|
guint8 *bufdata;
|
||||||
@ -651,12 +652,13 @@ gst_dv1394src_create (GstPushSrc * psrc, GstBuffer ** buf)
|
|||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
int res = poll (pollfds, 2, -1);
|
int res = poll (pollfds, 2, -1);
|
||||||
|
|
||||||
if (res < 0) {
|
if (G_UNLIKELY (res < 0)) {
|
||||||
if (errno == EAGAIN || errno == EINTR)
|
if (errno == EAGAIN || errno == EINTR)
|
||||||
continue;
|
continue;
|
||||||
else
|
else
|
||||||
goto error_while_polling;
|
goto error_while_polling;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (G_UNLIKELY (pollfds[1].revents)) {
|
if (G_UNLIKELY (pollfds[1].revents)) {
|
||||||
char command;
|
char command;
|
||||||
|
|
||||||
|
@ -314,10 +314,10 @@ gst_hdv1394src_iec61883_receive (unsigned char *data, int len,
|
|||||||
GST_LOG ("data:%p, len:%d, dropped:%d", data, len, dropped);
|
GST_LOG ("data:%p, len:%d, dropped:%d", data, len, dropped);
|
||||||
|
|
||||||
/* error out if we don't have enough room ! */
|
/* error out if we don't have enough room ! */
|
||||||
if (dv1394src->outoffset > (2048 * 188 - len))
|
if (G_UNLIKELY (dv1394src->outoffset > (2048 * 188 - len)))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (len == IEC61883_MPEG2_TSP_SIZE) {
|
if (G_LIKELY (len == IEC61883_MPEG2_TSP_SIZE)) {
|
||||||
memcpy ((guint8 *) dv1394src->outdata + dv1394src->outoffset, data, len);
|
memcpy ((guint8 *) dv1394src->outdata + dv1394src->outoffset, data, len);
|
||||||
dv1394src->outoffset += len;
|
dv1394src->outoffset += len;
|
||||||
}
|
}
|
||||||
@ -408,12 +408,13 @@ gst_hdv1394src_create (GstPushSrc * psrc, GstBuffer ** buf)
|
|||||||
|
|
||||||
GST_LOG ("res:%d", res);
|
GST_LOG ("res:%d", res);
|
||||||
|
|
||||||
if (res < 0) {
|
if (G_UNLIKELY (res < 0)) {
|
||||||
if (errno == EAGAIN || errno == EINTR)
|
if (errno == EAGAIN || errno == EINTR)
|
||||||
continue;
|
continue;
|
||||||
else
|
else
|
||||||
goto error_while_polling;
|
goto error_while_polling;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (G_UNLIKELY (pollfds[1].revents)) {
|
if (G_UNLIKELY (pollfds[1].revents)) {
|
||||||
char command;
|
char command;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user