comparison oggparseogm.c @ 2229:4db0808c3f91 libavformat

ogm: don't use deprecated codec_get_{bmp,wav}_id()
author mru
date Sun, 08 Jul 2007 01:41:09 +0000
parents c2ad35fbbd30
children b22ba392ac21
comparison
equal deleted inserted replaced
2228:9c2823ab0146 2229:4db0808c3f91
51 if(*p == 'v'){ 51 if(*p == 'v'){
52 int tag; 52 int tag;
53 st->codec->codec_type = CODEC_TYPE_VIDEO; 53 st->codec->codec_type = CODEC_TYPE_VIDEO;
54 p += 8; 54 p += 8;
55 tag = bytestream_get_le32(&p); 55 tag = bytestream_get_le32(&p);
56 st->codec->codec_id = codec_get_bmp_id(tag); 56 st->codec->codec_id = codec_get_id(codec_bmp_tags, tag);
57 st->codec->codec_tag = tag; 57 st->codec->codec_tag = tag;
58 } else { 58 } else {
59 uint8_t acid[5]; 59 uint8_t acid[5];
60 int cid; 60 int cid;
61 st->codec->codec_type = CODEC_TYPE_AUDIO; 61 st->codec->codec_type = CODEC_TYPE_AUDIO;
62 p += 8; 62 p += 8;
63 bytestream_get_buffer(&p, acid, 4); 63 bytestream_get_buffer(&p, acid, 4);
64 acid[4] = 0; 64 acid[4] = 0;
65 cid = strtol(acid, NULL, 16); 65 cid = strtol(acid, NULL, 16);
66 st->codec->codec_id = codec_get_wav_id(cid); 66 st->codec->codec_id = codec_get_id(codec_wav_tags, cid);
67 } 67 }
68 68
69 p += 4; /* useless size field */ 69 p += 4; /* useless size field */
70 70
71 time_unit = bytestream_get_le64(&p); 71 time_unit = bytestream_get_le64(&p);
108 108
109 t = AV_RL32(p + 96); 109 t = AV_RL32(p + 96);
110 110
111 if(t == 0x05589f80){ 111 if(t == 0x05589f80){
112 st->codec->codec_type = CODEC_TYPE_VIDEO; 112 st->codec->codec_type = CODEC_TYPE_VIDEO;
113 st->codec->codec_id = codec_get_bmp_id(AV_RL32(p + 68)); 113 st->codec->codec_id = codec_get_id(codec_bmp_tags, AV_RL32(p + 68));
114 st->codec->time_base.den = 10000000; 114 st->codec->time_base.den = 10000000;
115 st->codec->time_base.num = AV_RL64(p + 164); 115 st->codec->time_base.num = AV_RL64(p + 164);
116 st->codec->width = AV_RL32(p + 176); 116 st->codec->width = AV_RL32(p + 176);
117 st->codec->height = AV_RL32(p + 180); 117 st->codec->height = AV_RL32(p + 180);
118 } else if(t == 0x05589f81){ 118 } else if(t == 0x05589f81){
119 st->codec->codec_type = CODEC_TYPE_AUDIO; 119 st->codec->codec_type = CODEC_TYPE_AUDIO;
120 st->codec->codec_id = codec_get_wav_id(AV_RL16(p + 124)); 120 st->codec->codec_id = codec_get_id(codec_wav_tags, AV_RL16(p + 124));
121 st->codec->channels = AV_RL16(p + 126); 121 st->codec->channels = AV_RL16(p + 126);
122 st->codec->sample_rate = AV_RL32(p + 128); 122 st->codec->sample_rate = AV_RL32(p + 128);
123 st->codec->bit_rate = AV_RL32(p + 132) * 8; 123 st->codec->bit_rate = AV_RL32(p + 132) * 8;
124 } 124 }
125 125