summaryrefslogtreecommitdiff
path: root/toxav/video.c
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2018-07-19 22:05:43 +0000
committeriphydf <iphydf@users.noreply.github.com>2018-07-21 15:09:39 +0000
commit7c2b95ef5e4ccdae01bd104aa7400294c9ea391b (patch)
tree78cf7c6136cc65622894e8ca316f3796bcd23a6f /toxav/video.c
parentadb12d5340431d9de5995da37ea7aca01e675da3 (diff)
Remove redundant casts to the same type.
Also removed an unused identifier in messenger_test.c.
Diffstat (limited to 'toxav/video.c')
-rw-r--r--toxav/video.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/toxav/video.c b/toxav/video.c
index 55bb5d13..6a5672e3 100644
--- a/toxav/video.c
+++ b/toxav/video.c
@@ -268,7 +268,7 @@ BASE_CLEANUP_1:
268 vpx_codec_destroy(vc->decoder); 268 vpx_codec_destroy(vc->decoder);
269BASE_CLEANUP: 269BASE_CLEANUP:
270 pthread_mutex_destroy(vc->queue_mutex); 270 pthread_mutex_destroy(vc->queue_mutex);
271 rb_kill((RingBuffer *)vc->vbuf_raw); 271 rb_kill(vc->vbuf_raw);
272 free(vc); 272 free(vc);
273 return nullptr; 273 return nullptr;
274} 274}
@@ -283,11 +283,11 @@ void vc_kill(VCSession *vc)
283 vpx_codec_destroy(vc->decoder); 283 vpx_codec_destroy(vc->decoder);
284 void *p; 284 void *p;
285 285
286 while (rb_read((RingBuffer *)vc->vbuf_raw, &p)) { 286 while (rb_read(vc->vbuf_raw, &p)) {
287 free(p); 287 free(p);
288 } 288 }
289 289
290 rb_kill((RingBuffer *)vc->vbuf_raw); 290 rb_kill(vc->vbuf_raw);
291 pthread_mutex_destroy(vc->queue_mutex); 291 pthread_mutex_destroy(vc->queue_mutex);
292 LOGGER_DEBUG(vc->log, "Terminated video handler: %p", (void *)vc); 292 LOGGER_DEBUG(vc->log, "Terminated video handler: %p", (void *)vc);
293 free(vc); 293 free(vc);
@@ -303,7 +303,7 @@ void vc_iterate(VCSession *vc)
303 303
304 struct RTPMessage *p; 304 struct RTPMessage *p;
305 305
306 if (!rb_read((RingBuffer *)vc->vbuf_raw, (void **)&p)) { 306 if (!rb_read(vc->vbuf_raw, (void **)&p)) {
307 LOGGER_TRACE(vc->log, "no Video frame data available"); 307 LOGGER_TRACE(vc->log, "no Video frame data available");
308 pthread_mutex_unlock(vc->queue_mutex); 308 pthread_mutex_unlock(vc->queue_mutex);
309 return; 309 return;
@@ -323,7 +323,7 @@ void vc_iterate(VCSession *vc)
323 } 323 }
324 324
325 LOGGER_DEBUG(vc->log, "vc_iterate: rb_read p->len=%d p->header.xe=%d", (int)full_data_len, p->header.xe); 325 LOGGER_DEBUG(vc->log, "vc_iterate: rb_read p->len=%d p->header.xe=%d", (int)full_data_len, p->header.xe);
326 LOGGER_DEBUG(vc->log, "vc_iterate: rb_read rb size=%d", (int)rb_size((RingBuffer *)vc->vbuf_raw)); 326 LOGGER_DEBUG(vc->log, "vc_iterate: rb_read rb size=%d", (int)rb_size(vc->vbuf_raw));
327 const vpx_codec_err_t rc = vpx_codec_decode(vc->decoder, p->data, full_data_len, nullptr, MAX_DECODE_TIME_US); 327 const vpx_codec_err_t rc = vpx_codec_decode(vc->decoder, p->data, full_data_len, nullptr, MAX_DECODE_TIME_US);
328 free(p); 328 free(p);
329 329
@@ -378,7 +378,7 @@ int vc_queue_message(void *vcp, struct RTPMessage *msg)
378 LOGGER_DEBUG(vc->log, "rb_write msg->len=%d b0=%d b1=%d", (int)msg->len, (int)msg->data[0], (int)msg->data[1]); 378 LOGGER_DEBUG(vc->log, "rb_write msg->len=%d b0=%d b1=%d", (int)msg->len, (int)msg->data[0], (int)msg->data[1]);
379 } 379 }
380 380
381 free(rb_write((RingBuffer *)vc->vbuf_raw, msg)); 381 free(rb_write(vc->vbuf_raw, msg));
382 382
383 /* Calculate time it took for peer to send us this frame */ 383 /* Calculate time it took for peer to send us this frame */
384 uint32_t t_lcfd = current_time_monotonic() - vc->linfts; 384 uint32_t t_lcfd = current_time_monotonic() - vc->linfts;