Index: mythtv/libs/libmythtv/NuppelVideoPlayer.cpp
===================================================================
--- mythtv/libs/libmythtv/NuppelVideoPlayer.cpp	(.../file:///var/lib/svn/mythtv/trunk)	(Revision 27)
+++ mythtv/libs/libmythtv/NuppelVideoPlayer.cpp	(Arbeitskopie)
@@ -3753,6 +3753,18 @@
     audio_codec = ac;
 }
 
+bool NuppelVideoPlayer::ToggleUpmixer()
+{
+    if (audioOutput)
+    {
+        const AudioSettings settings(
+                audio_bits, audio_channels, audio_samplerate,
+                audio_passthru, audio_codec);
+        return audioOutput->ToggleUpmixer(settings);
+    } 
+    return false;
+}
+
 void NuppelVideoPlayer::SetEffDsp(int dsprate)
 {
     if (audioOutput)
Index: mythtv/libs/libmythtv/tv_play.h
===================================================================
--- mythtv/libs/libmythtv/tv_play.h	(.../file:///var/lib/svn/mythtv/trunk)	(Revision 27)
+++ mythtv/libs/libmythtv/tv_play.h	(Arbeitskopie)
@@ -239,6 +239,7 @@
     // Used by EPG
     void ChangeVolume(bool up);
     void ToggleMute(void);
+    void ToggleUpmixer(void);
 
     // Used for UDPNotify
     bool HasUDPNotifyEvent(void) const;
Index: mythtv/libs/libmythtv/tv_play.cpp
===================================================================
--- mythtv/libs/libmythtv/tv_play.cpp	(.../file:///var/lib/svn/mythtv/trunk)	(Revision 27)
+++ mythtv/libs/libmythtv/tv_play.cpp	(Arbeitskopie)
@@ -380,6 +380,7 @@
     REG_KEY("TV Playback", "VOLUMEDOWN", "Volume down", "[,{,F10,Volume Down");
     REG_KEY("TV Playback", "VOLUMEUP",   "Volume up",   "],},F11,Volume Up");
     REG_KEY("TV Playback", "MUTE",       "Mute",        "|,\\,F9,Volume Mute");
+    REG_KEY("TV Playback", "TOGGLEUPMIXER",       "Toggle Upmixer",        "F12,Toggle Upmixer");
     REG_KEY("TV Playback", "TOGGLEPIPMODE", "Toggle Picture-in-Picture mode",
             "V");
     REG_KEY("TV Playback", "TOGGLEPIPWINDOW", "Toggle active PiP window", "B");
@@ -2768,7 +2769,7 @@
             else if (action == "VOLUMEDOWN" || action == "VOLUMEUP" ||
                      action == "STRETCHINC" || action == "STRETCHDEC" ||
                      action == "MUTE"       || action == "TOGGLEASPECT" ||
-                     action == "TOGGLEFILL" )
+                     action == "TOGGLEFILL" || action == "TOGGLEUPMIXER")
             {
                 passThru = 1;
                 handled = false;
@@ -2823,7 +2824,7 @@
             else if (action == "VOLUMEDOWN" || action == "VOLUMEUP" ||
                      action == "STRETCHINC" || action == "STRETCHDEC" ||
                      action == "MUTE" || action == "PAUSE" ||
-                     action == "CLEAROSD")
+                     action == "CLEAROSD" || action == "TOGGLEUPMIXER")
             {
                 passThru = 1;
                 handled = false;
@@ -3390,6 +3391,8 @@
             ChangeVolume(true);
         else if (action == "MUTE")
             ToggleMute();
+        else if (action == "TOGGLEUPMIXER")
+            ToggleUpmixer();
         else if (action == "STRETCHINC")
             ChangeTimeStretch(1);
         else if (action == "STRETCHDEC")
@@ -6177,6 +6180,21 @@
         GetOSD()->SetSettingsText(text, 5);
 }
 
+void TV::ToggleUpmixer(void)
+{
+    bool state=nvp->ToggleUpmixer();
+
+    QString text;
+
+    if(state)
+        text = tr("Upmixer enabled");
+    else
+        text = tr("Upmixer disabled");
+
+    if (GetOSD() && !browsemode)
+        GetOSD()->SetSettingsText(text, 5);
+}
+
 void TV::ToggleSleepTimer(void)
 {
     QString text;
@@ -7394,6 +7412,8 @@
 
     if (HandleTrackAction(action))
         ;
+    else if (action == "TOGGLEUPMIXER")
+        ToggleUpmixer();
     else if (action == "TOGGLEMANUALZOOM")
         SetManualZoom(true);
     else if (action == "TOGGLESTRETCH")
@@ -7634,6 +7654,7 @@
                 QString("TOGGLEPICCONTROLS%1").arg(i));
         }
     }
+    new OSDGenericTree(treeMenu, tr("Toggle Upmixer"), "TOGGLEUPMIXER");
 
     new OSDGenericTree(treeMenu, tr("Manual Zoom Mode"), "TOGGLEMANUALZOOM");
 
