Commit a2c5be63 authored by Marton Balint's avatar Marton Balint

ffplay: reset audio_pkt_temp when opening audio

Otherwise we may use the remaining data of the last packet from the previous
audio stream. Fixes bug #951.
Signed-off-by: 's avatarMarton Balint <cus@passwd.hu>
parent 2b07f572
...@@ -2253,6 +2253,7 @@ static int stream_component_open(VideoState *is, int stream_index) ...@@ -2253,6 +2253,7 @@ static int stream_component_open(VideoState *is, int stream_index)
avctx->flags |= CODEC_FLAG_EMU_EDGE; avctx->flags |= CODEC_FLAG_EMU_EDGE;
if (avctx->codec_type == AVMEDIA_TYPE_AUDIO) { if (avctx->codec_type == AVMEDIA_TYPE_AUDIO) {
memset(&is->audio_pkt_temp, 0, sizeof(is->audio_pkt_temp));
env = SDL_getenv("SDL_AUDIO_CHANNELS"); env = SDL_getenv("SDL_AUDIO_CHANNELS");
if (env) if (env)
wanted_channel_layout = av_get_default_channel_layout(SDL_atoi(env)); wanted_channel_layout = av_get_default_channel_layout(SDL_atoi(env));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment