static int swf_read_header(AVFormatContext *s, AVFormatParameters *ap)

{

    ByteIOContext *pb = &s->pb;

    int nbits, len, frame_rate, tag, v;

    AVStream *st;



    if ((get_be32(pb) & 0xffffff00) != MKBETAG('F', 'W', 'S', 0))

        return -EIO;

    get_le32(pb);

    /* skip rectangle size */

    nbits = get_byte(pb) >> 3;

    len = (4 * nbits - 3 + 7) / 8;

    url_fskip(pb, len);

    frame_rate = get_le16(pb);

    get_le16(pb); /* frame count */



    for(;;) {

        tag = get_swf_tag(pb, &len);

        if (tag < 0) {

            fprintf(stderr, "No streaming found in SWF\n");

            return -EIO;

        }

        if (tag == TAG_STREAMHEAD) {

            /* streaming found */

            get_byte(pb);

            v = get_byte(pb);

            get_le16(pb);

            if (len!=4)

                url_fskip(pb,len-4);

            /* if mp3 streaming found, OK */

            if ((v & 0x20) != 0) {

                st = av_new_stream(s, 0);

                if (!st)

                    return -ENOMEM;



                if (v & 0x01)

                    st->codec.channels = 2;

                else

                    st->codec.channels = 1;



                switch((v>> 2) & 0x03) {

                case 1:

                    st->codec.sample_rate = 11025;

                    break;

                case 2:

                    st->codec.sample_rate = 22050;

                    break;

                case 3:

                    st->codec.sample_rate = 44100;

                    break;

                default:

                    av_free(st);

                    return -EIO;

                }

                st->codec.codec_type = CODEC_TYPE_AUDIO;

                st->codec.codec_id = CODEC_ID_MP2;

                break;

            }

        } else {

            url_fskip(pb, len);

        }

    }



    return 0;

}

static int swf_read_header(AVFormatContext *s, AVFormatParameters *ap)

