diff --git a/mythtv/libs/libmythtv/recorders/dtvrecorder.cpp b/mythtv/libs/libmythtv/recorders/dtvrecorder.cpp
index 0c30b10..0b438cd 100644
--- a/mythtv/libs/libmythtv/recorders/dtvrecorder.cpp
+++ b/mythtv/libs/libmythtv/recorders/dtvrecorder.cpp
@@ -277,7 +277,7 @@ void DTVRecorder::InitStreamData(void)
 void DTVRecorder::BufferedWrite(const TSPacket &tspacket)
 {
     // delay until first GOP to avoid decoder crash on res change
-    if (_wait_for_keyframe_option && _first_keyframe<0)
+    if (!_buffer_packets && _wait_for_keyframe_option && _first_keyframe<0)
         return;
 
     if (curRecording && timeOfFirstDataIsSet.testAndSetRelaxed(0,1))
@@ -762,15 +762,16 @@ void DTVRecorder::HandleKeyframe(uint64_t frameNum, int64_t extra)
  */
 bool DTVRecorder::FindH264Keyframes(const TSPacket *tspacket)
 {
+    bool haveBufferedData = !_payload_buffer.empty();
+
+    if (!tspacket->HasPayload()) // no payload to scan
+        return !haveBufferedData;
+
     if (!ringBuffer)
     {
         LOG(VB_GENERAL, LOG_ERR, LOC + "FindH264Keyframes: No ringbuffer");
-        return false;
-    }
-
-    bool haveBufferedData = !_payload_buffer.empty();
-    if (!tspacket->HasPayload()) // no payload to scan
         return !haveBufferedData;
+    }
 
     const bool payloadStart = tspacket->PayloadStart();
     if (payloadStart)
@@ -789,8 +790,10 @@ bool DTVRecorder::FindH264Keyframes(const TSPacket *tspacket)
     bool hasKeyFrame = false;
 
     // scan for PES packets and H.264 NAL units
-    uint i = tspacket->AFCOffset();
-    for (; i < TSPacket::kSize; i++)
+    const uint pid = tspacket->PID();
+    uint         i = tspacket->AFCOffset();
+
+    for (; i < TSPacket::kSize; ++i)
     {
         // special handling required when a new PES packet begins
         if (payloadStart && !_pes_synced)
@@ -879,7 +882,18 @@ bool DTVRecorder::FindH264Keyframes(const TSPacket *tspacket)
                 frameRate = m_h264_parser.frameRate();
             }
         }
-    } // for (; i < TSPacket::kSize; i++)
+    } // for (; i < TSPacket::kSize; ++i)
+
+    if (!(_pid_status[pid] & kPayloadStartSeen) && tspacket->HasPayload())
+    {
+        if (tspacket->PayloadStart())
+        {
+            LOG(VB_RECORD, LOG_INFO, LOC +
+                QString("PID 0x%1 Found Payload Start").arg(pid,0,16));
+
+            _pid_status[pid] |= kPayloadStartSeen;
+        }
+    }
 
     if (hasKeyFrame)
     {
@@ -892,6 +906,13 @@ bool DTVRecorder::FindH264Keyframes(const TSPacket *tspacket)
         _frames_seen_count++;
         if (!_wait_for_keyframe_option || _first_keyframe >= 0)
             UpdateFramesWritten();
+        else
+        {
+            /* Found a frame that is not a keyframe, and we want to
+             * start on a keyframe. */
+            _pid_status[pid] &= 0;
+            _payload_buffer.clear();
+        }
     }
 
     if ((aspectRatio > 0) && (aspectRatio != m_videoAspect))
@@ -1287,8 +1308,9 @@ bool DTVRecorder::ProcessVideoTSPacket(const TSPacket &tspacket)
     // Check for keyframes and count frames
     if (streamType == StreamID::H264Video)
     {
-        _buffer_packets = !FindH264Keyframes(&tspacket);
-        if (_wait_for_keyframe_option && !_seen_sps)
+        _buffer_packets = !FindH264Keyframes(&tspacket) &&
+                          (_pid_status[tspacket.PID()] & kPayloadStartSeen);
+        if (!_buffer_packets && _wait_for_keyframe_option && !_seen_sps)
             return true;
     }
     else
@@ -1329,7 +1351,7 @@ bool DTVRecorder::ProcessAVTSPacket(const TSPacket &tspacket)
     }
 
     // Sync recording start to first keyframe
-    if (_wait_for_keyframe_option && _first_keyframe < 0)
+    if (!_buffer_packets && _wait_for_keyframe_option && _first_keyframe < 0)
         return true;
 
     // Sync streams to the first Payload Unit Start Indicator
