diff -ur mythtv-20050114/libs/libavformat/mpeg.c mythtv-20050114-work/libs/libavformat/mpeg.c
--- mythtv-20050114/libs/libavformat/mpeg.c	2005-01-09 07:30:33.000000000 +0800
+++ mythtv-20050114-work/libs/libavformat/mpeg.c	2005-01-14 06:33:15.326180736 +0800
@@ -1531,6 +1531,11 @@
         goto skip;
     st->codec.codec_type = type;
     st->codec.codec_id = codec_id;
+    /*notify the callback of the change in streams*/
+    if (s->streams_changed) {
+        s->streams_changed(s->stream_change_data);
+    }
+
     if (codec_id != CODEC_ID_PCM_S16BE)
         st->need_parsing = 1;
  found:
diff -ur mythtv-20050114/libs/libmythtv/NuppelVideoPlayer.cpp mythtv-20050114-work/libs/libmythtv/NuppelVideoPlayer.cpp
--- mythtv-20050114/libs/libmythtv/NuppelVideoPlayer.cpp	2005-01-14 06:21:06.129035000 +0800
+++ mythtv-20050114-work/libs/libmythtv/NuppelVideoPlayer.cpp	2005-01-14 06:33:15.327180584 +0800
@@ -4173,6 +4173,13 @@
         return false;
 }
 
+QString NuppelVideoPlayer::getCurrentAudioTrackDescription()
+{
+    if (decoder)
+        return decoder->getCurrentAudioTrackDescription();
+    else
+        return QString("Unknown audio");
+}
 
 int NuppelVideoPlayer::getCurrentAudioTrack()
 {
diff -ur mythtv-20050114/libs/libmythtv/NuppelVideoPlayer.h mythtv-20050114-work/libs/libmythtv/NuppelVideoPlayer.h
--- mythtv-20050114/libs/libmythtv/NuppelVideoPlayer.h	2004-12-08 12:23:16.000000000 +0800
+++ mythtv-20050114-work/libs/libmythtv/NuppelVideoPlayer.h	2005-01-14 06:33:15.328180432 +0800
@@ -203,6 +203,7 @@
     void decCurrentAudioTrack();
     bool setCurrentAudioTrack(int trackNo);
     int getCurrentAudioTrack();
+    QString getCurrentAudioTrackDescription();
 
     long long CalcMaxFFTime(long long ff);
 
diff -ur mythtv-20050114/libs/libmythtv/avformatdecoder.cpp mythtv-20050114-work/libs/libmythtv/avformatdecoder.cpp
--- mythtv-20050114/libs/libmythtv/avformatdecoder.cpp	2005-01-09 07:30:34.000000000 +0800
+++ mythtv-20050114-work/libs/libmythtv/avformatdecoder.cpp	2005-01-14 06:33:15.329180280 +0800
@@ -39,6 +39,7 @@
     audio_channels = -1;
     audio_sample_size = -1;
     audio_sampling_rate = -1;
+    audio_codec = -1;
 
     exitafterdecoded = false;
     ateof = false;
@@ -522,11 +523,8 @@
         {
             VERBOSE(VB_IMPORTANT, 
                     QString("AvFormatDecoder: Could not find decoder for "
-                            "codec (%1) aborting.")
+                            "codec,  ignoring (%1).")
                            .arg(enc->codec_id));
-            av_close_input_file(ic);
-            ic = NULL;
-            scanerror = -1;
             continue;
         }
 
@@ -597,28 +595,49 @@
     return true;
 }
 