Index: mythtv/libs/libmythtv/NuppelVideoPlayer.h
===================================================================
--- mythtv/libs/libmythtv/NuppelVideoPlayer.h	(.../file:///var/lib/svn/mythtv/trunk)	(Revision 27)
+++ mythtv/libs/libmythtv/NuppelVideoPlayer.h	(Arbeitskopie)
@@ -127,6 +127,7 @@
     void SetAudioParams(int bits, int channels, int samplerate, bool passthru);
     void SetEffDsp(int dsprate);
     void SetAudioCodec(void *ac);
+    bool ToggleUpmixer();
 
     // Sets
     void SetParentWidget(QWidget *widget)     { parentWidget = widget; }
Index: mythtv/libs/libmyth/audiooutputbase.h
===================================================================
--- mythtv/libs/libmyth/audiooutputbase.h	(.../file:///var/lib/svn/mythtv/trunk)	(Revision 27)
+++ mythtv/libs/libmyth/audiooutputbase.h	(Arbeitskopie)
@@ -77,6 +77,7 @@
     /// Audio Buffer Size -- should be divisible by 12,10,8,6,4,2..
     static const uint kAudioRingBufferSize   = 1536000;
 
+    virtual bool ToggleUpmixer(const AudioSettings&);
  protected:
     // You need to implement the following functions
     virtual bool OpenDevice(void) = 0;
@@ -157,6 +158,7 @@
     int source_audio_channels;
     int source_audio_bytes_per_sample;
     bool needs_upmix;
+    bool upmixer_enabled;
     int surround_mode;
 
     bool blocking; // do AddSamples calls block?
Index: mythtv/libs/libmyth/audiooutputbase.cpp
===================================================================
--- mythtv/libs/libmyth/audiooutputbase.cpp	(.../file:///var/lib/svn/mythtv/trunk)	(Revision 27)
+++ mythtv/libs/libmyth/audiooutputbase.cpp	(Arbeitskopie)
@@ -50,6 +50,7 @@
     source_audio_channels(-1),
     source_audio_bytes_per_sample(0),
     needs_upmix(false),
+    upmixer_enabled(false),
     surround_mode(FreeSurround::SurroundModePassive),
 
     blocking(false),
@@ -194,6 +195,11 @@
     int lsource_audio_channels = settings.channels;
     bool lneeds_upmix = false;
 
+    if (!upmixer_enabled)
+        configured_audio_channels = settings.channels;
+    else
+        configured_audio_channels = gContext->GetNumSetting("MaxChannels", 2);
+
     if (settings.codec)
     {
         lcodec_id = ((AVCodecContext*)settings.codec)->codec_id;
@@ -818,6 +824,13 @@
     return len;
 }
 
+bool AudioOutputBase::ToggleUpmixer(const AudioSettings& settings)
+{
+    upmixer_enabled = !upmixer_enabled;
+    this->Reconfigure(settings);
+    return upmixer_enabled;
+}
+
 void AudioOutputBase::_AddSamples(void *buffer, bool interleaved, int samples,
                                   long long timecode)
 {
@@ -834,11 +847,11 @@
 
     VERBOSE(VB_AUDIO+VB_TIMESTAMP,
             LOC + QString("_AddSamples samples=%1 bytes=%2, used=%3, "
-                          "free=%4, timecode=%5 needsupmix %6")
+                          "free=%4, timecode=%5 needsupmix %6 upmixer enabled %7")
             .arg(samples)
             .arg(samples * abps)
             .arg(kAudioRingBufferSize-afree).arg(afree).arg(timecode)
-            .arg(needs_upmix));
+            .arg(needs_upmix).arg(upmixer_enabled));
 
     if (upmixer && needs_upmix)
     {
Index: mythtv/libs/libmyth/audiooutput.h
===================================================================
--- mythtv/libs/libmyth/audiooutput.h	(.../file:///var/lib/svn/mythtv/trunk)	(Revision 27)
+++ mythtv/libs/libmyth/audiooutput.h	(Arbeitskopie)
@@ -69,6 +69,8 @@
     virtual void bufferOutputData(bool y) = 0;
     virtual int readOutputData(unsigned char *read_buffer, int max_length) = 0;
 
+    virtual bool ToggleUpmixer(const AudioSettings&) = 0;
+
   protected:
     void Error(const QString &msg);
     void Warn(const QString &msg);
Index: mythtv/programs/mythtranscode/transcode.cpp
===================================================================
--- mythtv/programs/mythtranscode/transcode.cpp	(.../file:///var/lib/svn/mythtv/trunk)	(Revision 27)
+++ mythtv/programs/mythtranscode/transcode.cpp	(Arbeitskopie)
@@ -166,6 +166,10 @@
         // Do nothing
         return;
     }
+    virtual bool ToggleUpmixer(const AudioSettings&)
+    {
+        return false;
+    };
 
     virtual int GetAudiotime(void)
     {
