mirror of
https://gitdl.cn/https://github.com/chakralinux/desktop.git
synced 2025-02-09 18:27:16 +08:00
22 lines
736 B
Diff
22 lines
736 B
Diff
diff -Naur old/examples/fpcalc.c new/examples/fpcalc.c
|
|
--- old/examples/fpcalc.c 2012-09-06 04:05:36.000000000 +1000
|
|
+++ new/examples/fpcalc.c 2013-03-07 00:43:11.950928188 +1100
|
|
@@ -65,6 +65,9 @@
|
|
goto done;
|
|
}
|
|
|
|
+ /* request regular signed 16-bit packed format */
|
|
+ codec_ctx->request_sample_fmt = AV_SAMPLE_FMT_S16;
|
|
+
|
|
if (avcodec_open(codec_ctx, codec) < 0) {
|
|
fprintf(stderr, "ERROR: couldn't open the codec\n");
|
|
goto done;
|
|
@@ -146,6 +149,7 @@
|
|
int ostride[6] = { 2 };
|
|
int len = buffer_size / istride[0];
|
|
if (av_audio_convert(convert_ctx, obuf, ostride, ibuf, istride, len) < 0) {
|
|
+ fprintf(stderr, "WARNING: unable to convert %d samples\n", buffer_size);
|
|
break;
|
|
}
|
|
buffer = buffer2;
|
|
|