-void AvFormatDecoder::CheckAudioParams(int freq, int channels, bool safe)
+QString AvFormatDecoder::getCurrentAudioTrackDescription()
+{
+	switch (audio_codec)
+	{
+		case CODEC_ID_AC3:
+
+		   	return QString("Dolby Digital ");
+		case CODEC_ID_MP2:
+			return QString("%1 kHz, %2 channel MPEG audio").
+				arg(audio_sampling_rate/1000).
+				arg(audio_channels);
+		default:
+			return QString("%1 kHz, %2 channel audio").
+				arg(audio_sampling_rate/1000).
+		    	arg(audio_channels);	
+	}		
+}
+
+void AvFormatDecoder::CheckAudioParams(int freq, int channels, int codec_id, bool safe)
 {
     if (freq <= 0 || channels <= 0)
         return;
 
     if (safe || audio_check_1st == 2)
     {
-        if (freq == audio_sampling_rate && channels == audio_channels)
+        if (freq == audio_sampling_rate && channels == audio_channels && audio_codec == codec_id) 
             return;
         audio_check_1st = 1;
         audio_sampling_rate_2nd = freq;
         audio_channels_2nd = channels;
+        audio_codec_2nd = codec_id; 
         if (safe == false)
             return;
     }
     else
     {
         if (freq != audio_sampling_rate_2nd || channels != audio_channels_2nd ||
-            (freq == audio_sampling_rate && channels == audio_channels))
+            codec_id != audio_codec_2nd ||
+            (freq == audio_sampling_rate && channels == audio_channels && codec_id == audio_codec))
         {
             audio_sampling_rate_2nd = -1;
             audio_channels_2nd = -1;
+            audio_codec_2nd = -1;
             audio_check_1st = 2;
             return;
         }
@@ -633,10 +652,13 @@
     audio_check_1st = 2;
 
     if (audio_channels != -1)
-        VERBOSE(VB_AUDIO, QString("Audio format changed from %1 channels,"
-                " %2hz to %3 channels %4hz").arg(audio_channels)
-                .arg(audio_sampling_rate).arg(channels).arg(freq));
-
+    {
+        VERBOSE(VB_ALL, QString("Audio format changed from %1 channels,"
+                " %2hz codec %3 to %4 channels %5hz codec %6").arg(audio_channels)
+                .arg(audio_sampling_rate).arg(audio_codec).arg(channels)
+                .arg(freq).arg(codec_id));
+    }
+	
     AVCodecContext *enc = &ic->streams[wantedAudioStream]->codec;
     AVCodec *codec = enc->codec;
     if (codec)
@@ -1019,7 +1041,7 @@
         wantedAudioStream = audioStreams[currentAudioTrack];
 
         AVCodecContext *e = &ic->streams[wantedAudioStream]->codec;
-        CheckAudioParams(e->sample_rate, e->channels, true);
+        CheckAudioParams(e->sample_rate, e->channels, e->codec_id, true);
     }
 }
 
@@ -1036,7 +1058,7 @@
         wantedAudioStream = audioStreams[currentAudioTrack];
 
         AVCodecContext *e = &ic->streams[wantedAudioStream]->codec;
-        CheckAudioParams(e->sample_rate, e->channels, true);
+        CheckAudioParams(e->sample_rate, e->channels, e->codec_id, true);
     }
 }
 
@@ -1054,15 +1076,20 @@
     wantedAudioStream = audioStreams[currentAudioTrack];
 
     AVCodecContext *e = &ic->streams[wantedAudioStream]->codec;
-    CheckAudioParams(e->sample_rate, e->channels, true);
+    CheckAudioParams(e->sample_rate, e->channels, e->codec_id, true);
     return true;
 }
 
-bool AvFormatDecoder::autoSelectAudioTrack()
+bool AvFormatDecoder::autoSelectAudioTrack(bool prefer_ac3)
 {
     if (!audioStreams.size())
         return false;
 
+    if (prefer_ac3)
+    {
+        prefer_ac3 = gContext->GetNumSetting("WantAC3", false);
+    }
+
     bool foundAudio = false;
     int minChannels = 1;
     int maxTracks = (audioStreams.size() - 1);
@@ -1077,6 +1104,12 @@
             int tempStream = audioStreams[track];
             AVCodecContext *e = &ic->streams[tempStream]->codec;
 
+            if (((prefer_ac3) && (e->codec_id != CODEC_ID_AC3)) || 
+                ((!prefer_ac3) && (e->codec_id == CODEC_ID_AC3))) 
+            {
+                continue;
+            }
+
             if (e->channels > minChannels)
             {
                 currentAudioTrack = track;
@@ -1087,15 +1120,25 @@
                 VERBOSE(VB_AUDIO, 
                         QString("It has %1 channels and we needed at least %2")
                                .arg(e->channels).arg(minChannels + 1));
+                if (prefer_ac3)
+                {
+                    VERBOSE(VB_ALL, QString("AC3 stream has been selected"));
+                }
 
                 AVCodecContext *e = &ic->streams[wantedAudioStream]->codec;
-                CheckAudioParams(e->sample_rate, e->channels, true);
+                CheckAudioParams(e->sample_rate, e->channels, e->codec_id, true);
                 return true;
             }
         }
         minChannels--;
         if (minChannels < 0)
