| @@ -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 DEBUG | 142 | #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 | else | 149 | 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 | else | 156 | 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 | else | 163 | 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 | #endif | 171 | #endif |
| 172 | } else | 172 | } 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 the | 295 | /* 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 output | 305 | /* 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 any | 314 | /* 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 upmix | 381 | /* 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 to | 392 | /* if remapping channels during output copy, we may need to |
| 393 | * use an intermediate buffer in order to remap before adding | 393 | * 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 | else | 444 | 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) |