Changeset 39
- Timestamp:
- 04/05/07 18:36:36 (2 years ago)
- Files:
-
- trunk/A52/ACShepA52Decoder.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/A52/ACShepA52Decoder.cpp
r38 r39 117 117 { 118 118 for (int channels = 1; channels <= 2; channels++) { 119 CAStreamBasicDescription theOutputFormat(sample_rates[sample_index], kAudioFormatLinearPCM, 0, 1, 0, channels, 16, k LinearPCMFormatFlagIsSignedInteger | kLinearPCMFormatFlagIsPacked);119 CAStreamBasicDescription theOutputFormat(sample_rates[sample_index], kAudioFormatLinearPCM, 0, 1, 0, channels, 16, kIntPCMOutFormatFlag); 120 120 AddOutputFormat(theOutputFormat); 121 121 // This decoder only takes an A/52 or AC-3 stream as it's input … … 515 515 { 516 516 static const uint8_t p_sync_le[6] = { 0x72, 0xF8, 0x1F, 0x4E, 0x01, 0x00 }; 517 static const uint8_t p_sync_be[6] = { 0xF8, 0x72, 0x4E, 0x1F, 0x00, 0x01 }; 517 518 518 519 uint8_t *myOutputData = (uint8_t *)(outOutputData); … … 521 522 522 523 memset(myOutputData, 0, 2 * 2 * 256 * 6); 523 memcpy(myOutputData, p_sync_le, 6);524 524 input_data = GetBytes(bytes_to_read); 525 myOutputData[5] = input_data[5] & 0x7; 526 myOutputData[6] = (bytes_to_read << 4) & 0xff; 527 myOutputData[7] = (bytes_to_read >> 4) & 0xff; 528 unsigned int i; 529 for(i=0; i<bytes_to_read; i+=2) 525 526 if (mOutputFormat.mFormatFlags & kLinearPCMFormatFlagIsBigEndian) 530 527 { 531 myOutputData[i+8] = input_data[i+1]; 532 myOutputData[i+9] = input_data[i]; 528 memcpy(myOutputData, p_sync_be, 6); 529 myOutputData[4] = input_data[5] & 0x7; 530 myOutputData[6] = (bytes_to_read >> 4) & 0xff; 531 myOutputData[7] = (bytes_to_read << 4) & 0xff; 532 memcpy(&myOutputData[8], input_data, bytes_to_read); 533 } 534 else 535 { 536 memcpy(myOutputData, p_sync_le, 6); 537 myOutputData[5] = input_data[5] & 0x7; 538 myOutputData[6] = (bytes_to_read << 4) & 0xff; 539 myOutputData[7] = (bytes_to_read >> 4) & 0xff; 540 unsigned int i; 541 for(i=0; i<bytes_to_read; i+=2) 542 { 543 myOutputData[i+8] = input_data[i+1]; 544 myOutputData[i+9] = input_data[i]; 545 } 533 546 } 534 547 output_offset += mOutputFormat.mChannelsPerFrame * 256 * 6; //Our framed hack
