From e99c13120f1b51c25fbb20dc2763889b2b12795a Mon Sep 17 00:00:00 2001 From: iphydf Date: Sun, 12 Aug 2018 20:59:35 +0000 Subject: Change while-loop to for-loop to express for-each-frame. * Assignments can't be used as expressions, therefore `while` loops should not be used as a `for-each` construct. Use `for`, instead. --- toxav/video.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'toxav') diff --git a/toxav/video.c b/toxav/video.c index 4f9d8c84..5a160d37 100644 --- a/toxav/video.c +++ b/toxav/video.c @@ -343,9 +343,10 @@ void vc_iterate(VCSession *vc) /* Play decoded images */ vpx_codec_iter_t iter = nullptr; - vpx_image_t *dest = nullptr; - while ((dest = vpx_codec_get_frame(vc->decoder, &iter)) != nullptr) { + for (vpx_image_t *dest = vpx_codec_get_frame(vc->decoder, &iter); + dest != nullptr; + dest = vpx_codec_get_frame(vc->decoder, &iter)) { if (vc->vcb) { vc->vcb(vc->av, vc->friend_number, dest->d_w, dest->d_h, (const uint8_t *)dest->planes[0], (const uint8_t *)dest->planes[1], (const uint8_t *)dest->planes[2], -- cgit v1.2.3