Changeset 4483 for pjproject/trunk/third_party/mp3/mp3_writer.c
- Timestamp:
- Apr 19, 2013 9:52:02 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/third_party/mp3/mp3_writer.c
r1233 r4483 38 38 39 39 #define THIS_FILE "mp3_writer.c" 40 #define SIGNATURE PJMEDIA_ PORT_SIGNATURE('F', 'W', 'M', '3')40 #define SIGNATURE PJMEDIA_SIG_CLASS_PORT_AUD('M','W') 41 41 #define BYTES_PER_SAMPLE 2 42 42 … … 176 176 LConfig.format.LHV1.dwStructVersion = 1; 177 177 LConfig.format.LHV1.dwStructSize = sizeof(BE_CONFIG); 178 LConfig.format.LHV1.dwSampleRate = fport->base.info.clock_rate;178 LConfig.format.LHV1.dwSampleRate = PJMEDIA_PIA_SRATE(&fport->base.info); 179 179 LConfig.format.LHV1.dwReSampleRate = 0; 180 180 181 if ( fport->base.info.channel_count==1)181 if (PJMEDIA_PIA_CCNT(&fport->base.info)==1) 182 182 LConfig.format.LHV1.nMode = BE_MP3_MODE_MONO; 183 else if ( fport->base.info.channel_count==2)183 else if (PJMEDIA_PIA_CCNT(&fport->base.info)==2) 184 184 LConfig.format.LHV1.nMode = BE_MP3_MODE_STEREO; 185 185 else … … 323 323 (int)fport->base.info.name.slen, 324 324 fport->base.info.name.ptr, 325 fport->base.info.clock_rate/1000,325 PJMEDIA_PIA_SRATE(&fport->base.info), 326 326 fport->mp3_option.bit_rate/1000, 327 327 (fport->mp3_option.vbr ? " (VBR)" : ""), … … 377 377 /* Record silence if input is no-frame */ 378 378 if (frame->type == PJMEDIA_FRAME_TYPE_NONE || frame->size == 0) { 379 unsigned samples_left = fport->base.info.samples_per_frame;379 unsigned samples_left = PJMEDIA_PIA_SPF(&fport->base.info); 380 380 unsigned samples_copied = 0; 381 381 382 382 /* Only want to record at most 1 second of silence */ 383 if (fport->silence_duration >= fport->base.info.clock_rate)383 if (fport->silence_duration >= PJMEDIA_PIA_SRATE(&fport->base.info)) 384 384 return PJ_SUCCESS; 385 385 … … 422 422 } 423 423 424 fport->silence_duration += fport->base.info.samples_per_frame;424 fport->silence_duration += PJMEDIA_PIA_SPF(&fport->base.info); 425 425 426 426 } … … 429 429 */ 430 430 else if (fport->mp3_samples_per_frame != 431 fport->base.info.samples_per_frame)431 PJMEDIA_PIA_SPF(&fport->base.info)) 432 432 { 433 433 unsigned samples_left = frame->size / 2;
Note: See TracChangeset
for help on using the changeset viewer.