From 935f4690815111ab5bcea93fbbfa765d4d6e2440 Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Mon, 18 Sep 2006 15:48:01 +0000 Subject: [PATCH] gst/videotestsrc/gstvideotestsrc.c: Use G_UNLIKELY in _create and log one more detail. Original commit message from CVS: * gst/videotestsrc/gstvideotestsrc.c: Use G_UNLIKELY in _create and log one more detail. (gst_video_test_src_get_times), (gst_video_test_src_create): * sys/ximage/ximagesink.c: (gst_ximagesink_get_times): Use gst_util_uint64_scale_int in _get_times(). --- ChangeLog | 9 +++++++++ gst/videotestsrc/gstvideotestsrc.c | 9 +++++---- sys/ximage/ximagesink.c | 4 +++- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2a1858c..d6aa5ce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2006-09-18 Stefan Kost + * gst/videotestsrc/gstvideotestsrc.c: + Use G_UNLIKELY in _create and log one more detail. + + (gst_video_test_src_get_times), (gst_video_test_src_create): + * sys/ximage/ximagesink.c: (gst_ximagesink_get_times): + Use gst_util_uint64_scale_int in _get_times(). + +2006-09-18 Stefan Kost + * sys/xvimage/xvimagesink.c: (gst_xvimagesink_get_xv_support) Give better warning message (add object and detail). diff --git a/gst/videotestsrc/gstvideotestsrc.c b/gst/videotestsrc/gstvideotestsrc.c index b5d5898..3c9255f 100644 --- a/gst/videotestsrc/gstvideotestsrc.c +++ b/gst/videotestsrc/gstvideotestsrc.c @@ -517,19 +517,20 @@ gst_video_test_src_create (GstPushSrc * psrc, GstBuffer ** buffer) src = GST_VIDEO_TEST_SRC (psrc); - if (src->fourcc == NULL) + if (G_UNLIKELY (src->fourcc == NULL)) goto not_negotiated; /* 0 framerate and we are at the second frame, eos */ - if (src->rate_numerator == 0 && src->n_frames == 1) + if (G_UNLIKELY (src->rate_numerator == 0 && src->n_frames == 1)) goto eos; newsize = gst_video_test_src_get_size (src, src->width, src->height); g_return_val_if_fail (newsize > 0, GST_FLOW_ERROR); - GST_LOG_OBJECT (src, "creating buffer of %ld bytes for %dx%d image", - newsize, src->width, src->height); + GST_LOG_OBJECT (src, + "creating buffer of %ld bytes with %dx%d image for frame %d", newsize, + src->width, src->height, src->n_frames); #ifdef USE_PEER_BUFFERALLOC res = diff --git a/sys/ximage/ximagesink.c b/sys/ximage/ximagesink.c index 40480db..711451b 100644 --- a/sys/ximage/ximagesink.c +++ b/sys/ximage/ximagesink.c @@ -1452,7 +1452,9 @@ gst_ximagesink_get_times (GstBaseSink * bsink, GstBuffer * buf, *end = *start + GST_BUFFER_DURATION (buf); } else { if (ximagesink->fps_n > 0) { - *end = *start + (GST_SECOND * ximagesink->fps_d) / ximagesink->fps_n; + *end = *start + + gst_util_uint64_scale_int (GST_SECOND, ximagesink->fps_d, + ximagesink->fps_n); } } } -- 2.7.4