History

Merge commit '1a3eb042c704dea190c644def5b32c9cee8832b8'

* commit '1a3eb042c704dea190c644def5b32c9cee8832b8': Replace av_dlog with normal av_log at trace level Conflicts: ffplay.c libavdevice/fbdev_dec.c libavfilter/avfilter.c libavfilter/internal.h libavfilter/setpts.c libavfilter/src_movie.c libavfilter/vf_crop.c libavfilter/vf_drawtext.c libavfilter/vf_fieldorder.c libavformat/assdec.c libavformat/avidec.c libavformat/flvdec.c libavformat/http.c libavformat/ipmovie.c libavformat/isom.c libavformat/mov.c libavformat/mpegenc.c libavformat/mpegts.c libavformat/mpegtsenc.c libavformat/mux.c libavformat/mxfdec.c libavformat/nsvdec.c libavformat/oggdec.c libavformat/r3d.c libavformat/rtspdec.c libavformat/utils.c

Michael Niedermayer committed 11 years ago

Commit 40d552d2 parents 8e8219e 1a3eb0439 files · +360 −360Browse files

Showing the changes to libavresample (4 of 39 files). Show all

Unified · Split

4 files
  1. libavresample/audio_convert.c +2 −2
  2. libavresample/audio_mix.c +1 −1
  3. libavresample/resample.c +1 −1
  4. libavresample/utils.c +38 −38
