Ticket #7409: t7409_mythtv_dts_skip_dts_hd_v3.diff
File t7409_mythtv_dts_skip_dts_hd_v3.diff, 2.9 KB (added by , 14 years ago) |
---|
-
libs/libmythtv/avformatdecoder.cpp
63 63 64 64 #define MAX_AC3_FRAME_SIZE 6144 65 65 66 // defines from libavcodec/dca.h 67 #define DCA_MARKER_RAW_BE 0x7FFE8001 68 #define DCA_MARKER_RAW_LE 0xFE7F0180 69 #define DCA_MARKER_14B_BE 0x1FFFE800 70 #define DCA_MARKER_14B_LE 0xFF1F00E8 71 #define DCA_HD_MARKER 0x64582025 72 66 73 static const float eps = 1E-5; 67 74 68 75 static const int max_video_queue_size = 180; … … 3732 3739 while (!have_err && len > 0) 3733 3740 { 3734 3741 int ret = 0; 3742 bool dts = false; 3735 3743 switch (ctype) 3736 3744 { 3737 3745 case CODEC_TYPE_AUDIO: … … 3848 3856 if (audioOut.do_passthru) 3849 3857 { 3850 3858 data_size = pkt->size; 3851 booldts = CODEC_ID_DTS == curstream->codec->codec_id;3859 dts = CODEC_ID_DTS == curstream->codec->codec_id; 3852 3860 ret = encode_frame(dts, ptr, len, 3853 3861 audioSamples, data_size); 3854 3862 s = (char *)audioSamples; … … 3940 3948 3941 3949 if (ret < 0) 3942 3950 { 3943 VERBOSE(VB_IMPORTANT, LOC_ERR + 3944 "Unknown audio decoding error"); 3951 if (dts && ret == -2) 3952 { 3953 VERBOSE(VB_AUDIO+VB_EXTRA, LOC + 3954 "DTS frame not supported"); 3955 } 3956 else 3957 { 3958 VERBOSE(VB_IMPORTANT, LOC_ERR + 3959 "Unknown audio decoding error"); 3960 } 3945 3961 have_err = true; 3946 3962 continue; 3947 3963 } … … 4555 4571 if (dts) 4556 4572 { 4557 4573 enc_len = dts_syncinfo(data, &flags, &sample_rate, &bit_rate); 4574 if (enc_len < 0) 4575 return enc_len; 4558 4576 int rate, sfreq, nblks; 4559 4577 dts_decode_header(data, &rate, &nblks, &sfreq); 4560 4578 nr_samples = nblks * 32; … … 4670 4688 uint id = ((indata_ptr[0] << 24) | (indata_ptr[1] << 16) | 4671 4689 (indata_ptr[2] << 8) | (indata_ptr[3])); 4672 4690 4673 if (id != 0x7ffe8001) 4674 return -1; 4691 switch (id) 4692 { 4693 case DCA_MARKER_RAW_BE: break; 4694 case DCA_MARKER_RAW_LE: return -2; // DTS frame not supported 4695 case DCA_MARKER_14B_BE: return -2; // DTS frame not supported 4696 case DCA_MARKER_14B_LE: return -2; // DTS frame not supported 4697 case DCA_HD_MARKER: return -2; // DTS frame not supported 4698 default: return -1; // DTS frame unknown 4699 } 4675 4700 4676 4701 int ftype = indata_ptr[4] >> 7; 4677 4702