[ekiga] Simplified the gst_helper_get_frame_data in the gstreamer plugin -- that solves a crash issue
- From: Julien Puydt <jpuydt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ekiga] Simplified the gst_helper_get_frame_data in the gstreamer plugin -- that solves a crash issue
- Date: Wed, 26 Sep 2012 09:46:21 +0000 (UTC)
commit 95a69c65100f89bb4bcf2cb1047195647ac1ebde
Author: Julien Puydt <jpuydt free fr>
Date: Wed Sep 26 11:43:37 2012 +0200
Simplified the gst_helper_get_frame_data in the gstreamer plugin -- that solves a crash issue
plugins/gstreamer/gst-helper.cpp | 18 ++++++------------
1 files changed, 6 insertions(+), 12 deletions(-)
---
diff --git a/plugins/gstreamer/gst-helper.cpp b/plugins/gstreamer/gst-helper.cpp
index c27cddb..62db9a5 100644
--- a/plugins/gstreamer/gst-helper.cpp
+++ b/plugins/gstreamer/gst-helper.cpp
@@ -94,23 +94,17 @@ gst_helper_get_frame_data (gst_helper* self,
{
bool result = false;
GstBuffer* buffer = NULL;
- unsigned cpy_size;
read = 0;
- while (read < size) {
+ buffer = gst_app_sink_pull_buffer (GST_APP_SINK (self->active));
- buffer = gst_app_sink_pull_buffer (GST_APP_SINK (self->active));
+ if (buffer != NULL) {
- if (buffer != NULL) {
-
- cpy_size = MIN(GST_BUFFER_SIZE (buffer), size-read);
- memcpy (data+read, GST_BUFFER_DATA (buffer), cpy_size);
- read += cpy_size;
- gst_buffer_unref (buffer);
- result = true;
- } else
- break;
+ read = MIN(GST_BUFFER_SIZE (buffer), size);
+ memcpy (data, GST_BUFFER_DATA (buffer), read);
+ gst_buffer_unref (buffer);
+ result = true;
}
return result;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]