Skip to content

Commit 8f6b74f

Browse files
author
Alain Volmat
committed
samples: usb: uvc: ensure video buffer is properly aligned
Honor the CONFIG_VIDEO_BUFFER_POOL_ALIGN config by using the video_buffer_aligned_alloc function instead of video_buffer_alloc in order to provide properly aligned buffers to drivers. Signed-off-by: Alain Volmat <[email protected]>
1 parent bda979e commit 8f6b74f

File tree

1 file changed

+1
-1
lines changed
  • samples/subsys/usb/uvc/src

1 file changed

+1
-1
lines changed

samples/subsys/usb/uvc/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ int main(void)
183183
LOG_INF("Preparing %u buffers of %u bytes", CONFIG_VIDEO_BUFFER_POOL_NUM_MAX, bsize);
184184

185185
for (int i = 0; i < CONFIG_VIDEO_BUFFER_POOL_NUM_MAX; i++) {
186-
vbuf = video_buffer_alloc(bsize, K_NO_WAIT);
186+
vbuf = video_buffer_aligned_alloc(bsize, CONFIG_VIDEO_BUFFER_POOL_ALIGN, K_NO_WAIT);
187187
if (vbuf == NULL) {
188188
LOG_ERR("Could not allocate the video buffer");
189189
return -ENOMEM;

0 commit comments

Comments
 (0)