Index: libs/libmythtv/scheduledrecording.h
===================================================================
--- libs/libmythtv/scheduledrecording.h	(revision 6786)
+++ libs/libmythtv/scheduledrecording.h	(working copy)
@@ -49,6 +49,7 @@
 class SRFindDay;
 class SRFindTime;
 class SRFindId;
+class SRTimeStretch;
 class SRParentId;
 
 class ScheduledRecording: public ConfigurationGroup, public ConfigurationDialog {
@@ -161,6 +162,7 @@
     void setFindTimeObj(SRFindTime* val) {findtime = val;}
     void setFindIdObj(SRFindId* val) {findid = val;}
     void setParentIdObj(SRParentId* val) {parentid = val;}
+    void setTimeStretchIDObj(SRTimeStretch* val) {timestretchid = val;}
     
     void ToMap(QMap<QString, QString>& infoMap);
     
@@ -225,6 +227,7 @@
     class SRFindDay* findday;
     class SRFindTime* findtime;
     class SRFindId* findid;
+    SRTimeStretch* timestretchid;
     class SRParentId* parentid;
     
     ProgramInfo* m_pginfo;
Index: libs/libmythtv/NuppelVideoPlayer.cpp
===================================================================
--- libs/libmythtv/NuppelVideoPlayer.cpp	(revision 6786)
+++ libs/libmythtv/NuppelVideoPlayer.cpp	(working copy)
@@ -1850,6 +1850,10 @@
             return;
     }
 
+    if (audioOutput)
+        audioOutput->SetStretchFactor(audio_stretchfactor);
+    next_play_speed = audio_stretchfactor;
+
     if (!InitVideo())
     {
         qApp->lock();
Index: libs/libmythtv/sr_items.cpp
===================================================================
--- libs/libmythtv/sr_items.cpp	(revision 6786)
+++ libs/libmythtv/sr_items.cpp	(working copy)
@@ -30,6 +30,9 @@
 
     inactive = new SRInactive(_rec, this, _parentList);
     addItem(inactive->getItem(), -1);
+
+    tsValue = new SRTimeStretch(_rec, _parentList, this);
+    addItem(tsValue->getItem(), -1);
 }
 
 
@@ -152,4 +155,32 @@
     }
 }
 
+SRTimeStretch::SRTimeStretch(ScheduledRecording &_parent, ManagedList *_list,
+        ManagedListGroup *_group) : SRSelectSetting(_parent,
+        "timeStretchList", QString("[ %1 ]").arg(QObject::tr("Time Stretch")),
+        _group, "tsdefault", _list)
+{
+    _parent.setTimeStretchIDObj(this);
+}
 
+void SRTimeStretch::load()
+{
+    fillSelections();
+    SRSelectSetting::load();
+
+    setValue(QString::number(settingValue.toDouble(), 'f', 2));
+    setUnchanged();
+}
+
+void SRTimeStretch::fillSelections()
+{
+    clearSelections();
+    QString ts_text = QObject::tr("Default time stretch %1");
+    float tsfac = 0.5;
+    float tsstep = 0.05;
+    while (tsfac < 2.01) {
+        addSelection(ts_text.arg(tsfac, 0, 'f', 2),
+                QString::number(tsfac, 'f', 2));
+        tsfac += tsstep;
+    }
+}
Index: libs/libmythtv/tv_play.cpp
===================================================================
--- libs/libmythtv/tv_play.cpp	(revision 6786)
+++ libs/libmythtv/tv_play.cpp	(working copy)
@@ -523,6 +523,8 @@
     else
         ChangeState(kState_WatchingPreRecorded);
 
+    normal_speed = playbackinfo->timestretch;
+
     if (class LCD * lcd = LCD::Get())
         lcd->switchToChannel(rcinfo->chansign, rcinfo->title, rcinfo->subtitle);
 
@@ -1034,6 +1036,8 @@
     nvp->SetExactSeeks(gContext->GetNumSetting("ExactSeeking"));
     nvp->SetAutoCommercialSkip(autoCommercialSkip);
 
+    nvp->SetAudioStretchFactor(normal_speed);
+
     if (gContext->GetNumSetting("DefaultCCMode"))
         nvp->ToggleCC(vbimode, 0);
 
Index: libs/libmythtv/dbcheck.cpp
===================================================================
--- libs/libmythtv/dbcheck.cpp	(revision 6786)
+++ libs/libmythtv/dbcheck.cpp	(working copy)
@@ -10,7 +10,7 @@
 #include "mythdbcon.h"
 
 /// This is the DB schema version expected by the running MythTV instance.
-const QString currentDatabaseVersion = "1087";
+const QString currentDatabaseVersion = "1088";
 
 static bool UpdateDBVersionNumber(const QString &newnumber);
 static bool performActualUpdate(const QString updates[], QString version,
@@ -1944,7 +1944,17 @@
         if (!performActualUpdate(updates, "1087", dbver))
             return false;
     }
