diff -u -r ./libs/libmyth/audiooutputalsa.cpp /home/anonymous/work/mythtv-0.23.0+fixes24291/libs/libmyth/audiooutputalsa.cpp
|
old
|
new
|
|
| 232 | 232 | #else |
| 233 | 233 | format = SND_PCM_FORMAT_S24_LE; |
| 234 | 234 | #endif |
| | 235 | else if (audio_bits == 32) |
| | 236 | #ifdef WORDS_BIGENDIAN |
| | 237 | format = SND_PCM_FORMAT_S32; |
| | 238 | #else |
| | 239 | format = SND_PCM_FORMAT_S32_LE; |
| | 240 | #endif |
| 235 | 241 | else |
| 236 | 242 | { |
| 237 | 243 | Error(QString("Unknown sample format: %1 bits.").arg(audio_bits)); |
| … |
… |
|
| 275 | 281 | _ReorderSmpteToAlsa6ch((unsigned char *)buf, frames); |
| 276 | 282 | else if (audio_bits == 16) |
| 277 | 283 | _ReorderSmpteToAlsa6ch((short *)buf, frames); |
| | 284 | else if (audio_bits == 32) |
| | 285 | _ReorderSmpteToAlsa6ch((int *)buf, frames); |
| 278 | 286 | } |
| 279 | 287 | |
| 280 | 288 | template <class AudioDataType> |
diff -u -r ./libs/libmyth/audiooutputbase.cpp /home/anonymous/work/mythtv-0.23.0+fixes24291/libs/libmyth/audiooutputbase.cpp
|
old
|
new
|
|
| 265 | 265 | audio_passthru = settings.use_passthru; |
| 266 | 266 | needs_upmix = lneeds_upmix; |
| 267 | 267 | |
| 268 | | if (audio_bits != 8 && audio_bits != 16) |
| | 268 | if (audio_bits != 8 && audio_bits != 16 && audio_bits != 32) |
| 269 | 269 | { |
| 270 | | Error("AudioOutput only supports 8 or 16bit audio."); |
| | 270 | Error("AudioOutput only supports 8 or 16 or 32bit audio."); |
| 271 | 271 | return; |
| 272 | 272 | } |
| 273 | 273 | |
| … |
… |
|
| 284 | 284 | |
| 285 | 285 | // Encode to AC-3 if not passing thru , there's > 2 channels |
| 286 | 286 | // and a passthru device is defined |
| 287 | | if (!audio_passthru && allow_ac3_passthru && |
| 288 | | (audio_channels > 2 || audio_reenc)) |
| 289 | | audio_enc = true; |
| | 287 | // if (!audio_passthru && allow_ac3_passthru && |
| | 288 | // (audio_channels > 2 || audio_reenc)) |
| | 289 | // audio_enc = true; |
| 290 | 290 | |
| 291 | 291 | // Find out what sample rates we can output (if output layer supports it) |
| 292 | 292 | vector<int> rates = GetSupportedRates(); |
| … |
… |
|
| 701 | 701 | _AdjustVolume<char>((char *)buffer, len, music); |
| 702 | 702 | else if (audio_bits == 16) |
| 703 | 703 | _AdjustVolume<short>((short *)buffer, len, music); |
| | 704 | else if (audio_bits == 32) |
| | 705 | _AdjustVolume<int>((int *)buffer, len, music); |
| 704 | 706 | } |
| 705 | 707 | |
| 706 | 708 | template <class AudioDataType> |
| … |
… |
|
| 921 | 923 | return _MonoToStereo((unsigned char *)s1, (unsigned char *)s2, samples); |
| 922 | 924 | else if (audio_bits == 16) |
| 923 | 925 | return _MonoToStereo((short *)s1, (short *)s2, samples); |
| | 926 | else if (audio_bits == 32) |
| | 927 | return _MonoToStereo((int *)s1, (int *)s2, samples); |
| 924 | 928 | else |
| 925 | 929 | return NULL; // 0 |
| 926 | 930 | } |
| … |
… |
|
| 1058 | 1062 | audiobuffer[org_waud++] = mybuf[chan][itemp]; |
| 1059 | 1063 | if (audio_bits == 16) |
| 1060 | 1064 | audiobuffer[org_waud++] = mybuf[chan][itemp+1]; |
| 1061 | | |
| | 1065 | if (audio_bits == 32) { |
| | 1066 | audiobuffer[org_waud++] = mybuf[chan][itemp+1]; |
| | 1067 | audiobuffer[org_waud++] = mybuf[chan][itemp+2]; |
| | 1068 | audiobuffer[org_waud++] = mybuf[chan][itemp+3]; |
| | 1069 | } |
| 1062 | 1070 | org_waud %= kAudioRingBufferSize; |
| 1063 | 1071 | } |
| 1064 | 1072 | } |
| … |
… |
|
| 1393 | 1401 | buffer[i + offset_dst] = buffer[i + offset_src]; |
| 1394 | 1402 | if (audio_bits == 16) |
| 1395 | 1403 | buffer[i + offset_dst + 1] = buffer[i + offset_src + 1]; |
| | 1404 | if (audio_bits == 32) { |
| | 1405 | buffer[i + offset_dst + 1] = buffer[i + offset_src + 1]; |
| | 1406 | buffer[i + offset_dst + 2] = buffer[i + offset_src + 2]; |
| | 1407 | buffer[i + offset_dst + 3] = buffer[i + offset_src + 3]; |
| | 1408 | } |
| 1396 | 1409 | } |
| 1397 | 1410 | } |
| 1398 | 1411 | |
diff -u -r ./libs/libmythtv/avformatdecoder.cpp /home/anonymous/work/mythtv-0.23.0+fixes24291/libs/libmythtv/avformatdecoder.cpp
|
old
|
new
|
|
| 3437 | 3437 | { |
| 3438 | 3438 | vector<int> flang = filter_lang(atracks, *it); |
| 3439 | 3439 | |
| 3440 | | if (allow_dts_passthru && !transcoding) |
| | 3440 | if (selTrack < 0) |
| | 3441 | selTrack = filter_max_ch(ic, atracks, flang, CODEC_ID_FLAC); |
| | 3442 | |
| | 3443 | if (selTrack < 0) |
| | 3444 | selTrack = filter_max_ch(ic, atracks, flang, CODEC_ID_TRUEHD); |
| | 3445 | |
| | 3446 | if (selTrack < 0 && allow_dts_passthru && !transcoding) |
| 3441 | 3447 | selTrack = filter_max_ch(ic, atracks, flang, CODEC_ID_DTS); |
| 3442 | 3448 | |
| 3443 | 3449 | if (selTrack < 0) |
| … |
… |
|
| 3452 | 3458 | VERBOSE(VB_AUDIO, LOC + "Trying to select audio track (wo/lang)"); |
| 3453 | 3459 | vector<int> flang = filter_lang(atracks, -1); |
| 3454 | 3460 | |
| 3455 | | if (allow_dts_passthru && !transcoding) |
| | 3461 | if (selTrack < 0) |
| | 3462 | selTrack = filter_max_ch(ic, atracks, flang, CODEC_ID_FLAC); |
| | 3463 | |
| | 3464 | if (selTrack < 0) |
| | 3465 | selTrack = filter_max_ch(ic, atracks, flang, CODEC_ID_TRUEHD); |
| | 3466 | |
| | 3467 | if (selTrack < 0 && allow_dts_passthru && !transcoding) |
| 3456 | 3468 | selTrack = filter_max_ch(ic, atracks, flang, CODEC_ID_DTS); |
| 3457 | 3469 | |
| 3458 | 3470 | if (selTrack < 0) |
| … |
… |
|
| 4092 | 4104 | } |
| 4093 | 4105 | |
| 4094 | 4106 | // Convert sample format if required (Myth only handles 8 and 16 bits audio) |
| 4095 | | if (ctx->sample_fmt != SAMPLE_FMT_S16 && ctx->sample_fmt != SAMPLE_FMT_U8) |
| | 4107 | if (false && ctx->sample_fmt != SAMPLE_FMT_S16 && ctx->sample_fmt != SAMPLE_FMT_U8) |
| 4096 | 4108 | { |
| 4097 | 4109 | if (audio_src_fmt != ctx->sample_fmt) |
| 4098 | 4110 | { |
| … |
… |
|
| 4653 | 4665 | if (codec_ctx) |
| 4654 | 4666 | { |
| 4655 | 4667 | using_passthru = DoPassThrough(codec_ctx); |
| 4656 | | info = AudioInfo(codec_ctx->codec_id, codec_ctx->sample_rate, |
| 4657 | | codec_ctx->channels, using_passthru); |
| | 4668 | info = AudioInfo(codec_ctx->codec_id, codec_ctx->channels * |
| | 4669 | av_get_bits_per_sample_format(codec_ctx->sample_fmt) / 8, |
| | 4670 | codec_ctx->sample_rate, codec_ctx->channels, using_passthru); |
| 4658 | 4671 | } |
| 4659 | 4672 | } |
| 4660 | 4673 | |
diff -u -r ./libs/libmythtv/avformatdecoder.h /home/anonymous/work/mythtv-0.23.0+fixes24291/libs/libmythtv/avformatdecoder.h
|
old
|
new
|
|
| 39 | 39 | channels(-1), do_passthru(false) |
| 40 | 40 | {;} |
| 41 | 41 | |
| 42 | | AudioInfo(CodecID id, int sr, int ch, bool passthru) : |
| 43 | | codec_id(id), sample_size(ch*2), sample_rate(sr), |
| | 42 | AudioInfo(CodecID id, int sample_size, int sr, int ch, bool passthru) : |
| | 43 | codec_id(id), sample_size(sample_size), sample_rate(sr), |
| 44 | 44 | channels(ch), do_passthru(passthru) |
| 45 | 45 | {;} |
| 46 | 46 | |