summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--DOCS/man/en/options.rst7
-rw-r--r--audio/decode/ad_spdif.c35
-rw-r--r--core/cfg-mplayer.h1
-rw-r--r--core/options.h1
4 files changed, 31 insertions, 13 deletions
diff --git a/DOCS/man/en/options.rst b/DOCS/man/en/options.rst
index ae83fd50b6..2e9fd424a4 100644
--- a/DOCS/man/en/options.rst
+++ b/DOCS/man/en/options.rst
@@ -531,6 +531,13 @@
Time in milliseconds to recognize two consecutive button presses as a
double-click (default: 300).
+--dtshd, --no-dtshd
+ When using DTS passthrough, output any DTS-HD track as-is.
+ With ``--no-dts`` (the default) only the DTS Core parts will be output.
+
+ DTS-HD tracks can be sent over HDMI but not over the original
+ coax/toslink S/PDIF system.
+
--dvbin=<options>
Pass the following parameters to the DVB input module, in order to
override the default ones:
diff --git a/audio/decode/ad_spdif.c b/audio/decode/ad_spdif.c
index e20566a265..128b1bd8a9 100644
--- a/audio/decode/ad_spdif.c
+++ b/audio/decode/ad_spdif.c
@@ -27,6 +27,7 @@
#include "config.h"
#include "core/mp_msg.h"
#include "core/av_common.h"
+#include "core/options.h"
#include "ad_internal.h"
LIBAD_EXTERN(spdif)
@@ -162,19 +163,27 @@ static int init(sh_audio_t *sh, const char *decoder)
sh->channels = 2;
sh->i_bps = bps;
break;
- case CODEC_ID_DTS: // FORCE USE DTS-HD
- opt = av_opt_find(&lavf_ctx->oformat->priv_class,
- "dtshd_rate", NULL, 0, 0);
- if (!opt)
- goto fail;
- dtshd_rate = (int*)(((uint8_t*)lavf_ctx->priv_data) +
- opt->offset);
- *dtshd_rate = 192000*4;
- spdif_ctx->iec61937_packet_size = 32768;
- sh->sample_format = AF_FORMAT_IEC61937_LE;
- sh->samplerate = 192000; // DTS core require 48000
- sh->channels = 2*4;
- sh->i_bps = bps;
+ case CODEC_ID_DTS:
+ if(sh->opts->dtshd) {
+ opt = av_opt_find(&lavf_ctx->oformat->priv_class,
+ "dtshd_rate", NULL, 0, 0);
+ if (!opt)
+ goto fail;
+ dtshd_rate = (int*)(((uint8_t*)lavf_ctx->priv_data) +
+ opt->offset);
+ *dtshd_rate = 192000*4;
+ spdif_ctx->iec61937_packet_size = 32768;
+ sh->sample_format = AF_FORMAT_IEC61937_LE;
+ sh->samplerate = 192000; // DTS core require 48000
+ sh->channels = 2*4;
+ sh->i_bps = bps;
+ } else {
+ spdif_ctx->iec61937_packet_size = 32768;
+ sh->sample_format = AF_FORMAT_AC3_LE;
+ sh->samplerate = srate;
+ sh->channels = 2;
+ sh->i_bps = bps;
+ }
break;
case CODEC_ID_EAC3:
spdif_ctx->iec61937_packet_size = 24576;
diff --git a/core/cfg-mplayer.h b/core/cfg-mplayer.h
index 32058e92b6..6a3d75ce21 100644
--- a/core/cfg-mplayer.h
+++ b/core/cfg-mplayer.h
@@ -441,6 +441,7 @@ const m_option_t common_opts[] = {
OPT_STRING("ad", audio_decoders, 0),
OPT_STRING("vd", video_decoders, 0),
+ OPT_FLAG("dtshd", dtshd, 0),
OPT_CHOICE("hwdec", hwdec_api, 0,
({"no", 0},
diff --git a/core/options.h b/core/options.h
index c9517f0ead..9f54598361 100644
--- a/core/options.h
+++ b/core/options.h
@@ -132,6 +132,7 @@ typedef struct MPOpts {
int audio_output_channels;
int audio_output_format;
+ int dtshd;
float playback_speed;
float drc_level;
struct m_obj_settings *vf_settings;