diff options
author | iphydf <iphydf@users.noreply.github.com> | 2018-01-28 21:30:39 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2018-01-30 23:35:50 +0000 |
commit | 92ffad1a72bc8c422426d52ac408bd71242dd047 (patch) | |
tree | f592f353068dd2043525dd2cc04d6124a4ed4bc4 /toxav/video.c | |
parent | 623e9ac331df7323660e21c8a2226523a5ee713b (diff) |
Use nullptr as NULL pointer constant instead of NULL or 0.
This changes only code, no string literals or comments.
Diffstat (limited to 'toxav/video.c')
-rw-r--r-- | toxav/video.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/toxav/video.c b/toxav/video.c index c84e89f7..eee542a2 100644 --- a/toxav/video.c +++ b/toxav/video.c | |||
@@ -43,20 +43,20 @@ VCSession *vc_new(Logger *log, ToxAV *av, uint32_t friend_number, toxav_video_re | |||
43 | 43 | ||
44 | if (!vc) { | 44 | if (!vc) { |
45 | LOGGER_WARNING(log, "Allocation failed! Application might misbehave!"); | 45 | LOGGER_WARNING(log, "Allocation failed! Application might misbehave!"); |
46 | return NULL; | 46 | return nullptr; |
47 | } | 47 | } |
48 | 48 | ||
49 | if (create_recursive_mutex(vc->queue_mutex) != 0) { | 49 | if (create_recursive_mutex(vc->queue_mutex) != 0) { |
50 | LOGGER_WARNING(log, "Failed to create recursive mutex!"); | 50 | LOGGER_WARNING(log, "Failed to create recursive mutex!"); |
51 | free(vc); | 51 | free(vc); |
52 | return NULL; | 52 | return nullptr; |
53 | } | 53 | } |
54 | 54 | ||
55 | if (!(vc->vbuf_raw = rb_new(VIDEO_DECODE_BUFFER_SIZE))) { | 55 | if (!(vc->vbuf_raw = rb_new(VIDEO_DECODE_BUFFER_SIZE))) { |
56 | goto BASE_CLEANUP; | 56 | goto BASE_CLEANUP; |
57 | } | 57 | } |
58 | 58 | ||
59 | rc = vpx_codec_dec_init(vc->decoder, VIDEO_CODEC_DECODER_INTERFACE, NULL, 0); | 59 | rc = vpx_codec_dec_init(vc->decoder, VIDEO_CODEC_DECODER_INTERFACE, nullptr, 0); |
60 | 60 | ||
61 | if (rc != VPX_CODEC_OK) { | 61 | if (rc != VPX_CODEC_OK) { |
62 | LOGGER_ERROR(log, "Init video_decoder failed: %s", vpx_codec_err_to_string(rc)); | 62 | LOGGER_ERROR(log, "Init video_decoder failed: %s", vpx_codec_err_to_string(rc)); |
@@ -118,7 +118,7 @@ BASE_CLEANUP: | |||
118 | pthread_mutex_destroy(vc->queue_mutex); | 118 | pthread_mutex_destroy(vc->queue_mutex); |
119 | rb_kill((RingBuffer *)vc->vbuf_raw); | 119 | rb_kill((RingBuffer *)vc->vbuf_raw); |
120 | free(vc); | 120 | free(vc); |
121 | return NULL; | 121 | return nullptr; |
122 | } | 122 | } |
123 | void vc_kill(VCSession *vc) | 123 | void vc_kill(VCSession *vc) |
124 | { | 124 | { |
@@ -157,13 +157,13 @@ void vc_iterate(VCSession *vc) | |||
157 | if (rb_read((RingBuffer *)vc->vbuf_raw, (void **)&p)) { | 157 | if (rb_read((RingBuffer *)vc->vbuf_raw, (void **)&p)) { |
158 | pthread_mutex_unlock(vc->queue_mutex); | 158 | pthread_mutex_unlock(vc->queue_mutex); |
159 | 159 | ||
160 | rc = vpx_codec_decode(vc->decoder, p->data, p->len, NULL, MAX_DECODE_TIME_US); | 160 | rc = vpx_codec_decode(vc->decoder, p->data, p->len, nullptr, MAX_DECODE_TIME_US); |
161 | free(p); | 161 | free(p); |
162 | 162 | ||
163 | if (rc != VPX_CODEC_OK) { | 163 | if (rc != VPX_CODEC_OK) { |
164 | LOGGER_ERROR(vc->log, "Error decoding video: %s", vpx_codec_err_to_string(rc)); | 164 | LOGGER_ERROR(vc->log, "Error decoding video: %s", vpx_codec_err_to_string(rc)); |
165 | } else { | 165 | } else { |
166 | vpx_codec_iter_t iter = NULL; | 166 | vpx_codec_iter_t iter = nullptr; |
167 | vpx_image_t *dest = vpx_codec_get_frame(vc->decoder, &iter); | 167 | vpx_image_t *dest = vpx_codec_get_frame(vc->decoder, &iter); |
168 | 168 | ||
169 | /* Play decoded images */ | 169 | /* Play decoded images */ |