--- dtvrecorder.cpp.orig        2007-08-09 22:19:47.000000000 -0700
+++ dtvrecorder.cpp     2007-08-09 21:50:48.000000000 -0700
@@ -354,8 +371,9 @@
  */
 bool DTVRecorder::FindH264Keyframes(const TSPacket* tspacket)
 {
-    if (!tspacket->HasPayload())
-        return false;
+    bool haveBufferedData = !_payload_buffer.empty();
+    if (!tspacket->HasPayload()) // no payload to scan
+        return !haveBufferedData;
 
     const bool payloadStart = tspacket->PayloadStart();
     if (payloadStart)
--- dvbrecorder.cpp.orig        2007-08-09 22:20:34.000000000 -0700
+++ dvbrecorder.cpp     2007-08-09 21:46:05.000000000 -0700
@@ -1162,7 +1158,7 @@
 
     // Check for keyframes and count frames
     if (info->streamType == StreamID::H264Video)
-        FindH264Keyframes(&tspacket);
+        _buffer_packets = !FindH264Keyframes(&tspacket);
     else if (StreamID::IsVideo(info->streamType))
         _buffer_packets = !FindMPEG2Keyframes(&tspacket);
         else if (info->streamType==0x05 && _dummy_output_video_pid ) {