+        {
+            if (prefer_ac3)
+            {
+                return autoSelectAudioTrack(false);
+            }
             return false;
+	}
     }
 
     return false;
@@ -1113,6 +1156,8 @@
     VERBOSE(VB_ALL, QString("Initializing audio parms from stream #%1.")
             .arg(currentAudioTrack));
 
+    audio_codec = curstream->codec.codec_id;
+
     m_parent->SetEffDsp(curstream->codec.sample_rate * 100);
 
     do_ac3_passthru = curstream->codec.codec_id == CODEC_ID_AC3 &&
@@ -1120,6 +1165,7 @@
 
     if (do_ac3_passthru)
     {
+	VERBOSE(VB_ALL, QString("AC3 passthrough is enabled"));
         // An AC3 stream looks like a 48KHz 2ch audio stream to
         // the sound card
         audio_sample_size = 4;
@@ -1283,6 +1329,13 @@
                         continue;
                     }
 
+                    //hmm the codec has changed from what we were initialised with
+                    //move to the next stream to see if it is correct
+                    if ((curstream->codec.codec_id != audio_codec))
+                    {
+                            incCurrentAudioTrack();
+                    }
+			
                     if (do_ac3_passthru)
                     {
                         data_size = pkt->size;
@@ -1304,7 +1357,9 @@
 
                     if (!do_ac3_passthru)
                         CheckAudioParams(curstream->codec.sample_rate,
-                                         curstream->codec.channels, false);
+                                         curstream->codec.channels, 
+                                         curstream->codec.codec_id,
+                                         false);
 
                     long long temppts = lastapts;
 
diff -ur mythtv-20050114/libs/libmythtv/avformatdecoder.h mythtv-20050114-work/libs/libmythtv/avformatdecoder.h
--- mythtv-20050114/libs/libmythtv/avformatdecoder.h	2005-01-09 07:30:34.000000000 +0800
+++ mythtv-20050114-work/libs/libmythtv/avformatdecoder.h	2005-01-14 06:33:15.329180280 +0800
@@ -68,6 +68,7 @@
 
     void SetPixelFormat(const int);
 
+    virtual QString getCurrentAudioTrackDescription();
     virtual void incCurrentAudioTrack();
     virtual void decCurrentAudioTrack();
     virtual bool setCurrentAudioTrack(int trackNo);
@@ -78,7 +79,7 @@
     /// Attempt to find the optimal audio stream to use based on the number of channels,
     /// and if we're doing AC3 passthrough.  This will select the highest stream number
     /// that matches our criteria.
-    bool autoSelectAudioTrack();
+    bool autoSelectAudioTrack(bool wantac3 = true);
 
     RingBuffer *getRingBuf(void) { return ringBuffer; }
 
@@ -112,7 +113,7 @@
     bool CheckVideoParams(int width, int height);
 
     /// See if the audio parameters have changed, return true if so.
