ffplay: reset audio_pkt_temp when opening audio
authorMarton Balint <cus@passwd.hu>
Tue, 13 Mar 2012 23:54:01 +0000 (00:54 +0100)
committerMarton Balint <cus@passwd.hu>
Mon, 19 Mar 2012 21:54:40 +0000 (22:54 +0100)
Otherwise we may use the remaining data of the last packet from the previous
audio stream. Fixes bug #951.

Signed-off-by: Marton Balint <cus@passwd.hu>
ffplay.c

index e831f83..8a5818f 100644 (file)
--- a/ffplay.c
+++ b/ffplay.c
@@ -2253,6 +2253,7 @@ static int stream_component_open(VideoState *is, int stream_index)
         avctx->flags |= CODEC_FLAG_EMU_EDGE;
 
     if (avctx->codec_type == AVMEDIA_TYPE_AUDIO) {
+        memset(&is->audio_pkt_temp, 0, sizeof(is->audio_pkt_temp));
         env = SDL_getenv("SDL_AUDIO_CHANNELS");
         if (env)
             wanted_channel_layout = av_get_default_channel_layout(SDL_atoi(env));