Changeset 117 for libmpcdec/branches/zorg/src/streaminfo.c
 Timestamp:
 11/11/06 18:22:26 (15 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

libmpcdec/branches/zorg/src/streaminfo.c
r104 r117 60 60 mpc_get_encoder_string(mpc_streaminfo* si) 61 61 { 62 if (si>encoder_version == 0) { 63 sprintf(si>encoder, "Buschmann 1.7.0...9, Klemm 0.90...1.05"); 62 if (si>stream_version < 8) { 63 if (si>encoder_version == 0) { 64 sprintf(si>encoder, "Buschmann 1.7.0...9, Klemm 0.90...1.05"); 65 } else { 66 switch (si>encoder_version % 10) { 67 case 0: 68 sprintf(si>encoder, "Release %u.%u", si>encoder_version / 100, 69 si>encoder_version / 10 % 10); 70 break; 71 case 2: case 4: case 6: case 8: 72 sprintf(si>encoder, "Beta %u.%02u", si>encoder_version / 100, 73 si>encoder_version % 100); 74 break; 75 default: 76 sprintf(si>encoder, "Alpha %u.%02u", 77 si>encoder_version / 100, si>encoder_version % 100); 78 break; 79 } 80 } 64 81 } else { 65 switch (si>encoder_version % 10) { 66 case 0: 67 sprintf(si>encoder, "Release %u.%u", si>encoder_version / 100, 68 si>encoder_version / 10 % 10); 69 break; 70 case 2: case 4: case 6: case 8: 71 sprintf(si>encoder, "Beta %u.%02u", si>encoder_version / 100, 72 si>encoder_version % 100); 73 break; 74 default: 75 sprintf(si>encoder, "Alpha %u.%02u", 76 si>encoder_version / 100, si>encoder_version % 100); 77 break; 78 } 82 int major = si>encoder_version >> 24; 83 int minor = (si>encoder_version >> 16) & 0xFF; 84 int impl = (si>encoder_version >> 8) & 0xFF; 85 int build = si>encoder_version & 0xFF; 86 char * tmp = "Stable"; 87 88 if (minor & 1) 89 tmp = "Unstable"; 90 91 sprintf(si>encoder, "%s %u.%u.%u build %u", tmp, major, minor, impl, 92 build); 79 93 } 80 94 } … … 87 101 88 102 si>bitrate = 0; 89 si>block_size = 1;90 103 si>frames = mpc_bits_read(r, 32); 91 si>is = mpc_bits_read(r, 1); //should be 0104 mpc_bits_read(r, 1); // intensity stereo : should be 0 92 105 si>ms = mpc_bits_read(r, 1); 93 106 si>max_band = mpc_bits_read(r, 6); … … 138 151 si>channels = mpc_bits_read(&r, 4) + 1; 139 152 si>max_band = mpc_bits_read(&r, 5) + 1; 140 // FIXME : this flag will be removed, must be 0141 si>is = mpc_bits_read(&r, 1);142 153 si>ms = mpc_bits_read(&r, 1); 143 144 si>bitrate = 0; 145 si>b lock_size = 1;154 si>frames_per_block = 1 << mpc_bits_read(&r, 4); 155 156 si>bitrate = 0; 146 157 147 158 si>pcm_samples = sampleCount; … … 152 163 153 164 return MPC_STATUS_OK; 165 } 166 167 /// Reads encoder informations 168 void streaminfo_encoder_info(mpc_streaminfo* si, const mpc_bits_reader * r_in) 169 { 170 mpc_bits_reader r = *r_in; 171 172 si>profile = mpc_bits_read(&r, 4); 173 si>profile_name = mpc_get_version_string(si>profile); 174 si>pns = mpc_bits_read(&r, 1); 175 mpc_bits_read(&r, 3); // unused 176 si>encoder_version = mpc_bits_read(&r, 4) << 24; // major 177 si>encoder_version = mpc_bits_read(&r, 8) << 16; // minor 178 si>encoder_version = mpc_bits_read(&r, 4) << 8; // implementation 179 si>encoder_version = mpc_bits_read(&r, 8); // build 180 181 mpc_get_encoder_string(si); 182 } 183 184 /// Reads replay gain datas 185 void streaminfo_gain(mpc_streaminfo* si, const mpc_bits_reader * r_in) 186 { 187 mpc_bits_reader r = *r_in; 188 189 mpc_bits_read(&r, 8); // gain version 190 // FIXME : add gain conversion 191 si>gain_title = (mpc_uint16_t) mpc_bits_read(&r, 16); 192 si>peak_title = (mpc_uint16_t) mpc_bits_read(&r, 16); 193 si>gain_album = (mpc_uint16_t) mpc_bits_read(&r, 16); 194 si>peak_album = (mpc_uint16_t) mpc_bits_read(&r, 16); 154 195 } 155 196
Note: See TracChangeset
for help on using the changeset viewer.