-    void CheckAudioParams(int freq, int channels, bool safe);
+    void CheckAudioParams(int freq, int channels, int codec, bool safe);
     void SetupAudioStream(void);
 
     int EncodeAC3Frame(unsigned char* data, int len, short *samples,
@@ -134,10 +135,12 @@
     int audio_sample_size;
     int audio_sampling_rate;
     int audio_channels;
+    int audio_codec;
 
     int audio_check_1st;         ///< Used by CheckAudioParams
     int audio_sampling_rate_2nd; ///< Used by CheckAudioParams
     int audio_channels_2nd;      ///< Used by CheckAudioParams
+    int audio_codec_2nd;         ///< Used by CheckAudioParams
 
     int bitrate;
 
diff -ur mythtv-20050114/libs/libmythtv/decoderbase.h mythtv-20050114-work/libs/libmythtv/decoderbase.h
--- mythtv-20050114/libs/libmythtv/decoderbase.h	2005-01-09 07:30:34.000000000 +0800
+++ mythtv-20050114-work/libs/libmythtv/decoderbase.h	2005-01-14 06:33:15.329180280 +0800
@@ -64,6 +64,7 @@
 
     const int getCurrentAudioTrack() const { return currentAudioTrack;}
     virtual void incCurrentAudioTrack(){}
+    virtual QString getCurrentAudioTrackDescription(){ return QString("Unknown"); }
     virtual void decCurrentAudioTrack(){}
     virtual bool setCurrentAudioTrack(int){ return false;}
                                                           
diff -ur mythtv-20050114/libs/libmythtv/dtvrecorder.h mythtv-20050114-work/libs/libmythtv/dtvrecorder.h
--- mythtv-20050114/libs/libmythtv/dtvrecorder.h	2005-01-09 07:30:34.000000000 +0800
+++ mythtv-20050114-work/libs/libmythtv/dtvrecorder.h	2005-01-14 06:33:15.329180280 +0800
@@ -54,6 +54,8 @@
 
     void GetBlankFrameMap(QMap<long long, int> &blank_frame_map);
     virtual void Reset();
+    virtual void incCurrentAudioTrack(){}
+    virtual void decCurrentAudioTrack(){}
   protected:
     void FinishRecording(void);
     void FindKeyframes(const TSPacket* tspacket);
diff -ur mythtv-20050114/libs/libmythtv/dvbdev/transform.c mythtv-20050114-work/libs/libmythtv/dvbdev/transform.c
--- mythtv-20050114/libs/libmythtv/dvbdev/transform.c	2005-01-14 06:23:25.154900408 +0800
+++ mythtv-20050114-work/libs/libmythtv/dvbdev/transform.c	2005-01-14 06:33:15.330180128 +0800
@@ -394,6 +394,7 @@
 		switch (streamid & 0xF8){
 
 		case 0x80:
+#if 0
 			ai.off = 0;
 			ac3_off = ((p->buf[off+2] << 8)| p->buf[off+3]);
 			if (ac3_off < p->count)
@@ -408,6 +409,7 @@
 				
 				ac3_off +=  nframes * ai.framesize - p->count;
 			}
+#endif
 			break;
 
 		case 0x20:
@@ -434,17 +436,21 @@
 			switch (streamid & 0xF8){
 
 			case 0x80: 
+#if 0
 				p->count += 4;
 				p->buf[9] = streamid;
 				p->buf[10] = 0;
 				p->buf[11] = (ac3_off >> 8)& 0xFF;
 				p->buf[12] = (ac3_off)& 0xFF;
+#endif
 				break;
 				
 			case 0x20:
+#if 0
 				p->count += 2;
 				p->buf[9] = 0x20;
 				p->buf[10] = 0;				
+#endif
 				break;
 			}
 		}		
@@ -481,18 +487,17 @@
 		case PRIV_TS_AC3: /* keep this as default */
 		default:
 		{
-			int ac3_off;
-			ac3_off = get_ac3info(data, count, &ai,0);
-			if (ac3_off>=0 && ai.framesize){
+				/*
+				 * add in a dummy 4 byte audio header
+				 * to match mpeg dvd standard. The values
+				 * will be filled in later (in send_ipack)
+				 * when it has a full packet to search
+				 */
 				p->buf[p->count] = 0x80;
-				p->buf[p->count+1] = (p->size - p->count
-						      - 4 - ac3_off)/ 
-					ai.framesize + 1;
-				p->buf[p->count+2] = (ac3_off >> 8)& 0xFF;
-				p->buf[p->count+3] = (ac3_off)& 0xFF;
+				p->buf[p->count+1] = 0;
+				p->buf[p->count+2] = 0;
+				p->buf[p->count+3] = 0;
 				p->count+=4;
-				
-			}
 		}
 		break;
 		}
@@ -644,14 +649,31 @@
 				write_ipack(p, &p->hlength, 1);
 			}
 
