aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-09-16 19:21:35 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-09-16 19:55:03 +0200
commit08ec828de9663e46fbfe8feef5c15253f841c687 (patch)
tree5c90513194e2c0298847c4762169f4778c0cde90 /libavcodec
parentd76838c1adc2b75de44779336712c5d540ed5535 (diff)
downloadffmpeg-08ec828de9663e46fbfe8feef5c15253f841c687.tar.gz
avcodec/vorbisenc: Fix mixed declaration and statements
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/vorbisenc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/vorbisenc.c b/libavcodec/vorbisenc.c
index bf21a3b1ff..a4ecd8f754 100644
--- a/libavcodec/vorbisenc.c
+++ b/libavcodec/vorbisenc.c
@@ -1026,6 +1026,7 @@ static int apply_window_and_mdct(vorbis_enc_context *venc)
static AVFrame *spawn_empty_frame(AVCodecContext *avctx, int channels)
{
AVFrame *f = av_frame_alloc();
+ int ch;
if (!f)
return NULL;
@@ -1039,7 +1040,7 @@ static AVFrame *spawn_empty_frame(AVCodecContext *avctx, int channels)
return NULL;
}
- for (int ch = 0; ch < channels; ch++) {
+ for (ch = 0; ch < channels; ch++) {
size_t bps = av_get_bytes_per_sample(f->format);
memset(f->extended_data[ch], 0, bps * f->nb_samples);
}
@@ -1108,8 +1109,9 @@ static int vorbis_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
if (!frame) {
if (venc->bufqueue.available * avctx->frame_size < frame_size) {
int frames_needed = (frame_size/avctx->frame_size) - venc->bufqueue.available;
+ int i;
- for (int i = 0; i < frames_needed; i++) {
+ for (i = 0; i < frames_needed; i++) {
AVFrame *empty = spawn_empty_frame(avctx, venc->channels);
if (!empty)
return AVERROR(ENOMEM);