{

    ByteIOContext *pb = &s->pb;

    int nbits, len, frame_rate, tag, v;

    AVStream *st;



    if ((get_be32(pb) & 0xffffff00) != MKBETAG('F', 'W', 'S', 0))

        return -EIO;

    get_le32(pb);

    

    nbits = get_byte(pb) >> 3;

    len = (4 * nbits - 3 + 7) / 8;

    url_fskip(pb, len);

    frame_rate = get_le16(pb);

    get_le16(pb); 



    for(;;) {

        tag = get_swf_tag(pb, &len);

        if (tag < 0) {

            fprintf(stderr, "No streaming found in SWF\n");

            return -EIO;

        }

        if (tag == TAG_STREAMHEAD) {

            

            get_byte(pb);

            v = get_byte(pb);

            get_le16(pb);

            if (len!=4)

                url_fskip(pb,len-4);

            

            if ((v & 0x20) != 0) {

                st = av_new_stream(s, 0);

                if (!st)

                    return -ENOMEM;



                if (v & 0x01)

                    st->codec.channels = 2;

                else

                    st->codec.channels = 1;



                switch((v>> 2) & 0x03) {

                case 1:

                    st->codec.sample_rate = 11025;

                    break;

                case 2:

                    st->codec.sample_rate = 22050;

                    break;

                case 3:

                    st->codec.sample_rate = 44100;

                    break;

                default:

                    av_free(st);

                    return -EIO;

                }

                st->codec.codec_type = CODEC_TYPE_AUDIO;

                st->codec.codec_id = CODEC_ID_MP2;

                break;

            }

        } else {

            url_fskip(pb, len);

        }

    }



    return 0;

}

    ByteIOContext *pb = &s->pb;     AVStream *st;             fprintf(stderr, "No streaming found in SWF\n");         if (tag == TAG_STREAMHEAD) {             get_le16(pb);                 st = av_new_stream(s, 0);                 if (!st)                     st->codec.channels = 2;                     st->codec.channels = 1;                     st->codec.sample_rate = 11025;                     st->codec.sample_rate = 22050;                     st->codec.sample_rate = 44100;                     av_free(st);                 st->codec.codec_type = CODEC_TYPE_AUDIO;                 st->codec.codec_id = CODEC_ID_MP2;                 break;
static int FUNC_0(AVFormatContext *VAR_0, AVFormatParameters *VAR_1)

{

    ByteIOContext *pb = &VAR_0->pb;

    int VAR_2, VAR_3, VAR_4, VAR_5, VAR_6;

    AVStream *st;



    if ((get_be32(pb) & 0xffffff00) != MKBETAG('F', 'W', 'S', 0))

        return -EIO;

    get_le32(pb);

    

    VAR_2 = get_byte(pb) >> 3;

    VAR_3 = (4 * VAR_2 - 3 + 7) / 8;

    url_fskip(pb, VAR_3);

    VAR_4 = get_le16(pb);

    get_le16(pb); 



    for(;;) {

        VAR_5 = get_swf_tag(pb, &VAR_3);

        if (VAR_5 < 0) {

            fprintf(stderr, "No streaming found in SWF\n");

            return -EIO;

        }

        if (VAR_5 == TAG_STREAMHEAD) {

            

            get_byte(pb);

            VAR_6 = get_byte(pb);

            get_le16(pb);

            if (VAR_3!=4)

                url_fskip(pb,VAR_3-4);

            

            if ((VAR_6 & 0x20) != 0) {

                st = av_new_stream(VAR_0, 0);

                if (!st)

                    return -ENOMEM;



                if (VAR_6 & 0x01)

                    st->codec.channels = 2;

                else

                    st->codec.channels = 1;



                switch((VAR_6>> 2) & 0x03) {

                case 1:

                    st->codec.sample_rate = 11025;

                    break;

                case 2:

                    st->codec.sample_rate = 22050;

                    break;

                case 3:

                    st->codec.sample_rate = 44100;

                    break;

                default:

                    av_free(st);

                    return -EIO;

                }

                st->codec.codec_type = CODEC_TYPE_AUDIO;

                st->codec.codec_id = CODEC_ID_MP2;

                break;

            }

        } else {

            url_fskip(pb, VAR_3);

        }

    }



    return 0;

}

static int FUNC_0(AVFormatContext *VAR_0, AVFormatParameters *VAR_1)
{ ByteIOContext *pb = &VAR_0->pb; int VAR_2, VAR_3, VAR_4, VAR_5, VAR_6; AVStream *st; if ((get_be32(pb) & 0xffffff00) != MKBETAG('F', 'W', 'S', 0))
return -EIO; get_le32(pb); VAR_2 = get_byte(pb) >> 3; VAR_3 = (4 * VAR_2 - 3 + 7) / 8; url_fskip(pb, VAR_3); VAR_4 = get_le16(pb); get_le16(pb); for(;;) { VAR_5 = get_swf_tag(pb, &VAR_3); if (VAR_5 < 0) { fprintf(stderr, "No streaming found in SWF\n"); return -EIO; } if (VAR_5 == TAG_STREAMHEAD) { get_byte(pb); VAR_6 = get_byte(pb); get_le16(pb); if (VAR_3!=4)
url_fskip(pb,VAR_3-4); if ((VAR_6 & 0x20) != 0) { st = av_new_stream(VAR_0, 0); if (!st)
return -ENOMEM; if (VAR_6 & 0x01)
st->codec.channels = 2; else
st->codec.channels = 1; switch((VAR_6>> 2) & 0x03) { case 1:
st->codec.sample_rate = 11025; break; case 2:
st->codec.sample_rate = 22050; break; case 3:
st->codec.sample_rate = 44100; break; default:
av_free(st); return -EIO; } st->codec.codec_type = CODEC_TYPE_AUDIO; st->codec.codec_id = CODEC_ID_MP2; break; } } else { url_fskip(pb, VAR_3); } } return 0; }