Browse code

Replace #ifdef + av_log() combinations by av_dlog().

Diego Biurrun authored on 2011/06/03 05:55:51
Showing 4 changed files
... ...
@@ -418,8 +418,8 @@ int ff_ivi_decode_blocks(GetBitContext *gb, IVIBandDesc *band, IVITile *tile)
418 418
                         break;
419 419
                     pos = band->scan[scan_pos];
420 420
 
421
-                    if (IVI_DEBUG && !val)
422
-                        av_log(NULL, AV_LOG_ERROR, "Val = 0 encountered!\n");
421
+                    if (!val)
422
+                        av_dlog(NULL, "Val = 0 encountered!\n");
423 423
 
424 424
                     q = (base_tab[pos] * quant) >> 9;
425 425
                     if (q > 1)
... ...
@@ -238,9 +238,9 @@ static int svq1_decode_block_intra (GetBitContext *bitbuf, uint8_t *pixels, int
238 238
     }
239 239
 
240 240
     if ((stages > 0) && (level >= 4)) {
241
-#ifdef DEBUG_SVQ1
242
-    av_log(s->avctx, AV_LOG_INFO, "Error (svq1_decode_block_intra): invalid vector: stages=%i level=%i\n",stages,level);
243
-#endif
241
+      av_dlog(s->avctx,
242
+              "Error (svq1_decode_block_intra): invalid vector: stages=%i level=%i\n",
243
+              stages, level);
244 244
       return -1;        /* invalid vector */
245 245
     }
246 246
 
... ...
@@ -288,9 +288,9 @@ static int svq1_decode_block_non_intra (GetBitContext *bitbuf, uint8_t *pixels,
288 288
     if (stages == -1) continue; /* skip vector */
289 289
 
290 290
     if ((stages > 0) && (level >= 4)) {
291
-#ifdef DEBUG_SVQ1
292
-    av_log(s->avctx, AV_LOG_INFO, "Error (svq1_decode_block_non_intra): invalid vector: stages=%i level=%i\n",stages,level);
293
-#endif
291
+      av_dlog(s->avctx,
292
+              "Error (svq1_decode_block_non_intra): invalid vector: stages=%i level=%i\n",
293
+              stages, level);
294 294
       return -1;        /* invalid vector */
295 295
     }
296 296
 
... ...
@@ -499,9 +499,7 @@ static int svq1_decode_delta_block (MpegEncContext *s, GetBitContext *bitbuf,
499 499
 
500 500
     if (result != 0)
501 501
     {
502
-#ifdef DEBUG_SVQ1
503
-    av_log(s->avctx, AV_LOG_INFO, "Error in svq1_motion_inter_block %i\n",result);
504
-#endif
502
+      av_dlog(s->avctx, "Error in svq1_motion_inter_block %i\n", result);
505 503
       break;
506 504
     }
507 505
     result = svq1_decode_block_non_intra (bitbuf, current, pitch);
... ...
@@ -512,9 +510,7 @@ static int svq1_decode_delta_block (MpegEncContext *s, GetBitContext *bitbuf,
512 512
 
513 513
     if (result != 0)
514 514
     {
515
-#ifdef DEBUG_SVQ1
516
-    av_log(s->avctx, AV_LOG_INFO, "Error in svq1_motion_inter_4v_block %i\n",result);
517
-#endif
515
+      av_dlog(s->avctx, "Error in svq1_motion_inter_4v_block %i\n", result);
518 516
       break;
519 517
     }
520 518
     result = svq1_decode_block_non_intra (bitbuf, current, pitch);
... ...
@@ -660,9 +656,7 @@ static int svq1_decode_frame(AVCodecContext *avctx,
660 660
 
661 661
   if (result != 0)
662 662
   {
663
-#ifdef DEBUG_SVQ1
664
-    av_log(s->avctx, AV_LOG_INFO, "Error in svq1_decode_frame_header %i\n",result);
665
-#endif
663
+    av_dlog(s->avctx, "Error in svq1_decode_frame_header %i\n",result);
666 664
     return result;
667 665
   }
668 666
 
... ...
@@ -729,9 +723,7 @@ static int svq1_decode_frame(AVCodecContext *avctx,
729 729
                                             linesize, pmv, x, y);
730 730
           if (result != 0)
731 731
           {
732
-#ifdef DEBUG_SVQ1
733
-    av_log(s->avctx, AV_LOG_INFO, "Error in svq1_decode_delta_block %i\n",result);
734
-#endif
732
+            av_dlog(s->avctx, "Error in svq1_decode_delta_block %i\n",result);
735 733
             goto err;
736 734
           }
737 735
         }
... ...
@@ -370,9 +370,7 @@ static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc)
370 370
                     float last = 0.0;
371 371
                     unsigned lookup_offset = i;
372 372
 
373
-#ifdef V_DEBUG
374
-                    av_log(vc->avccontext, AV_LOG_INFO, "Lookup offset %u ,", i);
375
-#endif
373
+                    av_dlog(vc->avccontext, "Lookup offset %u ,", i);
376 374
 
377 375
                     for (k = 0; k < dim; ++k) {
378 376
                         unsigned multiplicand_offset = lookup_offset % codebook_lookup_values;
... ...
@@ -383,12 +381,11 @@ static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc)
383 383
                     }
384 384
                     tmp_vlc_bits[j] = tmp_vlc_bits[i];
385 385
 
386
-#ifdef V_DEBUG
387
-                    av_log(vc->avccontext, AV_LOG_INFO, "real lookup offset %u, vector: ", j);
386
+                    av_dlog(vc->avccontext, "real lookup offset %u, vector: ", j);
388 387
                     for (k = 0; k < dim; ++k)
389
-                        av_log(vc->avccontext, AV_LOG_INFO, " %f ", codebook_setup->codevectors[j * dim + k]);
390
-                    av_log(vc->avccontext, AV_LOG_INFO, "\n");
391
-#endif
388
+                        av_dlog(vc->avccontext, " %f ",
389
+                                codebook_setup->codevectors[j * dim + k]);
390
+                    av_dlog(vc->avccontext, "\n");
392 391
 
393 392
                     ++j;
394 393
                 }
