diff options
author | iphydf <iphydf@users.noreply.github.com> | 2018-08-12 20:59:35 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2018-08-25 20:39:24 +0000 |
commit | e99c13120f1b51c25fbb20dc2763889b2b12795a (patch) | |
tree | 313946172c8da8b432888d3678aec14ac87145d9 /toxav | |
parent | d380c411317db1baa176ce525fec5919a4cbdff6 (diff) |
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.
Diffstat (limited to 'toxav')
-rw-r--r-- | toxav/video.c | 5 |
1 files changed, 3 insertions, 2 deletions
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) | |||
343 | 343 | ||
344 | /* Play decoded images */ | 344 | /* Play decoded images */ |
345 | vpx_codec_iter_t iter = nullptr; | 345 | vpx_codec_iter_t iter = nullptr; |
346 | vpx_image_t *dest = nullptr; | ||
347 | 346 | ||
348 | while ((dest = vpx_codec_get_frame(vc->decoder, &iter)) != nullptr) { | 347 | for (vpx_image_t *dest = vpx_codec_get_frame(vc->decoder, &iter); |
348 | dest != nullptr; | ||
349 | dest = vpx_codec_get_frame(vc->decoder, &iter)) { | ||
349 | if (vc->vcb) { | 350 | if (vc->vcb) { |
350 | vc->vcb(vc->av, vc->friend_number, dest->d_w, dest->d_h, | 351 | vc->vcb(vc->av, vc->friend_number, dest->d_w, dest->d_h, |
351 | (const uint8_t *)dest->planes[0], (const uint8_t *)dest->planes[1], (const uint8_t *)dest->planes[2], | 352 | (const uint8_t *)dest->planes[0], (const uint8_t *)dest->planes[1], (const uint8_t *)dest->planes[2], |