case CODEC_TYPE_AUDIO:
case CODEC_ID_MPEG4: stream_type = STREAM_TYPE_VIDEO_MPEG4; break; case CODEC_ID_H264: stream_type = STREAM_TYPE_VIDEO_H264; break; case CODEC_ID_MP2: case CODEC_ID_MP3:
static void mpegts_write_pmt(AVFormatContext *s, MpegTSService *service){    //    MpegTSWrite *ts = s->priv_data;    uint8_t data[1012], *q, *desc_length_ptr, *program_info_length_ptr;    int val, stream_type, i;    q = data;    put16(&q, 0xe000 | service->pcr_pid);    program_info_length_ptr = q;    q += 2; /* patched after */    /* put program info here */    val = 0xf000 | (q - program_info_length_ptr - 2);    program_info_length_ptr[0] = val >> 8;    program_info_length_ptr[1] = val;        for(i = 0; i < s->nb_streams; i++) {        AVStream *st = s->streams[i];        MpegTSWriteStream *ts_st = st->priv_data;        switch(st->codec.codec_type) {        case CODEC_TYPE_VIDEO:            stream_type = STREAM_TYPE_VIDEO_MPEG2; //XXX/FIXME is this (and the define) correct?            break;        case CODEC_TYPE_AUDIO:            stream_type = STREAM_TYPE_AUDIO_MPEG1;            break;        default:            stream_type = STREAM_TYPE_PRIVATE_DATA;            break;        }        *q++ = stream_type;        put16(&q, 0xe000 | ts_st->pid);        desc_length_ptr = q;        q += 2; /* patched after */        /* write optional descriptors here */        val = 0xf000 | (q - desc_length_ptr - 2);        desc_length_ptr[0] = val >> 8;        desc_length_ptr[1] = val;    }    mpegts_write_section1(&service->pmt, PMT_TID, service->sid, 0, 0, 0,                          data, q - data);}   