... ...
@@ -177,15 +177,13 @@ restart_poll:
177 177
             av_log(context, AV_LOG_ERROR, "Failed to get status: %s\n", strerror(errno));
178 178
             return AVERROR(EIO);
179 179
         }
180
-#ifdef DV1394_DEBUG
181
-        av_log(context, AV_LOG_DEBUG, "DV1394: status\n"
180
+        av_dlog(context, "DV1394: status\n"
182 181
                 "\tactive_frame\t%d\n"
183 182
                 "\tfirst_clear_frame\t%d\n"
184 183
                 "\tn_clear_frames\t%d\n"
185 184
                 "\tdropped_frames\t%d\n",
186 185
                 s.active_frame, s.first_clear_frame,
187 186
                 s.n_clear_frames, s.dropped_frames);
188
-#endif
189 187
 
190 188
         dv->avail = s.n_clear_frames;
191 189
         dv->index = s.first_clear_frame;
... ...
@@ -200,10 +198,8 @@ restart_poll:
200 200
         }
201 201
     }
202 202
 
203
-#ifdef DV1394_DEBUG
204
-    av_log(context, AV_LOG_DEBUG, "index %d, avail %d, done %d\n", dv->index, dv->avail,
203
+    av_dlog(context, "index %d, avail %d, done %d\n", dv->index, dv->avail,
205 204
             dv->done);
206
-#endif
207 205
 
208 206
     size = dv_produce_packet(dv->dv_demux, pkt,
209 207
                              dv->ring + (dv->index * DV1394_PAL_FRAME_SIZE),