Skip to content

Commit a0616bc

Browse files
committed
gvstream: fix underrun count
Count only one underrun by frame id.
1 parent 6f630fa commit a0616bc

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;
@@ -373,10 +375,13 @@ _find_frame_data (ArvGvStreamThreadData *thread_data,
373375

374376
buffer = arv_stream_pop_input_buffer (thread_data->stream);
375377
if (buffer == NULL) {
376-
thread_data->n_underruns++;
377-
378+
if (thread_data->underrun_frame_id != frame_id) {
379+
thread_data->n_underruns++;
380+
thread_data->underrun_frame_id = frame_id;
381+
}
378382
return NULL;
379383
}
384+
thread_data->underrun_frame_id = 0;
380385

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

0 commit comments

Comments
 (0)