Make Bink demuxer skip all zero audio tracks, not only the first one
[ffmpeg.git] / libavformat / bink.c
index c21db19..5822875 100644 (file)
@@ -115,7 +115,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
     url_fskip(pb, 4);
 
     vst->codec->codec_type = CODEC_TYPE_VIDEO;
-    vst->codec->codec_id   = 0; /* FIXME: CODEC_ID_BINKVIDEO */
+    vst->codec->codec_id   = CODEC_ID_BINKVIDEO;
     bink->num_audio_tracks = get_le32(pb);
 
     if (bink->num_audio_tracks > BINK_MAX_AUDIO_TRACKS) {
@@ -197,7 +197,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
         bink->current_track = 0;
     }
 
-    if (bink->current_track < bink->num_audio_tracks) {
+    while (bink->current_track < bink->num_audio_tracks) {
         uint32_t audio_size = get_le32(pb);
         if (audio_size > bink->remain_packet_size - 4) {
             av_log(s, AV_LOG_ERROR,