summaryrefslogtreecommitdiff
path: root/doc/examples
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-08-28 19:09:46 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-09-16 00:04:18 +0200
commitc80715f15359ded7c90bf517b2bbfa1c2b0ce517 (patch)
tree8d818f0478f40b786312971ef4a26c639602cfa3 /doc/examples
parenta9fae76370baf11a03b2c0ea590bb2d2f3f372ce (diff)
doc/examples/decode_audio: Fix "warning: ISO C90 forbids mixed declarations and code"
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'doc/examples')
-rw-r--r--doc/examples/decode_audio.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/doc/examples/decode_audio.c b/doc/examples/decode_audio.c
index 6f589b9878..6c2a8ed550 100644
--- a/doc/examples/decode_audio.c
+++ b/doc/examples/decode_audio.c
@@ -115,6 +115,9 @@ int main(int argc, char **argv)
size_t data_size;
AVPacket *pkt;
AVFrame *decoded_frame = NULL;
+ enum AVSampleFormat sfmt;
+ int n_channels = 0;
+ const char *fmt;
if (argc <= 2) {
fprintf(stderr, "Usage: %s <input file> <output file>\n", argv[0]);
@@ -202,9 +205,7 @@ int main(int argc, char **argv)
decode(c, pkt, decoded_frame, outfile);
/* print output pcm infomations, because there have no metadata of pcm */
- enum AVSampleFormat sfmt = c->sample_fmt;
- int n_channels = 0;
- const char *fmt;
+ sfmt = c->sample_fmt;
if (av_sample_fmt_is_planar(sfmt)) {
const char *packed = av_get_sample_fmt_name(sfmt);