Commit d7f9786c authored by Diego Biurrun's avatar Diego Biurrun

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().
parent 1ce5dce4
...@@ -87,7 +87,7 @@ int ff_af_queue_add(AudioFrameQueue *afq, const AVFrame *f) ...@@ -87,7 +87,7 @@ int ff_af_queue_add(AudioFrameQueue *afq, const AVFrame *f)
afq->remaining_samples += f->nb_samples; afq->remaining_samples += f->nb_samples;
#ifdef DEBUG #ifdef DEBUG
ff_af_queue_log_state(afq); af_queue_log_state(afq);
#endif #endif
return 0; return 0;
...@@ -100,7 +100,7 @@ void ff_af_queue_remove(AudioFrameQueue *afq, int nb_samples, int64_t *pts, ...@@ -100,7 +100,7 @@ void ff_af_queue_remove(AudioFrameQueue *afq, int nb_samples, int64_t *pts,
int removed_samples = 0; int removed_samples = 0;
#ifdef DEBUG #ifdef DEBUG
ff_af_queue_log_state(afq); af_queue_log_state(afq);
#endif #endif
/* get output pts from the next frame or generated pts */ /* 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, ...@@ -146,18 +146,18 @@ void ff_af_queue_remove(AudioFrameQueue *afq, int nb_samples, int64_t *pts,
*duration = ff_samples_to_time_base(afq->avctx, removed_samples); *duration = ff_samples_to_time_base(afq->avctx, removed_samples);
} }
void ff_af_queue_log_state(AudioFrameQueue *afq) #ifdef DEBUG
static void af_queue_log_state(AudioFrameQueue *afq)
{ {
AudioFrame *f; AudioFrame *f;
av_log(afq->avctx, AV_LOG_DEBUG, "remaining delay = %d\n", av_dlog(afq->avctx, "remaining delay = %d\n", afq->remaining_delay);
afq->remaining_delay); av_dlog(afq->avctx, "remaining samples = %d\n", afq->remaining_samples);
av_log(afq->avctx, AV_LOG_DEBUG, "remaining samples = %d\n", av_dlog(afq->avctx, "frames:\n");
afq->remaining_samples);
av_log(afq->avctx, AV_LOG_DEBUG, "frames:\n");
f = afq->frame_queue; f = afq->frame_queue;
while (f) { while (f) {
av_log(afq->avctx, AV_LOG_DEBUG, " [ pts=%9"PRId64" duration=%d ]\n", av_dlog(afq->avctx, " [ pts=%9"PRId64" duration=%d ]\n",
f->pts, f->duration); f->pts, f->duration);
f = f->next; f = f->next;
} }
} }
#endif /* DEBUG */
...@@ -80,11 +80,4 @@ int ff_af_queue_add(AudioFrameQueue *afq, const AVFrame *f); ...@@ -80,11 +80,4 @@ int ff_af_queue_add(AudioFrameQueue *afq, const AVFrame *f);
void ff_af_queue_remove(AudioFrameQueue *afq, int nb_samples, int64_t *pts, void ff_af_queue_remove(AudioFrameQueue *afq, int nb_samples, int64_t *pts,
int *duration); int *duration);
/**
* Log the current state of the queue.
*
* @param afq queue context
*/
void ff_af_queue_log_state(AudioFrameQueue *afq);
#endif /* AVCODEC_AUDIO_FRAME_QUEUE_H */ #endif /* AVCODEC_AUDIO_FRAME_QUEUE_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment