filesink: Fix for updating the index of memory to write in the next iteration

current_buf_mem_idx stands for the index of memory of the corresponding
buffer which is scheduled to be written in the next iteration.
If all memory objects were scheduled to be written in the current
iteration, reset the index to zero so that starting from the first
memory object of the next buffer.
This commit is contained in:
Seungha Yang 2020-03-31 19:05:30 +09:00
parent 5c74c8c4f8
commit 13bee5ae0c

View file

@ -535,9 +535,11 @@ gst_writev_buffer_list (GstObject * sink, gint fd, GstPoll * fdset,
left += vecs[num_vecs].iov_len;
num_vecs++;
}
current_buf_mem_idx = j;
if (j == num_mem)
current_buf_mem_idx = 0;
}
current_buf_idx = i;
current_buf_mem_idx = j;
}
do {
@ -622,9 +624,11 @@ gst_writev_buffer_list (GstObject * sink, gint fd, GstPoll * fdset,
left += vecs[num_vecs].iov_len;
num_vecs++;
}
current_buf_mem_idx = j;
if (current_buf_mem_idx == num_mem)
current_buf_mem_idx = 0;
}
current_buf_idx = i;
current_buf_mem_idx = j;
}
} while (left > 0);