-    
+ 
+    if (dbver == "1087")
+    {
+        const QString updates[] = {
+"ALTER TABLE record ADD COLUMN tsdefault FLOAT NOT NULL DEFAULT 1.0;",
+"ALTER TABLE recorded ADD COLUMN timestretch FLOAT NOT NULL DEFAULT 1.0;",
+""
+};
+        performActualUpdate(updates, "1088", dbver);
+    }
+   
     return true;
 }
 
Index: libs/libmythtv/programinfo.h
===================================================================
--- libs/libmythtv/programinfo.h	(revision 6786)
+++ libs/libmythtv/programinfo.h	(working copy)
@@ -13,7 +13,7 @@
 typedef QMap<long long, long long> frm_pos_map_t;
 typedef QMap<long long, int> frm_dir_map_t;
 
-#define NUMPROGRAMLINES 39
+#define NUMPROGRAMLINES 40
 
 typedef enum {
     MARK_UNSET = -10,
@@ -256,6 +256,8 @@
     bool hasAirDate;
     bool repeat;
 
+    float timestretch;
+
     int spread;
     int startCol;
 
Index: libs/libmythtv/sr_items.h
===================================================================
--- libs/libmythtv/sr_items.h	(revision 6786)
+++ libs/libmythtv/sr_items.h	(working copy)
@@ -331,6 +331,7 @@
         class SREndOffset* endOffset;
         class SRDupMethod* dupMethItem;
         class SRDupIn* dupLocItem;
+        class SRTimeStretch* tsValue;
 
         ScheduledRecording& schedRec;
 };
@@ -793,5 +794,15 @@
         void showNewRecGroup();
         void onGoingBack();
 };
+
+class SRTimeStretch : public SRSelectSetting 
+{
+    public:
+        SRTimeStretch(ScheduledRecording &_parent, ManagedList *_list,
+                ManagedListGroup *_group);
+        void load();
+        void fillSelections();
+};
+
 #endif
 
Index: libs/libmythtv/programinfo.cpp
===================================================================
--- libs/libmythtv/programinfo.cpp	(revision 6786)
+++ libs/libmythtv/programinfo.cpp	(working copy)
@@ -66,6 +66,7 @@
     year = "";
     stars = 0;
     availableStatus = asAvailable;    
+    timestretch = 1.0;
 
     pathname = "";
     filesize = 0;
@@ -193,6 +194,8 @@
     hasAirDate = other.hasAirDate;
     repeat = other.repeat;
 
+    timestretch = other.timestretch;
+
     seriesid = other.seriesid;
     programid = other.programid;
     catType = other.catType;
@@ -286,6 +289,7 @@
     FLOAT_TO_LIST(stars)
     DATETIME_TO_LIST(QDateTime(originalAirDate))
     INT_TO_LIST(hasAirDate)     
