abort();
av_abort();
static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap){    FFMContext *ffm = s->priv_data;    AVStream *st;    FFMStream *fst;    ByteIOContext *pb = &s->pb;    AVCodecContext *codec;    int i;    UINT32 tag;    /* header */    tag = get_le32(pb);    if (tag != MKTAG('F', 'F', 'M', '1'))        goto fail;    ffm->packet_size = get_be32(pb);    if (ffm->packet_size != FFM_PACKET_SIZE)        goto fail;    ffm->write_index = get_be64(pb);    /* get also filesize */    if (!url_is_streamed(pb)) {        ffm->file_size = url_filesize(url_fileno(pb));    } else {        ffm->file_size = (UINT64_C(1) << 63) - 1;    }    s->nb_streams = get_be32(pb);    get_be32(pb); /* total bitrate */    /* read each stream */    for(i=0;i<s->nb_streams;i++) {        st = av_mallocz(sizeof(AVStream));        if (!st)            goto fail;        s->streams[i] = st;        fst = av_mallocz(sizeof(FFMStream) + ffm->packet_size);        if (!fst)            goto fail;        st->priv_data = fst;        codec = &st->codec;        /* generic info */        st->codec.codec_id = get_be32(pb);        st->codec.codec_type = get_byte(pb); /* codec_type */        codec->bit_rate = get_be32(pb);        codec->flags = get_be32(pb);        /* specific info */        switch(codec->codec_type) {        case CODEC_TYPE_VIDEO:            codec->frame_rate = ((INT64)get_be32(pb) * FRAME_RATE_BASE) / 1000;            codec->width = get_be16(pb);            codec->height = get_be16(pb);            codec->gop_size = get_be16(pb);            codec->qmin = get_byte(pb);            codec->qmax = get_byte(pb);            codec->max_qdiff = get_byte(pb);            codec->qcompress = get_be16(pb) / 10000.0;            codec->qblur = get_be16(pb) / 10000.0;            codec->bit_rate_tolerance = get_be32(pb);            break;        case CODEC_TYPE_AUDIO:            codec->sample_rate = get_be32(pb);            codec->channels = get_le16(pb);            codec->frame_size = get_le16(pb);            break;        default:            abort();        }    }    /* get until end of block reached */    while ((url_ftell(pb) % ffm->packet_size) != 0)        get_byte(pb);    /* init packet demux */    ffm->packet_ptr = ffm->packet;    ffm->packet_end = ffm->packet;    ffm->frame_offset = 0;    ffm->pts = 0;    ffm->read_state = READ_HEADER;    ffm->first_packet = 1;    return 0; fail:    for(i=0;i<s->nb_streams;i++) {        st = s->streams[i];        if (st) {            fst = st->priv_data;            av_free(fst);            av_free(st);        }    }    return -1;}