Revision 5b1e5dce

View differences:

libavformat/swf.c
59 59
#include <assert.h>
60 60

  
61 61
typedef struct {
62

  
62
    int audio_stream_index;
63 63
    offset_t duration_pos;
64 64
    offset_t tag_pos;
65 65

  
......
808 808
            get_byte(pb);
809 809
            v = get_byte(pb);
810 810
            swf->samples_per_frame = get_le16(pb);
811
            ast = av_new_stream(s, 1);
811
            ast = av_new_stream(s, -1); /* -1 to avoid clash with video stream ch_id */
812 812
            av_set_pts_info(ast, 24, 1, 1000); /* 24 bit pts in ms */
813
            swf->audio_stream_index = ast->index;
813 814
            ast->codec->channels = 1 + (v&1);
814 815
            ast->codec->codec_type = CODEC_TYPE_AUDIO;
815 816
            if (v & 0x20)
......
866 867
            }
867 868
            url_fskip(pb, len-2);
868 869
        } else if (tag == TAG_STREAMBLOCK) {
869
            for( i=0; i<s->nb_streams; i++ ) {
870
                st = s->streams[i];
871
                if (st->id == 1) {
872
                    url_fskip(pb, 4);
873
                    av_get_packet(pb, pkt, len-4);
874
                    pkt->stream_index = st->index;
875
                    return pkt->size;
876
                }
870
            st = s->streams[swf->audio_stream_index];
871
            if (st->codec->codec_id == CODEC_ID_MP3) {
872
                url_fskip(pb, 4);
873
                av_get_packet(pb, pkt, len-4);
874
                pkt->stream_index = st->index;
875
                return pkt->size;
877 876
            }
878 877
            url_fskip(pb, len);
879 878
        } else {

Also available in: Unified diff