mirror of
https://github.com/mpv-player/mpv
synced 2025-02-27 19:01:07 +00:00
audio/filter: remove redundant log message prefixes
These are now appended automatically, so you'd get them twice before this commit.
This commit is contained in:
parent
f46e188ec5
commit
39b40e1ffb
@ -142,12 +142,12 @@ static int control(struct af_instance *af, int cmd, void *arg)
|
||||
// bs2b have srate limits, try to resample if needed
|
||||
if (af->data->rate > BS2B_MAXSRATE || af->data->rate < BS2B_MINSRATE) {
|
||||
af->data->rate = BS2B_DEFAULT_SRATE;
|
||||
MP_WARN(af, "[bs2b] Requested sample rate %d Hz is out of bounds [%d..%d] Hz.\n"
|
||||
"[bs2b] Trying to resample to %d Hz.\n",
|
||||
MP_WARN(af, "Requested sample rate %d Hz is out of bounds [%d..%d] Hz.\n"
|
||||
"Trying to resample to %d Hz.\n",
|
||||
af->data->rate, BS2B_MINSRATE, BS2B_MAXSRATE, BS2B_DEFAULT_SRATE);
|
||||
}
|
||||
bs2b_set_srate(s->filter, (long)af->data->rate);
|
||||
MP_VERBOSE(af, "[bs2b] using format %s\n",
|
||||
MP_VERBOSE(af, "using format %s\n",
|
||||
af_fmt_to_str(af->data->format));
|
||||
|
||||
return af_test_output(af,(struct mp_audio*)arg);
|
||||
|
@ -124,14 +124,14 @@ static int check_routes(struct af_instance *af, int nin, int nout)
|
||||
af_channels_t* s = af->priv;
|
||||
int i;
|
||||
if((s->nr < 1) || (s->nr > AF_NCH)){
|
||||
MP_ERR(af, "[channels] The number of routing pairs must be"
|
||||
MP_ERR(af, "The number of routing pairs must be"
|
||||
" between 1 and %i. Current value is %i\n",AF_NCH,s->nr);
|
||||
return AF_ERROR;
|
||||
}
|
||||
|
||||
for(i=0;i<s->nr;i++){
|
||||
if((s->route[i][FR] >= nin) || (s->route[i][TO] >= nout)){
|
||||
MP_ERR(af, "[channels] Invalid routing in pair nr. %i.\n", i);
|
||||
MP_ERR(af, "Invalid routing in pair nr. %i.\n", i);
|
||||
return AF_ERROR;
|
||||
}
|
||||
}
|
||||
@ -220,11 +220,11 @@ static int af_open(struct af_instance* af){
|
||||
do {
|
||||
int n = 0;
|
||||
if (ch >= AF_NCH) {
|
||||
MP_FATAL(af, "[channels] Can't have more than %d routes.\n", AF_NCH);
|
||||
MP_FATAL(af, "Can't have more than %d routes.\n", AF_NCH);
|
||||
return AF_ERROR;
|
||||
}
|
||||
sscanf(cp, "%i-%i%n" ,&s->route[ch][FR], &s->route[ch][TO], &n);
|
||||
MP_VERBOSE(af, "[channels] Routing from channel %i to"
|
||||
MP_VERBOSE(af, "Routing from channel %i to"
|
||||
" channel %i\n",s->route[ch][FR],s->route[ch][TO]);
|
||||
cp = &cp[n];
|
||||
ch++;
|
||||
|
@ -54,7 +54,7 @@ static int control(struct af_instance* af, int cmd, void* arg)
|
||||
struct mp_audio *in = arg;
|
||||
|
||||
if (in->bps != 1 && in->bps != 2 && in->bps != 4) {
|
||||
MP_FATAL(af, "[delay] Sample format not supported\n");
|
||||
MP_FATAL(af, "Sample format not supported\n");
|
||||
return AF_ERROR;
|
||||
}
|
||||
|
||||
@ -69,16 +69,16 @@ static int control(struct af_instance* af, int cmd, void* arg)
|
||||
for(i=0;i<af->data->nch;i++){
|
||||
s->q[i] = calloc(L,af->data->bps);
|
||||
if(NULL == s->q[i])
|
||||
MP_FATAL(af, "[delay] Out of memory\n");
|
||||
MP_FATAL(af, "Out of memory\n");
|
||||
}
|
||||
|
||||
if(AF_OK != af_from_ms(AF_NCH, s->d, s->wi, af->data->rate, 0.0, 1000.0))
|
||||
return AF_ERROR;
|
||||
s->ri = 0;
|
||||
for(i=0;i<AF_NCH;i++){
|
||||
MP_DBG(af, "[delay] Channel %i delayed by %0.3fms\n",
|
||||
MP_DBG(af, "Channel %i delayed by %0.3fms\n",
|
||||
i,MPCLAMP(s->d[i],0.0,1000.0));
|
||||
MP_TRACE(af, "[delay] Channel %i delayed by %i samples\n",
|
||||
MP_TRACE(af, "Channel %i delayed by %i samples\n",
|
||||
i,s->wi[i]);
|
||||
}
|
||||
return AF_OK;
|
||||
|
@ -33,7 +33,7 @@ static int control(struct af_instance* af, int cmd, void* arg)
|
||||
switch(cmd){
|
||||
case AF_CONTROL_REINIT: ;
|
||||
*af->data = *(struct mp_audio*)arg;
|
||||
MP_VERBOSE(af, "[dummy] Was reinitialized: %iHz/%ich/%s\n",
|
||||
MP_VERBOSE(af, "Was reinitialized: %iHz/%ich/%s\n",
|
||||
af->data->rate,af->data->nch,af_fmt_to_str(af->data->format));
|
||||
return AF_OK;
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ static int control(struct af_instance* af, int cmd, void* arg)
|
||||
s->K--;
|
||||
|
||||
if(s->K != KM)
|
||||
MP_INFO(af, "[equalizer] Limiting the number of filters to"
|
||||
MP_INFO(af, "Limiting the number of filters to"
|
||||
" %i due to low sample rate.\n",s->K);
|
||||
|
||||
// Generate filter taps
|
||||
|
@ -95,20 +95,20 @@ static int control(struct af_instance* af, int cmd, void* arg)
|
||||
// Allocate new buffers (as one continuous block)
|
||||
s->buf[0] = calloc(s->sz*af->data->nch, af->data->bps);
|
||||
if(NULL == s->buf[0])
|
||||
MP_FATAL(af, "[export] Out of memory\n");
|
||||
MP_FATAL(af, "Out of memory\n");
|
||||
for(i = 1; i < af->data->nch; i++)
|
||||
s->buf[i] = (uint8_t *)s->buf[0] + i*s->sz*af->data->bps;
|
||||
|
||||
if (!s->filename) {
|
||||
MP_FATAL(af, "[export] No filename set.\n");
|
||||
MP_FATAL(af, "No filename set.\n");
|
||||
return AF_ERROR;
|
||||
}
|
||||
|
||||
// Init memory mapping
|
||||
s->fd = open(s->filename, O_RDWR | O_CREAT | O_TRUNC | O_CLOEXEC, 0640);
|
||||
MP_INFO(af, "[export] Exporting to file: %s\n", s->filename);
|
||||
MP_INFO(af, "Exporting to file: %s\n", s->filename);
|
||||
if(s->fd < 0) {
|
||||
MP_FATAL(af, "[export] Could not open/create file: %s\n",
|
||||
MP_FATAL(af, "Could not open/create file: %s\n",
|
||||
s->filename);
|
||||
return AF_ERROR;
|
||||
}
|
||||
@ -125,8 +125,8 @@ static int control(struct af_instance* af, int cmd, void* arg)
|
||||
// mmap size
|
||||
s->mmap_area = mmap(0, mapsize, PROT_READ|PROT_WRITE,MAP_SHARED, s->fd, 0);
|
||||
if(s->mmap_area == NULL)
|
||||
MP_FATAL(af, "[export] Could not mmap file %s\n", s->filename);
|
||||
MP_INFO(af, "[export] Memory mapped to file: %s (%p)\n",
|
||||
MP_FATAL(af, "Could not mmap file %s\n", s->filename);
|
||||
MP_INFO(af, "Memory mapped to file: %s (%p)\n",
|
||||
s->filename, s->mmap_area);
|
||||
|
||||
// Initialize header
|
||||
|
@ -296,7 +296,7 @@ static int control(struct af_instance *af, int cmd, void* arg)
|
||||
if(af->data->rate != 48000) {
|
||||
// automatic samplerate adjustment in the filter chain
|
||||
// is not yet supported.
|
||||
MP_ERR(af, "[hrtf] ERROR: Sampling rate is not 48000 Hz (%d)!\n",
|
||||
MP_ERR(af, "ERROR: Sampling rate is not 48000 Hz (%d)!\n",
|
||||
af->data->rate);
|
||||
return AF_ERROR;
|
||||
}
|
||||
@ -367,25 +367,25 @@ static int filter(struct af_instance *af, struct mp_audio *data, int flags)
|
||||
s->print_flag = 0;
|
||||
switch (s->decode_mode) {
|
||||
case HRTF_MIX_51:
|
||||
MP_INFO(af, "[hrtf] Using HRTF to mix %s discrete surround into "
|
||||
MP_INFO(af, "Using HRTF to mix %s discrete surround into "
|
||||
"L, R channels\n", s->matrix_mode ? "5+1" : "5");
|
||||
break;
|
||||
case HRTF_MIX_STEREO:
|
||||
MP_INFO(af, "[hrtf] Using HRTF to mix stereo into "
|
||||
MP_INFO(af, "Using HRTF to mix stereo into "
|
||||
"L, R channels\n");
|
||||
break;
|
||||
case HRTF_MIX_MATRIX2CH:
|
||||
MP_INFO(af, "[hrtf] Using active matrix to decode 2 channel "
|
||||
MP_INFO(af, "Using active matrix to decode 2 channel "
|
||||
"input, HRTF to mix %s matrix surround into "
|
||||
"L, R channels\n", "3/2");
|
||||
break;
|
||||
default:
|
||||
MP_WARN(af, "[hrtf] bogus decode_mode: %d\n", s->decode_mode);
|
||||
MP_WARN(af, "bogus decode_mode: %d\n", s->decode_mode);
|
||||
break;
|
||||
}
|
||||
|
||||
if(s->matrix_mode)
|
||||
MP_INFO(af, "[hrtf] Using active matrix to decode rear center "
|
||||
MP_INFO(af, "Using active matrix to decode rear center "
|
||||
"channel\n");
|
||||
}
|
||||
|
||||
@ -595,7 +595,7 @@ static int af_open(struct af_instance* af)
|
||||
s->print_flag = 1;
|
||||
|
||||
if (allocate(s) != 0) {
|
||||
MP_ERR(af, "[hrtf] Memory allocation error.\n");
|
||||
MP_ERR(af, "Memory allocation error.\n");
|
||||
return AF_ERROR;
|
||||
}
|
||||
|
||||
@ -614,13 +614,13 @@ static int af_open(struct af_instance* af)
|
||||
s->cr_ir = cr_filt + (s->cr_o = pulse_detect(cr_filt));
|
||||
|
||||
if((s->ba_ir = malloc(s->basslen * sizeof(float))) == NULL) {
|
||||
MP_ERR(af, "[hrtf] Memory allocation error.\n");
|
||||
MP_ERR(af, "Memory allocation error.\n");
|
||||
return AF_ERROR;
|
||||
}
|
||||
fc = 2.0 * BASSFILTFREQ / (float)af->data->rate;
|
||||
if(af_filter_design_fir(s->basslen, s->ba_ir, &fc, LP | KAISER, 4 * M_PI) ==
|
||||
-1) {
|
||||
MP_ERR(af, "[hrtf] Unable to design low-pass "
|
||||
MP_ERR(af, "Unable to design low-pass "
|
||||
"filter.\n");
|
||||
return AF_ERROR;
|
||||
}
|
||||
|
@ -187,7 +187,7 @@ static int filter(struct af_instance* af, struct mp_audio* audio, int flags)
|
||||
|
||||
AVFrame *frame = avcodec_alloc_frame();
|
||||
if (!frame) {
|
||||
MP_FATAL(af, "[libaf] Could not allocate memory \n");
|
||||
MP_FATAL(af, "Could not allocate memory \n");
|
||||
return -1;
|
||||
}
|
||||
frame->nb_samples = s->in_samples;
|
||||
@ -201,7 +201,7 @@ static int filter(struct af_instance* af, struct mp_audio* audio, int flags)
|
||||
int ok;
|
||||
ret = avcodec_encode_audio2(s->lavc_actx, &s->pkt, frame, &ok);
|
||||
if (ret < 0 || !ok) {
|
||||
MP_FATAL(af, "[lavac3enc] Encode failed.\n");
|
||||
MP_FATAL(af, "Encode failed.\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -221,7 +221,7 @@ static int configure_lavrr(struct af_instance *af, struct mp_audio *in,
|
||||
if (avresample_open(s->avrctx) < 0 ||
|
||||
avresample_open(s->avrctx_out) < 0)
|
||||
{
|
||||
MP_ERR(af, "[lavrresample] Cannot open "
|
||||
MP_ERR(af, "Cannot open "
|
||||
"Libavresample Context. \n");
|
||||
return AF_ERROR;
|
||||
}
|
||||
@ -397,7 +397,7 @@ static int af_open(struct af_instance *af)
|
||||
if (s->avrctx && s->avrctx_out) {
|
||||
return AF_OK;
|
||||
} else {
|
||||
MP_ERR(af, "[lavrresample] Cannot initialize "
|
||||
MP_ERR(af, "Cannot initialize "
|
||||
"Libavresample Context. \n");
|
||||
uninit(af);
|
||||
return AF_ERROR;
|
||||
|
@ -80,7 +80,7 @@ static int control(struct af_instance* af, int cmd, void* arg)
|
||||
|
||||
// Sanity check
|
||||
if(((int*)arg)[0] <= 0 || ((int*)arg)[0] > AF_NCH){
|
||||
MP_ERR(af, "[pan] The number of output channels must be"
|
||||
MP_ERR(af, "The number of output channels must be"
|
||||
" between 1 and %i. Current value is %i\n",AF_NCH,((int*)arg)[0]);
|
||||
return AF_ERROR;
|
||||
}
|
||||
@ -161,7 +161,7 @@ static int af_open(struct af_instance* af){
|
||||
j = 0; k = 0;
|
||||
while(cp && k < AF_NCH){
|
||||
sscanf(cp, "%f%n" , &s->level[j][k], &n);
|
||||
MP_VERBOSE(af, "[pan] Pan level from channel %i to"
|
||||
MP_VERBOSE(af, "Pan level from channel %i to"
|
||||
" channel %i = %f\n",k,j,s->level[j][k]);
|
||||
cp =&cp[n];
|
||||
j++;
|
||||
|
@ -275,7 +275,7 @@ static int control(struct af_instance *af, int cmd, void *arg)
|
||||
int nch = data->nch;
|
||||
int use_int = 0;
|
||||
|
||||
MP_VERBOSE(af, "[scaletempo] %.3f speed * %.3f scale_nominal = %.3f\n",
|
||||
MP_VERBOSE(af, "%.3f speed * %.3f scale_nominal = %.3f\n",
|
||||
s->speed, s->scale_nominal, s->scale);
|
||||
|
||||
mp_audio_force_interleaved_format(data);
|
||||
@ -317,7 +317,7 @@ static int control(struct af_instance *af, int cmd, void *arg)
|
||||
s->buf_overlap = realloc(s->buf_overlap, s->bytes_overlap);
|
||||
s->table_blend = realloc(s->table_blend, s->bytes_overlap * 4);
|
||||
if (!s->buf_overlap || !s->table_blend) {
|
||||
MP_FATAL(af, "[scaletempo] Out of memory\n");
|
||||
MP_FATAL(af, "Out of memory\n");
|
||||
return AF_ERROR;
|
||||
}
|
||||
memset(s->buf_overlap, 0, s->bytes_overlap);
|
||||
@ -354,7 +354,7 @@ static int control(struct af_instance *af, int cmd, void *arg)
|
||||
s->table_window = realloc(s->table_window,
|
||||
s->bytes_overlap * 2 - nch * bps * 2);
|
||||
if (!s->buf_pre_corr || !s->table_window) {
|
||||
MP_FATAL(af, "[scaletempo] Out of memory\n");
|
||||
MP_FATAL(af, "Out of memory\n");
|
||||
return AF_ERROR;
|
||||
}
|
||||
memset((char *)s->buf_pre_corr + s->bytes_overlap * 2, 0,
|
||||
@ -371,7 +371,7 @@ static int control(struct af_instance *af, int cmd, void *arg)
|
||||
s->table_window = realloc(s->table_window,
|
||||
s->bytes_overlap - nch * bps);
|
||||
if (!s->buf_pre_corr || !s->table_window) {
|
||||
MP_FATAL(af, "[scaletempo] Out of memory\n");
|
||||
MP_FATAL(af, "Out of memory\n");
|
||||
return AF_ERROR;
|
||||
}
|
||||
float *pw = s->table_window;
|
||||
@ -391,14 +391,14 @@ static int control(struct af_instance *af, int cmd, void *arg)
|
||||
* bps * nch;
|
||||
s->buf_queue = realloc(s->buf_queue, s->bytes_queue + UNROLL_PADDING);
|
||||
if (!s->buf_queue) {
|
||||
MP_FATAL(af, "[scaletempo] Out of memory\n");
|
||||
MP_FATAL(af, "Out of memory\n");
|
||||
return AF_ERROR;
|
||||
}
|
||||
|
||||
s->bytes_queued = 0;
|
||||
s->bytes_to_slide = 0;
|
||||
|
||||
MP_DBG(af, "[scaletempo] "
|
||||
MP_DBG(af, ""
|
||||
"%.2f stride_in, %i stride_out, %i standing, "
|
||||
"%i overlap, %i search, %i queue, %s mode\n",
|
||||
s->frames_stride_scaled,
|
||||
|
@ -99,7 +99,7 @@ static int play_s16(struct af_instance* af, struct mp_audio* data, int f)
|
||||
s->pos += 2 * M_PI * s->freq / data->rate;
|
||||
}
|
||||
|
||||
MP_VERBOSE(af, "[sinesuppress] f:%8.2f: amp:%8.2f\n", s->freq, sqrt(s->real*s->real + s->imag*s->imag) / s->ref);
|
||||
MP_VERBOSE(af, "f:%8.2f: amp:%8.2f\n", s->freq, sqrt(s->real*s->real + s->imag*s->imag) / s->ref);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ static int control(struct af_instance* af, int cmd, void* arg)
|
||||
struct mp_audio *in = arg;
|
||||
float fc;
|
||||
if (!mp_chmap_is_stereo(&in->channels)) {
|
||||
MP_ERR(af, "[surround] Only stereo input is supported.\n");
|
||||
MP_ERR(af, "Only stereo input is supported.\n");
|
||||
return AF_DETACH;
|
||||
}
|
||||
|
||||
@ -105,7 +105,7 @@ static int control(struct af_instance* af, int cmd, void* arg)
|
||||
// Surround filer coefficients
|
||||
fc = 2.0 * 7000.0/(float)af->data->rate;
|
||||
if (-1 == af_filter_design_fir(L, s->w, &fc, LP|HAMMING, 0)){
|
||||
MP_ERR(af, "[surround] Unable to design low-pass filter.\n");
|
||||
MP_ERR(af, "Unable to design low-pass filter.\n");
|
||||
return AF_ERROR;
|
||||
}
|
||||
|
||||
@ -116,7 +116,7 @@ static int control(struct af_instance* af, int cmd, void* arg)
|
||||
s->dl = calloc(LD,af->data->bps);
|
||||
s->dr = calloc(LD,af->data->bps);
|
||||
if((NULL == s->dl) || (NULL == s->dr))
|
||||
MP_FATAL(af, "[delay] Out of memory\n");
|
||||
MP_FATAL(af, "Out of memory\n");
|
||||
|
||||
// Initialize delay queue index
|
||||
if(AF_OK != af_from_ms(1, &s->d, &s->wi, af->data->rate, 0.0, 1000.0))
|
||||
|
Loading…
Reference in New Issue
Block a user