Browse code

lavfi/aresample: print channel layouts and formats along with the rate.

Clément Bœsch authored on 2012/05/25 07:07:40
Showing 1 changed files
... ...
@@ -133,6 +133,7 @@ static int config_output(AVFilterLink *outlink)
133 133
     int out_rate;
134 134
     uint64_t out_layout;
135 135
     enum AVSampleFormat out_format;
136
+    char inchl_buf[128], outchl_buf[128];
136 137
 
137 138
     aresample->swr = swr_alloc_set_opts(aresample->swr,
138 139
                                         outlink->channel_layout, outlink->format, outlink->sample_rate,
... ...
@@ -156,8 +157,11 @@ static int config_output(AVFilterLink *outlink)
156 156
 
157 157
     aresample->ratio = (double)outlink->sample_rate / inlink->sample_rate;
158 158
 
159
-    av_log(ctx, AV_LOG_INFO, "r:%"PRId64"Hz -> r:%"PRId64"Hz\n",
160
-           inlink->sample_rate, outlink->sample_rate);
159
+    av_get_channel_layout_string(inchl_buf,  sizeof(inchl_buf),  -1, inlink ->channel_layout);
160
+    av_get_channel_layout_string(outchl_buf, sizeof(outchl_buf), -1, outlink->channel_layout);
161
+    av_log(ctx, AV_LOG_INFO, "chl:%s fmt:%s r:%"PRId64"Hz -> chl:%s fmt:%s r:%"PRId64"Hz\n",
162
+           inchl_buf,  av_get_sample_fmt_name(inlink->format),  inlink->sample_rate,
163
+           outchl_buf, av_get_sample_fmt_name(outlink->format), outlink->sample_rate);
161 164
     return 0;
162 165
 }
163 166