-			if (p->mpeg == 2 && p->found < 9+p->hlength){
-				while (c < count && p->found < 9+p->hlength){
+			if (p->cid == PRIVATE_STREAM1)
+			{
+				if (p->mpeg == 2 && p->found < 9+p->hlength){
+					while (c < count && p->found < 9+p->hlength){
+						write_ipack(p, buf+c, 1);
+						c++;
+						p->found++;
+					}
+					if (c == count) return;
+				}
+			}
+			else
+			{	
+
+			if (p->mpeg == 2 && (p->flag2 & PTS_ONLY) &&  
+			    p->found < 14){
+				while (c < count && p->found < 14){
+					p->pts[p->found-9] = buf[c];
 					write_ipack(p, buf+c, 1);
 					c++;
 					p->found++;
 				}
 				if (c == count) return;
 			}
+			}
 
 			while (c < count && p->found < p->plength+6){
 				l = count -c;
diff -ur mythtv-20050114/libs/libmythtv/dvbdev/transform.h mythtv-20050114-work/libs/libmythtv/dvbdev/transform.h
--- mythtv-20050114/libs/libmythtv/dvbdev/transform.h	2005-01-14 06:23:25.154900408 +0800
+++ mythtv-20050114-work/libs/libmythtv/dvbdev/transform.h	2005-01-14 06:33:15.340178608 +0800
@@ -163,6 +163,8 @@
 		uint8_t flag1;
 		uint8_t flag2;
 		uint8_t hlength;
+		uint8_t pts[5];
+		uint8_t last_pts[5];
 		int mpeg;
 		uint8_t check;
 		int which;
diff -ur mythtv-20050114/libs/libmythtv/dvbrecorder.cpp mythtv-20050114-work/libs/libmythtv/dvbrecorder.cpp
--- mythtv-20050114/libs/libmythtv/dvbrecorder.cpp	2005-01-14 06:22:56.233297160 +0800
+++ mythtv-20050114-work/libs/libmythtv/dvbrecorder.cpp	2005-01-14 06:33:15.341178456 +0800
@@ -51,6 +51,7 @@
 
 #include "RingBuffer.h"
 #include "programinfo.h"
+#include "mythcontext.h"
 
 #include "transform.h"
 #include "dvbtypes.h"
@@ -351,7 +352,7 @@
     else
     {
         // PES recording currently only supports one video and one audio PID (I think???)
-        ElementaryPIDObject *as = m_pmt.PreferredAudioStream();
+        ElementaryPIDObject *as = m_pmt.PreferredAudioStream(gContext->GetNumSetting("WantAC3", false));
         ElementaryPIDObject *vs = m_pmt.PreferredVideoStream();
         ElementaryPIDObject *sub = m_pmt.PreferredSubtitleStream();
 
@@ -838,7 +839,7 @@
     {
         if ((*es).Record)
         {
-            pmt[p++] = (*es).Orig_Type;
+	    pmt[p++] = (*es).Type == ES_TYPE_AUDIO_AC3 ? STREAM_TYPE_AUDIO_AC3 : (*es).Orig_Type;
             pmt[p++] = ((*es).PID >> 8) & 0x1F;
             pmt[p++] = (*es).PID & 0xFF;
             
@@ -911,3 +912,17 @@
 
 //TODO
 }
+
+void DVBRecorder::incCurrentAudioTrack()
+{
+     ElementaryPIDObject *as = m_pmt.IncAudioStream();
+     if (as)
+        OpenFilters(as->PID, as->Type);
+}
+
+void DVBRecorder::decCurrentAudioTrack()
+{
+     ElementaryPIDObject *as = m_pmt.DecAudioStream();
+     if (as)
+        OpenFilters(as->PID, as->Type);
+}
diff -ur mythtv-20050114/libs/libmythtv/dvbrecorder.h mythtv-20050114-work/libs/libmythtv/dvbrecorder.h
--- mythtv-20050114/libs/libmythtv/dvbrecorder.h	2005-01-14 06:22:56.234297008 +0800
+++ mythtv-20050114-work/libs/libmythtv/dvbrecorder.h	2005-01-14 06:33:15.341178456 +0800
@@ -33,6 +33,8 @@
 
     void StartRecording(void);
     void Reset(void);
+    void incCurrentAudioTrack();
+    void decCurrentAudioTrack();
 
 public slots:
     void ChannelChanged(dvb_channel_t& chan);
diff -ur mythtv-20050114/libs/libmythtv/sitypes.h mythtv-20050114-work/libs/libmythtv/sitypes.h
--- mythtv-20050114/libs/libmythtv/sitypes.h	2005-01-04 15:11:33.000000000 +0800
+++ mythtv-20050114-work/libs/libmythtv/sitypes.h	2005-01-14 06:33:15.341178456 +0800
@@ -509,31 +509,84 @@
 
         // Try to auto detect which audio stream to use
         // (Can go away when we can record them all)
-        ElementaryPIDObject *PreferredAudioStream()
+	ElementaryPIDObject *DecAudioStream()
         {
+	    bool found = false;
             QValueList<ElementaryPIDObject>::Iterator pit;
             
-            // Change this if you prefer AC3 over PCM, and are not using TS recording
-            bool prefer_ac3 = false;            
-            if (prefer_ac3)
+	    for (pit = Components.end(); pit != Components.begin(); --pit)
             {
-                for (pit = Components.begin(); pit != Components.end(); ++pit)
-                    if ((*pit).Record && ((*pit).Type == ES_TYPE_AUDIO_AC3))
-                        return &(*pit);
-            }
-
-            // Use first PCM stream
-            for (pit = Components.begin(); pit != Components.end(); ++pit)
-                if ((*pit).Record && ((*pit).Type == ES_TYPE_AUDIO_PCM))
-                    return &(*pit);
-
-            // No PCM found - look for AC3
-            for (pit = Components.begin(); pit != Components.end(); ++pit)
-                if ((*pit).Record && ((*pit).Type == ES_TYPE_AUDIO_AC3))
-                    return &(*pit);
-
-            return NULL;
-        }
+		if (found)
+		{
+			switch ((*pit).Record && ((*pit).Type))
+			{
+			case ES_TYPE_AUDIO_AC3:
+			case ES_TYPE_AUDIO_PCM:
+        	                return &(*pit);
+			}
+		}
+  		if ((&(*pit) == currentAudioPID) || (currentAudioPID == NULL))
+		{
+			found = true;
+		}	
+	    }
+	    //didn't find a track after current, search again from
+	    //the beginning
+	    currentAudioPID = NULL;
+	    return DecAudioStream();			
+	}
+
+	ElementaryPIDObject *IncAudioStream()
+	{
+		bool found = false;
+		QValueList<ElementaryPIDObject>::Iterator pit;
+		for (pit = Components.begin(); pit != Components.end(); ++pit)
+		{
+			if (found)
+			{
+				switch ((*pit).Record && ((*pit).Type))
+				{
+					case ES_TYPE_AUDIO_AC3:
+					case ES_TYPE_AUDIO_PCM:
+						return &(*pit);
+				}
+			}
+	 		if ((&(*pit) == currentAudioPID) || (currentAudioPID == NULL))
+			{
+				found = true;
+			}		
+		}
+		//didn't find a track after current, search again from
+		//the beginning
+		currentAudioPID = NULL;
+		return IncAudioStream();
+	}
+	// Try to auto detect which audio stream to use
+	// (Can go away when we can record them all)
+	ElementaryPIDObject *PreferredAudioStream(bool prefer_ac3 = false)
+	{
+		QValueList<ElementaryPIDObject>::Iterator pit;
+		int desiredCodec = ES_TYPE_AUDIO_PCM;
+		currentAudioPID = NULL;
+		// Change this if you prefer AC3 over PCM, 
+		// and are not using TS recording.
+		if (prefer_ac3)
+		{
+			desiredCodec = ES_TYPE_AUDIO_AC3;	
+		}
+		for (pit = Components.begin(); pit != Components.end(); ++pit)
+		{
+			if ((*pit).Record && ((*pit).Type == desiredCodec))
+			{
+				currentAudioPID = &(*pit);
+			}
+		}
+		if ((prefer_ac3) && (currentAudioPID == NULL))
+		{
+			return PreferredAudioStream(false);
+		}
+	    return currentAudioPID;
+	}
 
         // Try to auto detect which video stream to use
         // (Can go away when we can record them all)
@@ -567,6 +620,7 @@
         bool hasCA;
         bool hasAudio;
         bool hasVideo;  
+	ElementaryPIDObject *currentAudioPID;
 };
 
 class PATObject 
diff -ur mythtv-20050114/libs/libmythtv/tv_play.cpp mythtv-20050114-work/libs/libmythtv/tv_play.cpp
--- mythtv-20050114/libs/libmythtv/tv_play.cpp	2004-12-25 07:24:07.000000000 +0800
+++ mythtv-20050114-work/libs/libmythtv/tv_play.cpp	2005-01-14 06:33:15.343178152 +0800
@@ -1592,11 +1592,8 @@
                 activenvp->incCurrentAudioTrack();
                 if ( activenvp->getCurrentAudioTrack() )
                 {
-                    QString msg = QString("%1 %2")
-                                  .arg(tr("Audio track"))
-                                  .arg(activenvp->getCurrentAudioTrack());
-
-                    osd->SetSettingsText(msg, 3);
+                    osd->SetSettingsText(
+			activenvp->getCurrentAudioTrackDescription(), 3);
                 }
             }
         }