libavresample/audio_convert.c+2−2
@@ -319,7 +319,7 @@ int ff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in) · 318 unmodified lines
319 319
320 if (ac->dc) {320 if (ac->dc) {
321 /* dithered conversion */321 /* dithered conversion */
322 av_dlog(ac->avr, "%d samples - audio_convert: %s to %s (dithered)\n",322 av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (dithered)\n",
323 len, av_get_sample_fmt_name(ac->in_fmt),323 len, av_get_sample_fmt_name(ac->in_fmt),
324 av_get_sample_fmt_name(ac->out_fmt));324 av_get_sample_fmt_name(ac->out_fmt));
325 325
@@ -337,7 +337,7 @@ int ff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in) · 11 unmodified lines
337 use_generic = 0;337 use_generic = 0;
338 }338 }
339 }339 }
340 av_dlog(ac->avr, "%d samples - audio_convert: %s to %s (%s)\n", len,340 av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (%s)\n", len,
341 av_get_sample_fmt_name(ac->in_fmt),341 av_get_sample_fmt_name(ac->in_fmt),
342 av_get_sample_fmt_name(ac->out_fmt),342 av_get_sample_fmt_name(ac->out_fmt),
343 use_generic ? ac->func_descr_generic : ac->func_descr);343 use_generic ? ac->func_descr_generic : ac->func_descr);
libavresample/audio_mix.c+1−1
@@ -441,7 +441,7 @@ int ff_audio_mix(AudioMix *am, AudioData *src) · 440 unmodified lines
441 use_generic = 0;441 use_generic = 0;
442 }442 }
443 }443 }
444 av_dlog(am->avr, "audio_mix: %d samples - %d to %d channels (%s)\n",444 av_log(am->avr, AV_LOG_TRACE, "audio_mix: %d samples - %d to %d channels (%s)\n",
445 src->nb_samples, am->in_channels, am->out_channels,445 src->nb_samples, am->in_channels, am->out_channels,
446 use_generic ? am->func_descr_generic : am->func_descr);446 use_generic ? am->func_descr_generic : am->func_descr);
447 447
libavresample/resample.c+1−1
@@ -485,7 +485,7 @@ int ff_audio_resample(ResampleContext *c, AudioData *dst, AudioData *src) · 484 unmodified lines
485 ff_audio_data_drain(c->buffer, consumed);485 ff_audio_data_drain(c->buffer, consumed);
486 c->initial_padding_samples = FFMAX(c->initial_padding_samples - consumed, 0);486 c->initial_padding_samples = FFMAX(c->initial_padding_samples - consumed, 0);
487 487
488 av_dlog(c->avr, "resampled %d in + %d leftover to %d out + %d leftover\n",488 av_log(c->avr, AV_LOG_TRACE, "resampled %d in + %d leftover to %d out + %d leftover\n",
489 in_samples, in_leftover, out_samples, c->buffer->nb_samples);489 in_samples, in_leftover, out_samples, c->buffer->nb_samples);
490 490
491 dst->nb_samples = out_samples;491 dst->nb_samples = out_samples;
libavresample/utils.c+38−38
@@ -127,46 +127,46 @@ int avresample_open(AVAudioResampleContext *avr) · 126 unmodified lines
127 if (avr->use_channel_map) {127 if (avr->use_channel_map) {
128 if (avr->in_copy_needed) {128 if (avr->in_copy_needed) {
129 avr->remap_point = REMAP_IN_COPY;129 avr->remap_point = REMAP_IN_COPY;
130 av_dlog(avr, "remap channels during in_copy\n");130 av_log(avr, AV_LOG_TRACE, "remap channels during in_copy\n");
131 } else if (avr->in_convert_needed) {131 } else if (avr->in_convert_needed) {
132 avr->remap_point = REMAP_IN_CONVERT;132 avr->remap_point = REMAP_IN_CONVERT;
133 av_dlog(avr, "remap channels during in_convert\n");133 av_log(avr, AV_LOG_TRACE, "remap channels during in_convert\n");
134 } else if (avr->out_convert_needed) {134 } else if (avr->out_convert_needed) {
135 avr->remap_point = REMAP_OUT_CONVERT;135 avr->remap_point = REMAP_OUT_CONVERT;
136 av_dlog(avr, "remap channels during out_convert\n");136 av_log(avr, AV_LOG_TRACE, "remap channels during out_convert\n");
137 } else {137 } else {
138 avr->remap_point = REMAP_OUT_COPY;138 avr->remap_point = REMAP_OUT_COPY;
139 av_dlog(avr, "remap channels during out_copy\n");139 av_log(avr, AV_LOG_TRACE, "remap channels during out_copy\n");
140 }140 }
141 141
142#ifdef DEBUG142#ifdef DEBUG
143 {143 {
144 int ch;144 int ch;
145 av_dlog(avr, "output map: ");145 av_log(avr, AV_LOG_TRACE, "output map: ");
146 if (avr->ch_map_info.do_remap)146 if (avr->ch_map_info.do_remap)
147 for (ch = 0; ch < avr->in_channels; ch++)147 for (ch = 0; ch < avr->in_channels; ch++)
148 av_dlog(avr, " % 2d", avr->ch_map_info.channel_map[ch]);148 av_log(avr, AV_LOG_TRACE, " % 2d", avr->ch_map_info.channel_map[ch]);
149 else149 else
150 av_dlog(avr, "n/a");150 av_log(avr, AV_LOG_TRACE, "n/a");
151 av_dlog(avr, "\n");151 av_log(avr, AV_LOG_TRACE, "\n");
152 av_dlog(avr, "copy map: ");152 av_log(avr, AV_LOG_TRACE, "copy map: ");
153 if (avr->ch_map_info.do_copy)153 if (avr->ch_map_info.do_copy)
154 for (ch = 0; ch < avr->in_channels; ch++)154 for (ch = 0; ch < avr->in_channels; ch++)
155 av_dlog(avr, " % 2d", avr->ch_map_info.channel_copy[ch]);155 av_log(avr, AV_LOG_TRACE, " % 2d", avr->ch_map_info.channel_copy[ch]);
156 else156 else
157 av_dlog(avr, "n/a");157 av_log(avr, AV_LOG_TRACE, "n/a");
158 av_dlog(avr, "\n");158 av_log(avr, AV_LOG_TRACE, "\n");
159 av_dlog(avr, "zero map: ");159 av_log(avr, AV_LOG_TRACE, "zero map: ");
160 if (avr->ch_map_info.do_zero)160 if (avr->ch_map_info.do_zero)
161 for (ch = 0; ch < avr->in_channels; ch++)161 for (ch = 0; ch < avr->in_channels; ch++)
162 av_dlog(avr, " % 2d", avr->ch_map_info.channel_zero[ch]);162 av_log(avr, AV_LOG_TRACE, " % 2d", avr->ch_map_info.channel_zero[ch]);
163 else163 else
164 av_dlog(avr, "n/a");164 av_log(avr, AV_LOG_TRACE, "n/a");
165 av_dlog(avr, "\n");165 av_log(avr, AV_LOG_TRACE, "\n");
166 av_dlog(avr, "input map: ");166 av_log(avr, AV_LOG_TRACE, "input map: ");
167 for (ch = 0; ch < avr->in_channels; ch++)167 for (ch = 0; ch < avr->in_channels; ch++)
168 av_dlog(avr, " % 2d", avr->ch_map_info.input_map[ch]);168 av_log(avr, AV_LOG_TRACE, " % 2d", avr->ch_map_info.input_map[ch]);
169 av_dlog(avr, "\n");169 av_log(avr, AV_LOG_TRACE, "\n");
170 }170 }
171#endif171#endif
172 } else172 } else
@@ -295,7 +295,7 @@ static int handle_buffered_output(AVAudioResampleContext *avr, · 122 unmodified lines
295 /* if there are any samples in the output FIFO or if the295 /* if there are any samples in the output FIFO or if the
296 user-supplied output buffer is not large enough for all samples,296 user-supplied output buffer is not large enough for all samples,
297 we add to the output FIFO */297 we add to the output FIFO */
298 av_dlog(avr, "[FIFO] add %s to out_fifo\n", converted->name);298 av_log(avr, AV_LOG_TRACE, "[FIFO] add %s to out_fifo\n", converted->name);
299 ret = ff_audio_data_add_to_fifo(avr->out_fifo, converted, 0,299 ret = ff_audio_data_add_to_fifo(avr->out_fifo, converted, 0,
300 converted->nb_samples);300 converted->nb_samples);
301 if (ret < 0)301 if (ret < 0)
@@ -305,25 +305,25 @@ static int handle_buffered_output(AVAudioResampleContext *avr, · 3 unmodified lines
305 /* if the user specified an output buffer, read samples from the output305 /* if the user specified an output buffer, read samples from the output
306 FIFO to the user output */306 FIFO to the user output */
307 if (output && output->allocated_samples > 0) {307 if (output && output->allocated_samples > 0) {
308 av_dlog(avr, "[FIFO] read from out_fifo to output\n");308 av_log(avr, AV_LOG_TRACE, "[FIFO] read from out_fifo to output\n");
309 av_dlog(avr, "[end conversion]\n");309 av_log(avr, AV_LOG_TRACE, "[end conversion]\n");
310 return ff_audio_data_read_from_fifo(avr->out_fifo, output,310 return ff_audio_data_read_from_fifo(avr->out_fifo, output,
311 output->allocated_samples);311 output->allocated_samples);
312 }312 }
313 } else if (converted) {313 } else if (converted) {
314 /* copy directly to output if it is large enough or there is not any314 /* copy directly to output if it is large enough or there is not any
315 data in the output FIFO */315 data in the output FIFO */
316 av_dlog(avr, "[copy] %s to output\n", converted->name);316 av_log(avr, AV_LOG_TRACE, "[copy] %s to output\n", converted->name);
317 output->nb_samples = 0;317 output->nb_samples = 0;
318 ret = ff_audio_data_copy(output, converted,318 ret = ff_audio_data_copy(output, converted,
319 avr->remap_point == REMAP_OUT_COPY ?319 avr->remap_point == REMAP_OUT_COPY ?
320 &avr->ch_map_info : NULL);320 &avr->ch_map_info : NULL);
321 if (ret < 0)321 if (ret < 0)
322 return ret;322 return ret;
323 av_dlog(avr, "[end conversion]\n");323 av_log(avr, AV_LOG_TRACE, "[end conversion]\n");
324 return output->nb_samples;324 return output->nb_samples;
325 }325 }
326 av_dlog(avr, "[end conversion]\n");326 av_log(avr, AV_LOG_TRACE, "[end conversion]\n");
327 return 0;327 return 0;
328}328}
329 329
@@ -354,7 +354,7 @@ int attribute_align_arg avresample_convert(AVAudioResampleContext *avr, · 24 unmodified lines
354 avr->out_buffer->allocated_channels);354 avr->out_buffer->allocated_channels);
355 }355 }
356 356
357 av_dlog(avr, "[start conversion]\n");357 av_log(avr, AV_LOG_TRACE, "[start conversion]\n");
358 358
359 /* initialize output_buffer with output data */359 /* initialize output_buffer with output data */
360 direct_output = output && av_audio_fifo_size(avr->out_fifo) == 0;360 direct_output = output && av_audio_fifo_size(avr->out_fifo) == 0;
@@ -380,7 +380,7 @@ int attribute_align_arg avresample_convert(AVAudioResampleContext *avr, · 19 unmodified lines
380 !avr->out_convert_needed && direct_output && out_samples >= in_samples) {380 !avr->out_convert_needed && direct_output && out_samples >= in_samples) {
381 /* in some rare cases we can copy input to output and upmix381 /* in some rare cases we can copy input to output and upmix
382 directly in the output buffer */382 directly in the output buffer */
383 av_dlog(avr, "[copy] %s to output\n", current_buffer->name);383 av_log(avr, AV_LOG_TRACE, "[copy] %s to output\n", current_buffer->name);
384 ret = ff_audio_data_copy(&output_buffer, current_buffer,384 ret = ff_audio_data_copy(&output_buffer, current_buffer,
385 avr->remap_point == REMAP_OUT_COPY ?385 avr->remap_point == REMAP_OUT_COPY ?
386 &avr->ch_map_info : NULL);386 &avr->ch_map_info : NULL);
@@ -392,7 +392,7 @@ int attribute_align_arg avresample_convert(AVAudioResampleContext *avr, · 5 unmodified lines
392 /* if remapping channels during output copy, we may need to392 /* if remapping channels during output copy, we may need to
393 * use an intermediate buffer in order to remap before adding393 * use an intermediate buffer in order to remap before adding
394 * samples to the output fifo */394 * samples to the output fifo */
395 av_dlog(avr, "[copy] %s to out_buffer\n", current_buffer->name);395 av_log(avr, AV_LOG_TRACE, "[copy] %s to out_buffer\n", current_buffer->name);
396 ret = ff_audio_data_copy(avr->out_buffer, current_buffer,396 ret = ff_audio_data_copy(avr->out_buffer, current_buffer,
397 &avr->ch_map_info);397 &avr->ch_map_info);
398 if (ret < 0)398 if (ret < 0)
@@ -406,13 +406,13 @@ int attribute_align_arg avresample_convert(AVAudioResampleContext *avr, · 7 unmodified lines
406 current_buffer->nb_samples);406 current_buffer->nb_samples);
407 if (ret < 0)407 if (ret < 0)
408 return ret;408 return ret;
409 av_dlog(avr, "[convert] %s to in_buffer\n", current_buffer->name);409 av_log(avr, AV_LOG_TRACE, "[convert] %s to in_buffer\n", current_buffer->name);
410 ret = ff_audio_convert(avr->ac_in, avr->in_buffer,410 ret = ff_audio_convert(avr->ac_in, avr->in_buffer,
411 current_buffer);411 current_buffer);
412 if (ret < 0)412 if (ret < 0)
413 return ret;413 return ret;
414 } else {414 } else {
415 av_dlog(avr, "[copy] %s to in_buffer\n", current_buffer->name);415 av_log(avr, AV_LOG_TRACE, "[copy] %s to in_buffer\n", current_buffer->name);
416 ret = ff_audio_data_copy(avr->in_buffer, current_buffer,416 ret = ff_audio_data_copy(avr->in_buffer, current_buffer,
417 avr->remap_point == REMAP_IN_COPY ?417 avr->remap_point == REMAP_IN_COPY ?
418 &avr->ch_map_info : NULL);418 &avr->ch_map_info : NULL);
@@ -421,7 +421,7 @@ int attribute_align_arg avresample_convert(AVAudioResampleContext *avr, · 2 unmodified lines
421 }421 }
422 ff_audio_data_set_channels(avr->in_buffer, avr->in_channels);422 ff_audio_data_set_channels(avr->in_buffer, avr->in_channels);
423 if (avr->downmix_needed) {423 if (avr->downmix_needed) {
424 av_dlog(avr, "[downmix] in_buffer\n");424 av_log(avr, AV_LOG_TRACE, "[downmix] in_buffer\n");
425 ret = ff_audio_mix(avr->am, avr->in_buffer);425 ret = ff_audio_mix(avr->am, avr->in_buffer);
426 if (ret < 0)426 if (ret < 0)
427 return ret;427 return ret;
@@ -443,7 +443,7 @@ int attribute_align_arg avresample_convert(AVAudioResampleContext *avr, · 15 unmodified lines
443 resample_out = &output_buffer;443 resample_out = &output_buffer;
444 else444 else
445 resample_out = avr->resample_out_buffer;445 resample_out = avr->resample_out_buffer;
446 av_dlog(avr, "[resample] %s to %s\n",446 av_log(avr, AV_LOG_TRACE, "[resample] %s to %s\n",
447 current_buffer ? current_buffer->name : "null",447 current_buffer ? current_buffer->name : "null",
448 resample_out->name);448 resample_out->name);
449 ret = ff_audio_resample(avr->resample, resample_out,449 ret = ff_audio_resample(avr->resample, resample_out,
@@ -453,7 +453,7 @@ int attribute_align_arg avresample_convert(AVAudioResampleContext *avr, · 3 unmodified lines
453 453
454 /* if resampling did not produce any samples, just return 0 */454 /* if resampling did not produce any samples, just return 0 */
455 if (resample_out->nb_samples == 0) {455 if (resample_out->nb_samples == 0) {
456 av_dlog(avr, "[end conversion]\n");456 av_log(avr, AV_LOG_TRACE, "[end conversion]\n");
457 return 0;457 return 0;
458 }458 }
459 459
@@ -461,7 +461,7 @@ int attribute_align_arg avresample_convert(AVAudioResampleContext *avr, · 1 unmodified line
461 }461 }
462 462
463 if (avr->upmix_needed) {463 if (avr->upmix_needed) {
464 av_dlog(avr, "[upmix] %s\n", current_buffer->name);464 av_log(avr, AV_LOG_TRACE, "[upmix] %s\n", current_buffer->name);
465 ret = ff_audio_mix(avr->am, current_buffer);465 ret = ff_audio_mix(avr->am, current_buffer);
466 if (ret < 0)466 if (ret < 0)
467 return ret;467 return ret;
@@ -469,26 +469,26 @@ int attribute_align_arg avresample_convert(AVAudioResampleContext *avr, · 1 unmodified line
469 469
470 /* if we resampled or upmixed directly to output, return here */470 /* if we resampled or upmixed directly to output, return here */
471 if (current_buffer == &output_buffer) {471 if (current_buffer == &output_buffer) {
472 av_dlog(avr, "[end conversion]\n");472 av_log(avr, AV_LOG_TRACE, "[end conversion]\n");
473 return current_buffer->nb_samples;473 return current_buffer->nb_samples;
474 }474 }
475 475
476 if (avr->out_convert_needed) {476 if (avr->out_convert_needed) {
477 if (direct_output && out_samples >= current_buffer->nb_samples) {477 if (direct_output && out_samples >= current_buffer->nb_samples) {
478 /* convert directly to output */478 /* convert directly to output */
479 av_dlog(avr, "[convert] %s to output\n", current_buffer->name);479 av_log(avr, AV_LOG_TRACE, "[convert] %s to output\n", current_buffer->name);
480 ret = ff_audio_convert(avr->ac_out, &output_buffer, current_buffer);480 ret = ff_audio_convert(avr->ac_out, &output_buffer, current_buffer);
481 if (ret < 0)481 if (ret < 0)
482 return ret;482 return ret;
483 483
484 av_dlog(avr, "[end conversion]\n");484 av_log(avr, AV_LOG_TRACE, "[end conversion]\n");
485 return output_buffer.nb_samples;485 return output_buffer.nb_samples;
486 } else {486 } else {
487 ret = ff_audio_data_realloc(avr->out_buffer,487 ret = ff_audio_data_realloc(avr->out_buffer,
488 current_buffer->nb_samples);488 current_buffer->nb_samples);
489 if (ret < 0)489 if (ret < 0)
490 return ret;490 return ret;
491 av_dlog(avr, "[convert] %s to out_buffer\n", current_buffer->name);491 av_log(avr, AV_LOG_TRACE, "[convert] %s to out_buffer\n", current_buffer->name);
492 ret = ff_audio_convert(avr->ac_out, avr->out_buffer,492 ret = ff_audio_convert(avr->ac_out, avr->out_buffer,
493 current_buffer);493 current_buffer);
494 if (ret < 0)494 if (ret < 0)

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