Index: libs/libmythtv/tv_rec.cpp
===================================================================
--- libs/libmythtv/tv_rec.cpp	(revision 11333)
+++ libs/libmythtv/tv_rec.cpp	(working copy)
@@ -136,13 +136,12 @@
       // tvchain
       tvchain(NULL),
       // RingBuffer info
-      ringBuffer(NULL), rbFilePrefix(""), rbFileExt("mpg")
+      ringBuffer(NULL), rbFilePrefix("")
 {
 }
 
 bool TVRec::CreateChannel(const QString &startchannel)
 {
-    rbFileExt = "mpg";
     bool init_run = false;
     if (genOpt.cardtype == "DVB")
     {
@@ -227,8 +226,6 @@
         CloseChannel();
         init_run = true;
 #endif
-        if (genOpt.cardtype != "HDTV" && genOpt.cardtype != "MPEG")
-            rbFileExt = "nuv";
     }
 
     if (!init_run)
@@ -641,6 +638,10 @@
 {
     if (!curRec)
         return;
+        
+    QString rbFileExt;
+    
+    GetChannelFileExtension(curRec, rbFileExt);
 
     curRec->StartedRecording(rbFilePrefix, rbFileExt);
     VERBOSE(VB_RECORD, LOC + "StartedRecording("<<curRec<<") fn("
@@ -1115,6 +1116,51 @@
     channel->Close();
 }
 
+/** \fn TVRec::GetChannelFileExtension(const ProgramInfo *pi, QString &rbFileExt) const
+ *  \brief Returns the file extension for the corresponding recording.
+ *  By default, mpg is used.  Only if a V4L card is detected is the extension changed to nuv.
+ *  \param chanId Channel
+ *  \param fileExt Recording file extension.
+ */
+bool TVRec::GetChannelFileExtension(const QString& chanId, QString& fileExt) const
+{
+    QString test;
+    
+    fileExt = "mpg";
+    
+    MSqlQuery query(MSqlQuery::InitCon());
+    query.prepare("SELECT cc.cardtype "
+                    "FROM channel ch "
+                    "JOIN cardinput ci "
+                      "ON ch.sourceid = ci.sourceid "
+                    "JOIN capturecard cc "
+                      "ON ( (ci.childcardid <> 0) AND "
+                           "(ci.childcardid = cc.cardid) )" 
+                           "OR "
+                         "( (ci.childcardid = 0) AND "
+                           "(ci.cardid = cc.cardid) ) "
+                  "WHERE ch.chanid = :CHANID");
+    query.bindValue(":CHANID", chanId);
+    
+    if (!query.exec() || !query.isActive())
+    {
+        MythContext::DBError("GetRecordingFileExtension", query);
+        return false;
+    }
+    
+    if (!query.next())
+        return false;
+        
+    test = query.value(0).toString();
+    if (test != QString::null)
+    {
+        if (test == "V4L")
+           fileExt = "nuv";  
+    }
+    
+    return true;
+}
+
 DBox2Channel *TVRec::GetDBox2Channel(void)
 {
 #ifdef USING_DBOX2
Index: libs/libmythtv/tv_rec.h
===================================================================
--- libs/libmythtv/tv_rec.h	(revision 11333)
+++ libs/libmythtv/tv_rec.h	(working copy)
@@ -254,6 +254,7 @@
     bool CreateChannel(const QString &startChanNum);
     void InitChannel(const QString &inputname, const QString &startchannel);
     void CloseChannel(void);
+    bool GetChannelFileExtension(const QString& chanId, QString& fileExt) const;
     DBox2Channel *GetDBox2Channel(void);
     HDHRChannel  *GetHDHRChannel(void);
     DVBChannel   *GetDVBChannel(void);
@@ -367,7 +368,6 @@
     // RingBuffer info
     RingBuffer  *ringBuffer;
     QString      rbFilePrefix;
-    QString      rbFileExt;
 
   public:
     static const uint kSignalMonitoringRate;