@@ -1607,11 +1604,8 @@
                 activenvp->decCurrentAudioTrack();
                 if ( activenvp->getCurrentAudioTrack() )
                 {
-                    QString msg = QString("%1 %2")
-                                  .arg(tr("Audio track"))
-                                  .arg(activenvp->getCurrentAudioTrack());
-
-                    osd->SetSettingsText(msg, 3);
+                    osd->SetSettingsText(
+			activenvp->getCurrentAudioTrackDescription(), 3);
                 }
 
             }
diff -ur mythtv-20050114/libs/libmythtv/tv_rec.cpp mythtv-20050114-work/libs/libmythtv/tv_rec.cpp
--- mythtv-20050114/libs/libmythtv/tv_rec.cpp	2005-01-14 06:22:56.235296856 +0800
+++ mythtv-20050114-work/libs/libmythtv/tv_rec.cpp	2005-01-14 06:33:15.344178000 +0800
@@ -2299,3 +2299,13 @@
     pthread_mutex_unlock(&db_lock);
 }
 
+void TVRec::incCurrentAudioTrack()
+{
+#ifdef USING_DVB
+#endif
+}
+void TVRec::decCurrentAudioTrack()
+{
+#ifdef USING_DVB
+#endif
+}
diff -ur mythtv-20050114/libs/libmythtv/tv_rec.h mythtv-20050114-work/libs/libmythtv/tv_rec.h
--- mythtv-20050114/libs/libmythtv/tv_rec.h	2004-08-16 06:38:31.000000000 +0800
+++ mythtv-20050114-work/libs/libmythtv/tv_rec.h	2005-01-14 06:33:15.344178000 +0800
@@ -139,6 +139,8 @@
 
     int GetCaptureCardNum(void) { return m_capturecardnum; }
 
