Changeset 4014 for pjproject/trunk/pjmedia/src/pjmedia/avi_player.c
- Timestamp:
- Apr 4, 2012 4:45:28 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/avi_player.c
r3715 r4014 59 59 { 60 60 unsigned i; 61 pj_int32_t *data32 = (pj_int32_t *)data; 62 pj_int16_t *data16 = (pj_int16_t *)data; 61 63 62 count /= (bits == 32? 4 : 2); 64 for (i=0; i<count; ++i) { 65 if (bits == 32) 66 data32[i] = pj_swap32(data32[i]); 67 else 68 data16[i] = pj_swap16(data16[i]); 63 64 if (bits == 32) { 65 pj_int32_t *data32 = (pj_int32_t *)data; 66 for (i=0; i<count; ++i) 67 data32[i] = pj_swap32(data32[i]); 68 } else { 69 pj_int16_t *data16 = (pj_int16_t *)data; 70 for (i=0; i<count; ++i) 71 data16[i] = pj_swap16(data16[i]); 69 72 } 73 70 74 } 71 75 static void data_to_host2(void *data, pj_uint8_t nsizes, … … 99 103 unsigned stream_id; 100 104 unsigned options; 105 pjmedia_format_id fmt_id; 101 106 pj_uint16_t bits_per_sample; 102 107 pj_bool_t eof; … … 327 332 328 333 for (i = 0, nstr = 0; i < avi_hdr.avih_hdr.num_streams; i++) { 334 pjmedia_format_id fmt_id; 335 329 336 /* Skip non-audio, non-video, or disabled streams) */ 330 337 if ((!COMPARE_TAG(avi_hdr.strl_hdr[i].data_type, … … 355 362 continue; 356 363 } 364 fmt_id = avi_hdr.strl_hdr[i].codec; 357 365 } else { 358 366 /* Check supported audio formats here */ … … 366 374 continue; 367 375 } 376 /* Normalize format ID */ 377 fmt_id = avi_hdr.strl_hdr[i].codec; 378 if (avi_hdr.strl_hdr[i].codec == PJMEDIA_WAVE_FMT_TAG_PCM) 379 fmt_id = PJMEDIA_FORMAT_PCM; 368 380 } 369 381 … … 382 394 383 395 fport[nstr]->stream_id = i; 396 fport[nstr]->fmt_id = fmt_id; 384 397 385 398 /* Open file. */ … … 434 447 fport[i]->bits_per_sample = strf_hdr->bits_per_sample; 435 448 pjmedia_format_init_audio(&fport[i]->base.info.fmt, 436 strl_hdr->codec,449 fport[i]->fmt_id, 437 450 strf_hdr->sample_rate, 438 451 strf_hdr->nchannels,
Note: See TracChangeset
for help on using the changeset viewer.