Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

vda: cosmetic.

  • Loading branch information...
commit 6e1e49385ead7bdc24474fd8b3f435cf6f766cd5 1 parent a40867f
Sebastien Zwickert dilaroga authored

Showing 1 changed file with 17 additions and 17 deletions. Show diff stats Hide diff stats

  1. +17 17 libavcodec/vda.c
34 libavcodec/vda.c
@@ -78,7 +78,7 @@ static int64_t vda_pts_from_dictionary(CFDictionaryRef user_info)
78 78 CFNumberRef pts;
79 79 int64_t outValue = 0;
80 80
81   - if (NULL == user_info)
  81 + if (!user_info)
82 82 return 0;
83 83
84 84 pts = CFDictionaryGetValue(user_info, CFSTR("FF_VDA_DECODER_PTS_KEY"));
@@ -96,7 +96,7 @@ static void vda_clear_queue(struct vda_context *vda_ctx)
96 96
97 97 vda_lock_operation(&vda_ctx->queue_mutex, AV_LOCK_OBTAIN);
98 98
99   - while (vda_ctx->queue != NULL)
  99 + while (vda_ctx->queue)
100 100 {
101 101 top_frame = vda_ctx->queue;
102 102 vda_ctx->queue = top_frame->next_frame;
@@ -118,7 +118,7 @@ static void vda_decoder_callback (void *vda_hw_ctx,
118 118 vda_frame *new_frame;
119 119 vda_frame *queue_walker;
120 120
121   - if (NULL == image_buffer)
  121 + if (!image_buffer)
122 122 return;
123 123
124 124 if (vda_ctx->cv_pix_fmt_type != CVPixelBufferGetPixelFormatType(image_buffer))
@@ -183,10 +183,10 @@ int ff_vda_create_decoder(struct vda_context *vda_ctx,
183 183
184 184 vda_lock_operation(&vda_ctx->queue_mutex, AV_LOCK_CREATE);
185 185
186   - config_info = (CFDictionaryCreateMutable(kCFAllocatorDefault,
187   - 4,
188   - &kCFTypeDictionaryKeyCallBacks,
189   - &kCFTypeDictionaryValueCallBacks));
  186 + config_info = CFDictionaryCreateMutable(kCFAllocatorDefault,
  187 + 4,
  188 + &kCFTypeDictionaryKeyCallBacks,
  189 + &kCFTypeDictionaryValueCallBacks);
190 190
191 191 height = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &vda_ctx->height);
192 192 width = CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &vda_ctx->width);
@@ -198,14 +198,14 @@ int ff_vda_create_decoder(struct vda_context *vda_ctx,
198 198 CFDictionarySetValue(config_info, kVDADecoderConfiguration_SourceFormat, format);
199 199 CFDictionarySetValue(config_info, kVDADecoderConfiguration_avcCData, avc_data);
200 200
201   - buffer_attributes = (CFDictionaryCreateMutable(kCFAllocatorDefault,
202   - 2,
203   - &kCFTypeDictionaryKeyCallBacks,
204   - &kCFTypeDictionaryValueCallBacks));
205   - io_surface_properties = (CFDictionaryCreateMutable(kCFAllocatorDefault,
206   - 0,
207   - &kCFTypeDictionaryKeyCallBacks,
208   - &kCFTypeDictionaryValueCallBacks));
  201 + buffer_attributes = CFDictionaryCreateMutable(kCFAllocatorDefault,
  202 + 2,
  203 + &kCFTypeDictionaryKeyCallBacks,
  204 + &kCFTypeDictionaryValueCallBacks);
  205 + io_surface_properties = CFDictionaryCreateMutable(kCFAllocatorDefault,
  206 + 0,
  207 + &kCFTypeDictionaryKeyCallBacks,
  208 + &kCFTypeDictionaryValueCallBacks);
209 209 cv_pix_fmt = CFNumberCreate(kCFAllocatorDefault,
210 210 kCFNumberSInt32Type,
211 211 &vda_ctx->cv_pix_fmt_type);
@@ -246,7 +246,7 @@ int ff_vda_destroy_decoder(struct vda_context *vda_ctx)
246 246
247 247 vda_clear_queue(vda_ctx);
248 248
249   - if (vda_ctx->queue_mutex != NULL)
  249 + if (vda_ctx->queue_mutex)
250 250 vda_lock_operation(&vda_ctx->queue_mutex, AV_LOCK_DESTROY);
251 251
252 252 if (vda_ctx->bitstream)
@@ -275,7 +275,7 @@ vda_frame *ff_vda_queue_pop(struct vda_context *vda_ctx)
275 275
276 276 void ff_vda_release_vda_frame(vda_frame *frame)
277 277 {
278   - if (frame != NULL)
  278 + if (frame)
279 279 {
280 280 CVPixelBufferRelease(frame->cv_buffer);
281 281 av_freep(&frame);

0 comments on commit 6e1e493

Please sign in to comment.
Something went wrong with that request. Please try again.