Revision 72415b2a libavformat/avienc.c

View differences:

libavformat/avienc.c
83 83
    return loff;
84 84
}
85 85

  
86
static char* avi_stream2fourcc(char* tag, int index, enum CodecType type)
86
static char* avi_stream2fourcc(char* tag, int index, enum AVMediaType type)
87 87
{
88 88
    tag[0] = '0';
89 89
    tag[1] = '0' + index;
90
    if (type == CODEC_TYPE_VIDEO) {
90
    if (type == AVMEDIA_TYPE_VIDEO) {
91 91
        tag[2] = 'd';
92 92
        tag[3] = 'c';
93
    } else if (type == CODEC_TYPE_SUBTITLE) {
93
    } else if (type == AVMEDIA_TYPE_SUBTITLE) {
94 94
        // note: this is not an official code
95 95
        tag[2] = 's';
96 96
        tag[3] = 'b';
......
136 136
        } else {
137 137
            put_le32(pb, avist->audio_strm_length / au_ssize);
138 138
        }
139
        if(stream->codec_type == CODEC_TYPE_VIDEO)
139
        if(stream->codec_type == AVMEDIA_TYPE_VIDEO)
140 140
            nb_frames = FFMAX(nb_frames, avist->packet_count);
141 141
    }
142 142
    if(riff_id == 1) {
......
177 177
    for(n=0;n<s->nb_streams;n++) {
178 178
        stream = s->streams[n]->codec;
179 179
        bitrate += stream->bit_rate;
180
        if (stream->codec_type == CODEC_TYPE_VIDEO)
180
        if (stream->codec_type == AVMEDIA_TYPE_VIDEO)
181 181
            video_enc = stream;
182 182
    }
183 183

  
......
222 222
        /* stream generic header */
223 223
        strh = ff_start_tag(pb, "strh");
224 224
        switch(stream->codec_type) {
225
        case CODEC_TYPE_SUBTITLE:
225
        case AVMEDIA_TYPE_SUBTITLE:
226 226
            // XSUB subtitles behave like video tracks, other subtitles
227 227
            // are not (yet) supported.
228 228
            if (stream->codec_id != CODEC_ID_XSUB) break;
229
        case CODEC_TYPE_VIDEO: put_tag(pb, "vids"); break;
230
        case CODEC_TYPE_AUDIO: put_tag(pb, "auds"); break;
231
//        case CODEC_TYPE_TEXT : put_tag(pb, "txts"); break;
232
        case CODEC_TYPE_DATA : put_tag(pb, "dats"); break;
229
        case AVMEDIA_TYPE_VIDEO: put_tag(pb, "vids"); break;
230
        case AVMEDIA_TYPE_AUDIO: put_tag(pb, "auds"); break;
231
//        case AVMEDIA_TYPE_TEXT : put_tag(pb, "txts"); break;
232
        case AVMEDIA_TYPE_DATA : put_tag(pb, "dats"); break;
233 233
        }
234
        if(stream->codec_type == CODEC_TYPE_VIDEO ||
234
        if(stream->codec_type == AVMEDIA_TYPE_VIDEO ||
235 235
           stream->codec_id == CODEC_ID_XSUB)
236 236
            put_le32(pb, stream->codec_tag);
237 237
        else
......
255 255
            put_le32(pb, 0); /* length, XXX: filled later */
256 256

  
257 257
        /* suggested buffer size */ //FIXME set at the end to largest chunk
258
        if(stream->codec_type == CODEC_TYPE_VIDEO)
258
        if(stream->codec_type == AVMEDIA_TYPE_VIDEO)
259 259
            put_le32(pb, 1024 * 1024);
260
        else if(stream->codec_type == CODEC_TYPE_AUDIO)
260
        else if(stream->codec_type == AVMEDIA_TYPE_AUDIO)
261 261
            put_le32(pb, 12 * 1024);
262 262
        else
263 263
            put_le32(pb, 0);
......
268 268
        put_le16(pb, stream->height);
269 269
        ff_end_tag(pb, strh);
270 270

  
271
      if(stream->codec_type != CODEC_TYPE_DATA){
271
      if(stream->codec_type != AVMEDIA_TYPE_DATA){
272 272
        strf = ff_start_tag(pb, "strf");
273 273
        switch(stream->codec_type) {
274
        case CODEC_TYPE_SUBTITLE:
274
        case AVMEDIA_TYPE_SUBTITLE:
275 275
            // XSUB subtitles behave like video tracks, other subtitles
276 276
            // are not (yet) supported.
277 277
            if (stream->codec_id != CODEC_ID_XSUB) break;
278
        case CODEC_TYPE_VIDEO:
278
        case AVMEDIA_TYPE_VIDEO:
279 279
            ff_put_bmp_header(pb, stream, ff_codec_bmp_tags, 0);
280 280
            break;
281
        case CODEC_TYPE_AUDIO:
281
        case AVMEDIA_TYPE_AUDIO:
282 282
            if (ff_put_wav_header(pb, stream) < 0) {
283 283
                return -1;
284 284
            }
......
322 322
            ff_end_tag(pb, avist->indexes.indx_start);
323 323
        }
324 324

  
325
        if(   stream->codec_type == CODEC_TYPE_VIDEO
325
        if(   stream->codec_type == AVMEDIA_TYPE_VIDEO
326 326
           && s->streams[i]->sample_aspect_ratio.num>0
327 327
           && s->streams[i]->sample_aspect_ratio.den>0){
328 328
            int vprp= ff_start_tag(pb, "vprp");
......
542 542
    avi_stream2fourcc(&tag[0], stream_index, enc->codec_type);
543 543
    if(pkt->flags&PKT_FLAG_KEY)
544 544
        flags = 0x10;
545
    if (enc->codec_type == CODEC_TYPE_AUDIO) {
545
    if (enc->codec_type == AVMEDIA_TYPE_AUDIO) {
546 546
       avist->audio_strm_length += size;
547 547
    }
548 548

  
......
603 603
                AVCodecContext *stream = s->streams[n]->codec;
604 604
                AVIStream *avist= s->streams[n]->priv_data;
605 605

  
606
                if (stream->codec_type == CODEC_TYPE_VIDEO) {
606
                if (stream->codec_type == AVMEDIA_TYPE_VIDEO) {
607 607
                    if (nb_frames < avist->packet_count)
608 608
                        nb_frames = avist->packet_count;
609 609
                } else {

Also available in: Unified diff