Revision 72415b2a libavformat/mov.c

View differences:

libavformat/mov.c
411 411
    dprintf(c->fc, "stype= %.4s\n", (char*)&type);
412 412

  
413 413
    if     (type == MKTAG('v','i','d','e'))
414
        st->codec->codec_type = CODEC_TYPE_VIDEO;
414
        st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
415 415
    else if(type == MKTAG('s','o','u','n'))
416
        st->codec->codec_type = CODEC_TYPE_AUDIO;
416
        st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
417 417
    else if(type == MKTAG('m','1','a',' '))
418 418
        st->codec->codec_id = CODEC_ID_MP2;
419 419
    else if(type == MKTAG('s','u','b','p'))
420
        st->codec->codec_type = CODEC_TYPE_SUBTITLE;
420
        st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
421 421

  
422 422
    get_be32(pb); /* component  manufacture */
423 423
    get_be32(pb); /* component flags */
......
933 933
        if (id<=0 && ((format&0xFFFF) == 'm'+('s'<<8) || (format&0xFFFF) == 'T'+('S'<<8)))
934 934
            id = ff_codec_get_id(ff_codec_wav_tags, bswap_32(format)&0xFFFF);
935 935

  
936
        if (st->codec->codec_type != CODEC_TYPE_VIDEO && id > 0) {
937
            st->codec->codec_type = CODEC_TYPE_AUDIO;
938
        } else if (st->codec->codec_type != CODEC_TYPE_AUDIO && /* do not overwrite codec type */
936
        if (st->codec->codec_type != AVMEDIA_TYPE_VIDEO && id > 0) {
937
            st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
938
        } else if (st->codec->codec_type != AVMEDIA_TYPE_AUDIO && /* do not overwrite codec type */
939 939
                   format && format != MKTAG('m','p','4','s')) { /* skip old asf mpeg4 tag */
940 940
            id = ff_codec_get_id(codec_movvideo_tags, format);
941 941
            if (id <= 0)
942 942
                id = ff_codec_get_id(ff_codec_bmp_tags, format);
943 943
            if (id > 0)
944
                st->codec->codec_type = CODEC_TYPE_VIDEO;
945
            else if(st->codec->codec_type == CODEC_TYPE_DATA){
944
                st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
945
            else if(st->codec->codec_type == AVMEDIA_TYPE_DATA){
946 946
                id = ff_codec_get_id(ff_codec_movsubtitle_tags, format);
947 947
                if(id > 0)
948
                    st->codec->codec_type = CODEC_TYPE_SUBTITLE;
948
                    st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
949 949
            }
950 950
        }
951 951

  
......
953 953
                (format >> 0) & 0xff, (format >> 8) & 0xff, (format >> 16) & 0xff,
954 954
                (format >> 24) & 0xff, st->codec->codec_type);
955 955

  
956
        if(st->codec->codec_type==CODEC_TYPE_VIDEO) {
956
        if(st->codec->codec_type==AVMEDIA_TYPE_VIDEO) {
957 957
            unsigned int color_depth, len;
958 958
            int color_greyscale;
959 959

  
......
1057 1057
                }
1058 1058
                st->codec->palctrl->palette_changed = 1;
1059 1059
            }
1060
        } else if(st->codec->codec_type==CODEC_TYPE_AUDIO) {
1060
        } else if(st->codec->codec_type==AVMEDIA_TYPE_AUDIO) {
1061 1061
            int bits_per_sample, flags;
1062 1062
            uint16_t version = get_be16(pb);
1063 1063

  
......
1137 1137
                st->codec->bits_per_coded_sample = bits_per_sample;
1138 1138
                sc->sample_size = (bits_per_sample >> 3) * st->codec->channels;
1139 1139
            }
