[aravis] gv_stream: frame_id can never be 0
- From: Emmanuel Pacaud <emmanuel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [aravis] gv_stream: frame_id can never be 0
- Date: Sun, 5 Oct 2014 14:06:37 +0000 (UTC)
commit cbe0886a5c012b36ca2a10694662d2337f121330
Author: Emmanuel Pacaud <emmanuel gnome org>
Date: Sun Oct 5 16:05:35 2014 +0200
gv_stream: frame_id can never be 0
Take that into account when computing frame_id_inc.
src/arvgvstream.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/arvgvstream.c b/src/arvgvstream.c
index 7108344..073ce0e 100644
--- a/src/arvgvstream.c
+++ b/src/arvgvstream.c
@@ -35,6 +35,7 @@
#include <arvenumtypes.h>
#include <string.h>
#include <sys/socket.h>
+#include <stdio.h>
#define ARV_GV_STREAM_INCOMING_BUFFER_SIZE 65536
@@ -314,6 +315,9 @@ _find_frame_data (ArvGvStreamThreadData *thread_data,
}
frame_id_inc = (gint16) frame_id - (gint16) thread_data->last_frame_id;
+ /* Frame id 0 is not a valid value */
+ if ((gint16) frame_id > 0 && (gint16) thread_data->last_frame_id < 0)
+ frame_id_inc--;
if (frame_id_inc < 1 && frame_id_inc > -ARV_GV_STREAM_DISCARD_LATE_FRAME_THRESHOLD) {
arv_debug_stream_thread ("[GvStream::_find_frame_data] Discard late frame %u (last: %u)",
frame_id, thread_data->last_frame_id);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]