Index: libs/libmythtv/mpegrecorder.h
===================================================================
--- libs/libmythtv/mpegrecorder.h	(revision 20635)
+++ libs/libmythtv/mpegrecorder.h	(working copy)
@@ -63,6 +63,9 @@
     // ReaderPausedCB
     virtual void ReaderPaused(int fd) { pauseWait.wakeAll(); }
 
+    // Reset stream parsers when necessary
+    virtual void ResetStreamParser(void);
+
   private:
     void SetIntOption(RecordingProfile *profile, const QString &name);
     void SetStrOption(RecordingProfile *profile, const QString &name);
Index: libs/libmythtv/recorderbase.h
===================================================================
--- libs/libmythtv/recorderbase.h	(revision 20635)
+++ libs/libmythtv/recorderbase.h	(working copy)
@@ -212,6 +212,11 @@
      */
     virtual void CheckForRingBufferSwitch(void);
 
+    /** \brief Inherited method for the stream parser to be reset after
+               a ringbuffer change. Used mainly in mpegrecorder for H264Parser.
+     */
+    virtual void ResetStreamParser(void) { };
+
     /** \brief Save the seektable to the DB
      */
     void SavePositionMap(bool force = false);
Index: libs/libmythtv/mpegrecorder.cpp
===================================================================
--- libs/libmythtv/mpegrecorder.cpp	(revision 20635)
+++ libs/libmythtv/mpegrecorder.cpp	(working copy)
@@ -1430,12 +1430,7 @@
     {
         VERBOSE(VB_RECORD, LOC + "PauseAndWait unpause");
 
-        if (driver == "hdpvr")
-        {
-            m_h264_parser.Reset();
-            _wait_for_keyframe_option = true;
-            _seen_sps = false;
-        }
+        ResetStreamParser();
 
         // Some drivers require streaming to be disabled before
         // an input switch and other channel format setting.
@@ -1500,12 +1495,7 @@
 
     if (ioctl(fd, VIDIOC_ENCODER_CMD, &command) == 0)
     {
-        if (driver == "hdpvr")
-        {
-            m_h264_parser.Reset();
-            _wait_for_keyframe_option = true;
-            _seen_sps = false;
-        }
+        ResetStreamParser();
 
         VERBOSE(VB_RECORD, LOC + "Encoding started");
         return true;
@@ -1762,3 +1752,15 @@
         SetBitrate(bitrate, maxbitrate, "New");
     }
 }
+
+void MpegRecorder::ResetStreamParser(void)               
+{        
+    if (driver == "hdpvr")      
+    {
+        m_h264_parser.Reset();
+        _wait_for_keyframe_option = true;
+        _seen_sps = false;
+    }
+
+    RecorderBase::ResetStreamParser();
+}

