summaryrefslogtreecommitdiff
path: root/ffplay.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-09-24 03:09:54 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-09-24 03:09:54 +0200
commit3715e67591a459312f6e9975b617e4bb30acddac (patch)
tree4630ab182c8007ac17389a0009ed40add3f3d515 /ffplay.c
parent3419d9b8911f850f65b6435f3c1218f7582255ef (diff)
ffplay: fix order of operations for sdl audio open.
Fixes Ticket149 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffplay.c')
-rw-r--r--ffplay.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ffplay.c b/ffplay.c
index 1a2eb1b08a..b4215c5982 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -2184,6 +2184,8 @@ static int stream_component_open(VideoState *is, int stream_index)
if(codec->capabilities & CODEC_CAP_DR1)
avctx->flags |= CODEC_FLAG_EMU_EDGE;
+ wanted_spec.freq = avctx->sample_rate;
+ wanted_spec.channels = avctx->channels;
if (!codec ||
avcodec_open2(avctx, codec, &opts) < 0)
return -1;
@@ -2198,9 +2200,7 @@ static int stream_component_open(VideoState *is, int stream_index)
fprintf(stderr, "Invalid sample rate or channel count\n");
return -1;
}
- wanted_spec.freq = avctx->sample_rate;
wanted_spec.format = AUDIO_S16SYS;
- wanted_spec.channels = avctx->channels;
wanted_spec.silence = 0;
wanted_spec.samples = SDL_AUDIO_BUFFER_SIZE;
wanted_spec.callback = sdl_audio_callback;