History

audio_frame_queue: Clean up ff_af_queue_log_state debug function

The function is debug-only, so only compile it in debug mode. Make it static as it has no uses outside of the file. Change av_log() to av_dlog().

Diego Biurrun committed 14 years ago

Commit d7f97861 parent 1ce5dce2 files · +10 −17Browse files

Unified · Split

2 files
  1. libavcodec/audio_frame_queue.c +10 −10
  2. libavcodec/audio_frame_queue.h +0 −7
libavcodec/audio_frame_queue.c+10−10
@@ -87,7 +87,7 @@ int ff_af_queue_add(AudioFrameQueue *afq, const AVFrame *f) · 86 unmodified lines
8787 afq->remaining_samples += f->nb_samples;
8888
8989 #ifdef DEBUG
90− ff_af_queue_log_state(afq);
90+ af_queue_log_state(afq);
9191 #endif
9292
9393 return 0;
@@ -100,7 +100,7 @@ void ff_af_queue_remove(AudioFrameQueue *afq, int nb_samples, int64_t *pts, · 6 unmodified lines
100100 int removed_samples = 0;
101101
102102 #ifdef DEBUG
103− ff_af_queue_log_state(afq);
103+ af_queue_log_state(afq);
104104 #endif
105105
106106 /* get output pts from the next frame or generated pts */
@@ -146,18 +146,18 @@ void ff_af_queue_remove(AudioFrameQueue *afq, int nb_samples, int64_t *pts, · 39 unmodified lines
146146 *duration = ff_samples_to_time_base(afq->avctx, removed_samples);
147147 }
148148
149−void ff_af_queue_log_state(AudioFrameQueue *afq)
149+#ifdef DEBUG
150+static void af_queue_log_state(AudioFrameQueue *afq)
150151 {
151152 AudioFrame *f;
152− av_log(afq->avctx, AV_LOG_DEBUG, "remaining delay = %d\n",
153− afq->remaining_delay);
154− av_log(afq->avctx, AV_LOG_DEBUG, "remaining samples = %d\n",
155− afq->remaining_samples);
156− av_log(afq->avctx, AV_LOG_DEBUG, "frames:\n");
153+ av_dlog(afq->avctx, "remaining delay = %d\n", afq->remaining_delay);
154+ av_dlog(afq->avctx, "remaining samples = %d\n", afq->remaining_samples);
155+ av_dlog(afq->avctx, "frames:\n");
157156 f = afq->frame_queue;
158157 while (f) {
159− av_log(afq->avctx, AV_LOG_DEBUG, " [ pts=%9"PRId64" duration=%d ]\n",
160− f->pts, f->duration);
158+ av_dlog(afq->avctx, " [ pts=%9"PRId64" duration=%d ]\n",
159+ f->pts, f->duration);
161160 f = f->next;
162161 }
163162 }
163+#endif /* DEBUG */
libavcodec/audio_frame_queue.h+0−7
@@ -80,11 +80,4 @@ int ff_af_queue_add(AudioFrameQueue *afq, const AVFrame *f); · 79 unmodified lines
8080 void ff_af_queue_remove(AudioFrameQueue *afq, int nb_samples, int64_t *pts,
8181 int *duration);
8282
83−/**
84− * Log the current state of the queue.
85− *
86− * @param afq queue context
87− */
88−void ff_af_queue_log_state(AudioFrameQueue *afq);
89−
9083 #endif /* AVCODEC_AUDIO_FRAME_QUEUE_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t