+    void incCurrentAudioTrack();
+    void decCurrentAudioTrack();
  protected:
     void RunTV(void);
     static void *EventThread(void *param);
diff -ur mythtv-20050114/programs/mythfrontend/globalsettings.cpp mythtv-20050114-work/programs/mythfrontend/globalsettings.cpp
--- mythtv-20050114/programs/mythfrontend/globalsettings.cpp	2004-12-20 02:26:28.000000000 +0800
+++ mythtv-20050114-work/programs/mythfrontend/globalsettings.cpp	2005-01-14 06:33:15.346177696 +0800
@@ -184,6 +184,17 @@
     return gc;
 }
 
+static GenericCheckBox *WantAC3()
+{
+    GenericCheckBox *gc = new GenericCheckBox("WantAC3");
+    gc->setLabel(QObject::tr("Use Dolby digital audio where available"));
+    gc->setValue(false);
+    gc->setHelpText(QObject::tr("Where a Dolby digital sound track is "
+			"available (usually digital TV) use it. If this is not"
+			" set then Dolby audio will be disabled"));
+    return gc;
+}
+
 static GenericCheckBox *AC3PassThrough()
 {
     GenericCheckBox *gc = new GenericCheckBox("AC3PassThru");
@@ -1880,6 +1891,7 @@
          setUseLabel(false);
 
          addChild(AudioOutputDevice());
+         addChild(WantAC3());
          addChild(AC3PassThrough());
          addChild(AggressiveBuffer());
 
