Ticket #7409: t7409_mythtv_dts_skip_dts_hd_v2.diff
File t7409_mythtv_dts_skip_dts_hd_v2.diff, 2.9 KB (added by , 14 years ago) |
---|
-
libs/libmythtv/avformatdecoder.cpp
61 61 62 62 #define MAX_AC3_FRAME_SIZE 6144 63 63 64 // defines from libavcodec/dca.h 65 #define DCA_MARKER_RAW_BE 0x7FFE8001 66 #define DCA_MARKER_RAW_LE 0xFE7F0180 67 #define DCA_MARKER_14B_BE 0x1FFFE800 68 #define DCA_MARKER_14B_LE 0xFF1F00E8 69 #define DCA_HD_MARKER 0x64582025 70 64 71 static const float eps = 1E-5; 65 72 66 73 static const int max_video_queue_size = 180; … … 3660 3667 while (!have_err && len > 0) 3661 3668 { 3662 3669 int ret = 0; 3670 bool dts = false; 3663 3671 switch (ctype) 3664 3672 { 3665 3673 case CODEC_TYPE_AUDIO: … … 3771 3779 if (audioOut.do_passthru) 3772 3780 { 3773 3781 data_size = pkt->size; 3774 booldts = CODEC_ID_DTS == curstream->codec->codec_id;3782 dts = CODEC_ID_DTS == curstream->codec->codec_id; 3775 3783 ret = encode_frame(dts, ptr, len, 3776 3784 audioSamples, data_size); 3777 3785 } … … 3812 3820 3813 3821 if (ret < 0) 3814 3822 { 3815 VERBOSE(VB_IMPORTANT, LOC_ERR + 3816 "Unknown audio decoding error"); 3823 if (dts && ret == -2) 3824 { 3825 VERBOSE(VB_AUDIO+VB_EXTRA, LOC + 3826 "DTS frame not supported"); 3827 } 3828 else 3829 { 3830 VERBOSE(VB_IMPORTANT, LOC_ERR + 3831 "Unknown audio decoding error"); 3832 } 3817 3833 have_err = true; 3818 3834 continue; 3819 3835 } … … 4368 4384 if (dts) 4369 4385 { 4370 4386 enc_len = dts_syncinfo(data, &flags, &sample_rate, &bit_rate); 4387 if (enc_len < 0) 4388 return enc_len; 4371 4389 int rate, sfreq, nblks; 4372 4390 dts_decode_header(data, &rate, &nblks, &sfreq); 4373 4391 nr_samples = nblks * 32; … … 4483 4501 uint id = ((indata_ptr[0] << 24) | (indata_ptr[1] << 16) | 4484 4502 (indata_ptr[2] << 8) | (indata_ptr[3])); 4485 4503 4486 if (id != 0x7ffe8001) 4487 return -1; 4504 switch (id) 4505 { 4506 case DCA_MARKER_RAW_BE: break; 4507 case DCA_MARKER_RAW_LE: return -2; // DTS frame not supported 4508 case DCA_MARKER_14B_BE: return -2; // DTS frame not supported 4509 case DCA_MARKER_14B_LE: return -2; // DTS frame not supported 4510 case DCA_HD_MARKER: return -2; // DTS frame not supported 4511 default: return -1; // DTS frame unknown 4512 } 4488 4513 4489 4514 int ftype = indata_ptr[4] >> 7; 4490 4515