Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Bœsch <clement.boesch@smartjog.com>2012-03-20 19:19:49 +0400
committerClément Bœsch <ubitux@gmail.com>2012-03-27 00:46:40 +0400
commit21d650cb69fd6ec42d3f0c8115978f5cf8b34277 (patch)
tree43a94bb8aef93f59d468b3e6fd911b72ecdd83b7 /ffmpeg.c
parenta67d9cfa58c61c8da7f8fdf4285db6ec208a8766 (diff)
ffmpeg: more expressive sample rate automatic selection.
Output now lists the available sample rates with commands like ffmpeg -f lavfi -i aevalsrc=0 -ar 20000 -y /tmp/out.mp3
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index d3be033eb4..eb535fe721 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -953,7 +953,18 @@ static void choose_sample_rate(AVStream *st, AVCodec *codec)
}
}
if (best_dist) {
- av_log(st->codec, AV_LOG_WARNING, "Requested sampling rate unsupported using closest supported (%d)\n", best);
+ int i;
+ const int *sample_rates = codec->supported_samplerates;
+ av_log(st->codec, AV_LOG_WARNING,
+ "Requested sampling rate (%dHz) unsupported, using %dHz instead\n"
+ "Available sampling rates for %s:",
+ st->codec->sample_rate, best, codec->name);
+ for (i = 0; sample_rates[i]; i++) {
+ if (!sample_rates[i + 1]) av_log(st->codec, AV_LOG_WARNING, " and");
+ else if (i) av_log(st->codec, AV_LOG_WARNING, ",");
+ av_log(st->codec, AV_LOG_WARNING, " %d", sample_rates[i]);
+ }
+ av_log(st->codec, AV_LOG_WARNING, ".\n");
}
st->codec->sample_rate = best;
}