+    FLOAT_TO_LIST(timestretch);
 }
 
 /** \fn ProgramInfo::FromStringList(QStringList&,int)
@@ -382,6 +386,7 @@
     FLOAT_FROM_LIST(stars)
     DATE_FROM_LIST(originalAirDate);
     INT_FROM_LIST(hasAirDate);
+    FLOAT_FROM_LIST(timestretch);
 
     return true;
 }
@@ -546,6 +551,8 @@
         progMap["REPEAT"] = "";
         progMap["LONGREPEAT"] = "";
     }
+
+    progMap["timestretch"] = QString::number(timestretch, 'f', 2);
    
     progMap["seriesid"] = seriesid;
     progMap["programid"] = programid;
@@ -692,7 +699,7 @@
                   "channel.callsign,channel.name,channel.commfree, "
                   "channel.outputfilters,seriesid,programid,filesize, "
                   "lastmodified,stars,previouslyshown,originalairdate, "
-                  "hostname,recordid,transcoder "
+                  "hostname,recordid,transcoder,timestretch "
                   "FROM recorded "
                   "LEFT JOIN channel "
                   "ON recorded.chanid = channel.chanid "
@@ -752,6 +759,8 @@
 
         proginfo->programflags = proginfo->getProgramFlags();
 
+        proginfo->timestretch = query.value(21).toString().toFloat();
+
         return proginfo;
     }
 
@@ -1213,11 +1222,12 @@
     query.prepare("INSERT INTO recorded (chanid,starttime,endtime,title,"
                   " subtitle,description,hostname,category,recgroup,"
                   " autoexpire,recordid,seriesid,programid,stars,"
-                  " previouslyshown,originalairdate,findid,transcoder)"
+                  " previouslyshown,originalairdate,findid,transcoder,"
+                  " timestretch)"
                   " VALUES(:CHANID,:STARTS,:ENDS,:TITLE,:SUBTITLE,:DESC,"
                   " :HOSTNAME,:CATEGORY,:RECGROUP,:AUTOEXP,:RECORDID,"
                   " :SERIESID,:PROGRAMID,:STARS,:REPEAT,:ORIGAIRDATE,"
-                  " :FINDID,:TRANSCODER);");
+                  " :FINDID,:TRANSCODER,:TIMESTRETCH);");
     query.bindValue(":CHANID", chanid);
     query.bindValue(":STARTS", starts);
     query.bindValue(":ENDS", ends);
@@ -1236,6 +1246,7 @@
     query.bindValue(":REPEAT", repeat);
     query.bindValue(":ORIGAIRDATE", originalAirDate);
     query.bindValue(":TRANSCODER", record->GetTranscoder());
+    query.bindValue(":TIMESTRETCH", timestretch);
 
     if (!query.exec() || !query.isActive())
         MythContext::DBError("WriteRecordedToDB", query);
Index: libs/libmythtv/scheduledrecording.cpp
===================================================================
--- libs/libmythtv/scheduledrecording.cpp	(revision 6786)
+++ libs/libmythtv/scheduledrecording.cpp	(working copy)
@@ -43,6 +43,7 @@
     inactive = NULL;
     searchType = "";
     searchForWhat = "";
+    timestretchid = NULL;
         
     longChannelFormat = gContext->GetSetting("LongChannelFormat", "<num> <name>");
     channelFormat = gContext->GetSetting("ChannelFormat", "<num> <sign>");
@@ -786,6 +787,9 @@
     recgroup->setValue("Default");
 
     inactive->setValue(0);
+
+    timestretchid->fillSelections();
+    timestretchid->setValue(QString::number(1.0f, 'f', 2));
 }
 
 void ScheduledRecording::setProgram(ProgramInfo *proginfo)
Index: libs/libmyth/mythcontext.h
===================================================================
--- libs/libmyth/mythcontext.h	(revision 6786)
+++ libs/libmyth/mythcontext.h	(working copy)
@@ -162,7 +162,7 @@
 };
 
 #define MYTH_BINARY_VERSION "0.18.20050523-1"
-#define MYTH_PROTO_VERSION "17"
+#define MYTH_PROTO_VERSION "18"
 
 extern int print_verbose_messages;
 
Index: programs/mythbackend/mainserver.cpp
===================================================================
--- programs/mythbackend/mainserver.cpp	(revision 6786)
+++ programs/mythbackend/mainserver.cpp	(working copy)
@@ -887,7 +887,7 @@
                        "record.recordid,outputfilters,"
                        "recorded.seriesid,recorded.programid,recorded.filesize, "
                        "recorded.lastmodified, recorded.findid, "
-                       "recorded.originalairdate "
+                       "recorded.originalairdate, recorded.timestretch "
                        "FROM recorded "
                        "LEFT JOIN record ON recorded.recordid = record.recordid "
                        "LEFT JOIN channel ON recorded.chanid = channel.chanid "
@@ -951,6 +951,8 @@
                 proginfo->hasAirDate = true;
             }
 
+            proginfo->timestretch = query.value(27).toString().toFloat();
+
             if (proginfo->hostname.isEmpty() || proginfo->hostname.isNull())
                 proginfo->hostname = gContext->GetHostName();
 
Index: programs/mythbackend/scheduler.cpp
===================================================================
--- programs/mythbackend/scheduler.cpp	(revision 6786)
+++ programs/mythbackend/scheduler.cpp	(working copy)
@@ -1723,7 +1723,7 @@
 "cardinput.cardinputid, UPPER(cardinput.shareable) = 'Y' AS shareable, "
 "program.seriesid, program.programid, program.category_type, "
 "program.airdate, program.stars, program.originalairdate, record.inactive, "
-"record.parentid, ") + progfindid + QString(
+"record.parentid, ") + progfindid + ", record.tsdefault " + QString(
 "FROM recordmatch "
 
 " INNER JOIN record ON (recordmatch.recordid = record.recordid) "
@@ -1862,6 +1862,7 @@
         bool inactive = result.value(33).toInt();
         p->parentid = result.value(34).toInt();
         p->findid = result.value(35).toInt();
+        p->timestretch = result.value(36).toString().toFloat();
 
         if (!recTypeRecPriorityMap.contains(p->rectype))
             recTypeRecPriorityMap[p->rectype] = 
@@ -2052,7 +2053,8 @@
 "record.subtitle, record.description, record.recpriority, record.type, "
 "channel.name, record.recordid, record.recgroup, record.dupin, "
 "record.dupmethod, channel.commfree, channel.channum, record.station, "
-"record.seriesid, record.programid, record.category, record.findid "
+"record.seriesid, record.programid, record.category, record.findid, "
+"record.tsdefault"
 "FROM record "
 "LEFT JOIN channel ON channel.callsign = record.station "
 "GROUP BY recordid "
@@ -2112,6 +2114,7 @@
             proginfo->programid = result.value(19).toString();
             proginfo->category = result.value(20).toString();
             proginfo->findid = result.value(21).toInt();
+            proginfo->timestretch = result.value(22).toString().toFloat();
             
             proginfo->recstartts = proginfo->startts;
             proginfo->recendts = proginfo->endts;