1140
        } else if(st->codec->codec_type==CODEC_TYPE_SUBTITLE){
1140
        } else if(st->codec->codec_type==AVMEDIA_TYPE_SUBTITLE){
1141 1141
            // ttxt stsd contains display flags, justification, background
1142 1142
            // color, fonts, and default styles, so fake an atom to read it
1143 1143
            MOVAtom fake_atom = { .size = size - (url_ftell(pb) - start_pos) };
......
1159 1159
            url_fskip(pb, a.size);
1160 1160
    }
1161 1161

  
1162
    if(st->codec->codec_type==CODEC_TYPE_AUDIO && st->codec->sample_rate==0 && sc->time_scale>1)
1162
    if(st->codec->codec_type==AVMEDIA_TYPE_AUDIO && st->codec->sample_rate==0 && sc->time_scale>1)
1163 1163
        st->codec->sample_rate= sc->time_scale;
1164 1164

  
1165 1165
    /* special codec parameters handling */
......
1196 1196
        break;
1197 1197
    case CODEC_ID_MP2:
1198 1198
    case CODEC_ID_MP3:
1199
        st->codec->codec_type = CODEC_TYPE_AUDIO; /* force type after stsd for m1a hdlr */
1199
        st->codec->codec_type = AVMEDIA_TYPE_AUDIO; /* force type after stsd for m1a hdlr */
1200 1200
        st->need_parsing = AVSTREAM_PARSE_FULL;
1201 1201
        break;
1202 1202
    case CODEC_ID_GSM:
......
1490 1490
    }
1491 1491

  
1492 1492
    /* only use old uncompressed audio chunk demuxing when stts specifies it */
1493
    if (!(st->codec->codec_type == CODEC_TYPE_AUDIO &&
1493
    if (!(st->codec->codec_type == AVMEDIA_TYPE_AUDIO &&
1494 1494
          sc->stts_count == 1 && sc->stts_data[0].duration == 1)) {
1495 1495
        unsigned int current_sample = 0;
1496 1496
        unsigned int stts_sample = 0;
......
1698 1698
    if (!sc) return AVERROR(ENOMEM);
1699 1699

  
1700 1700
    st->priv_data = sc;
1701
    st->codec->codec_type = CODEC_TYPE_DATA;
1701
    st->codec->codec_type = AVMEDIA_TYPE_DATA;
1702 1702
    sc->ffindex = st->index;
1703 1703

  
1704 1704
    if ((ret = mov_read_default(c, pb, atom)) < 0)
......
1721 1721

  
1722 1722
    av_set_pts_info(st, 64, 1, sc->time_scale);
1723 1723

  
1724
    if (st->codec->codec_type == CODEC_TYPE_AUDIO &&
1724
    if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO &&
1725 1725
        !st->codec->frame_size && sc->stts_count == 1) {
1726 1726
        st->codec->frame_size = av_rescale(sc->stts_data[0].duration,
1727 1727
                                           st->codec->sample_rate, sc->time_scale);
......
1741 1741
    } else
1742 1742
        sc->pb = c->fc->pb;
1743 1743

  
1744
    if (st->codec->codec_type == CODEC_TYPE_VIDEO) {
1744
    if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
1745 1745
        if (st->codec->width != sc->width || st->codec->height != sc->height) {
1746 1746
            AVRational r = av_d2q(((double)st->codec->height * sc->width) /
1747 1747
                                  ((double)st->codec->width * sc->height), INT_MAX);
......
2004 2004
            sc->ctts_data[sc->ctts_count].duration = get_be32(pb);
2005 2005
            sc->ctts_count++;
2006 2006
        }
2007
        if ((keyframe = st->codec->codec_type == CODEC_TYPE_AUDIO ||
2007
        if ((keyframe = st->codec->codec_type == AVMEDIA_TYPE_AUDIO ||
2008 2008
             (flags & 0x004 && !i && !sample_flags) || sample_flags & 0x2000000))
2009 2009
            distance = 0;
2010 2010
        av_add_index_entry(st, offset, dts, sample_size, distance,

Also available in: Unified diff