Skip to content

Commit e7238be

Browse files
committed
gvstream: fix underrun count
Count only one underrun by frame id.
1 parent e0269e5 commit e7238be

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/arvgvstream.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ struct _ArvGvStreamThreadData {
162162

163163
gboolean use_packet_socket;
164164

165+
guint64 underrun_frame_id;
166+
165167
/* Statistics */
166168

167169
guint64 n_completed_buffers;
@@ -374,10 +376,13 @@ _find_frame_data (ArvGvStreamThreadData *thread_data,
374376

375377
buffer = arv_stream_pop_input_buffer (thread_data->stream);
376378
if (buffer == NULL) {
377-
thread_data->n_underruns++;
378-
379+
if (thread_data->underrun_frame_id != frame_id) {
380+
thread_data->n_underruns++;
381+
thread_data->underrun_frame_id = frame_id;
382+
}
379383
return NULL;
380384
}
385+
thread_data->underrun_frame_id = 0;
381386

382387
n_packets = _compute_n_expected_packets (packet,
383388
buffer->priv->allocated_size,

0 commit comments

Comments
 (0)