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().
Showing the changes to libavcodec/audio_frame_queue.c (1 of 2 files). Show all
Unified · Split
| @@ -87,7 +87,7 @@ int ff_af_queue_add(AudioFrameQueue *afq, const AVFrame *f) · 86 unmodified lines | ||
| 87 | 87 | afq->remaining_samples += f->nb_samples; |
| 88 | 88 | |
| 89 | 89 | #ifdef DEBUG |
| 90 | − ff_af_queue_log_state(afq); | |
| 90 | + af_queue_log_state(afq); | |
| 91 | 91 | #endif |
| 92 | 92 | |
| 93 | 93 | return 0; |
| @@ -100,7 +100,7 @@ void ff_af_queue_remove(AudioFrameQueue *afq, int nb_samples, int64_t *pts, · 6 unmodified lines | ||
| 100 | 100 | int removed_samples = 0; |
| 101 | 101 | |
| 102 | 102 | #ifdef DEBUG |
| 103 | − ff_af_queue_log_state(afq); | |
| 103 | + af_queue_log_state(afq); | |
| 104 | 104 | #endif |
| 105 | 105 | |
| 106 | 106 | /* 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 | ||
| 146 | 146 | *duration = ff_samples_to_time_base(afq->avctx, removed_samples); |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | −void ff_af_queue_log_state(AudioFrameQueue *afq) | |
| 149 | +#ifdef DEBUG | |
| 150 | +static void af_queue_log_state(AudioFrameQueue *afq) | |
| 150 | 151 | { |
| 151 | 152 | 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"); | |
| 157 | 156 | f = afq->frame_queue; |
| 158 | 157 | 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); | |
| 161 | 160 | f = f->next; |
| 162 | 161 | } |
| 163 | 162 | } |
| 163 | +#endif /* DEBUG */ | |