Index: AudioPin.cpp
===================================================================
--- AudioPin.cpp	(revision 27941)
+++ AudioPin.cpp	(working copy)
@@ -181,7 +181,8 @@
   return CSourceStream::BreakConnect();
 }
 
-extern int ShowBuffer;
+//extern int ShowBuffer;
+int ShowBufferAudio=10;
 
 HRESULT CAudioPin::FillBuffer(IMediaSample *pSample)
 {
@@ -200,7 +201,7 @@
       //we dont try to read any packets, but simply return...
       if (m_pTsReaderFilter->IsSeeking() || m_pTsReaderFilter->IsStopping())// /*|| m_bSeeking*/ || m_pTsReaderFilter->IsSeekingToEof())
       {
-        //if (ShowBuffer) LogDebug("aud:isseeking");
+        //if (ShowBufferAudio) LogDebug("aud:isseeking");
         Sleep(20);
         pSample->SetTime(NULL,NULL);
         pSample->SetActualDataLength(0);
@@ -391,11 +392,11 @@
               float clock = (double)(RefClock-m_rtStart.m_time)/10000000.0 ;
               float fTime=(float)cRefTime.Millisecs()/1000.0f - clock ;
 
-              if (ShowBuffer || fTime < 0.030)
+              if (ShowBufferAudio || fTime < 0.030)
               {
                 LogDebug("Aud/Ref : %03.3f, Late              Compensated = %03.3f ( %0.3f A/V buffers=%02d/%02d), Clk : %f, State %d", (float)RefTime.Millisecs()/1000.0f, (float)cRefTime.Millisecs()/1000.0f, fTime,cntA,cntV, clock, m_pTsReaderFilter->State());
               }
-              if (ShowBuffer) ShowBuffer--;
+              if (ShowBufferAudio) ShowBufferAudio--;
             }
           }
           else
Index: DeMultiplexer.cpp
===================================================================
--- DeMultiplexer.cpp	(revision 27941)
+++ DeMultiplexer.cpp	(working copy)
@@ -1640,6 +1640,10 @@
               }
             }
           }  
+          else
+          {
+            m_bSetVideoDiscontinuity = true;
+          }
           m_VideoValidPES=true ;                                    // We've just completed a frame, set flag until problem clears it 
           m_pl.RemoveAll() ;                                        
         }
Index: TsReader.cpp
===================================================================
--- TsReader.cpp	(revision 27941)
+++ TsReader.cpp	(working copy)
@@ -356,7 +356,9 @@
   return S_OK;
 }
 
-extern int ShowBuffer;
+extern int ShowBufferAudio;
+extern int ShowBufferVideo;
+
 STDMETHODIMP CTsReaderFilter::SetRelaxedMode(BOOL relaxedReading)
 {
   LogDebug("SetRelaxedMode");
@@ -415,7 +417,9 @@
     LogDebug("Elapsed time from pause to Audio/Video ( total zapping time ) : %d mS",GetTickCount()-m_lastPause);
   }
  
-  ShowBuffer=40;
+  //ShowBuffer=40 ;
+  ShowBufferVideo = INIT_SHOWBUFFERVIDEO;
+  ShowBufferAudio = 5;
 
   CAutoLock cObjectLock(m_pLock);
 
@@ -502,10 +506,17 @@
 {
   return m_bTimeShifting;
 }
-extern int ShowBuffer;
+
+//extern int ShowBuffer;
+extern int ShowBufferAudio;
+extern int ShowBufferVideo;
+
 STDMETHODIMP CTsReaderFilter::Pause()
 {
-  ShowBuffer=100 ;
+  //ShowBuffer=100 ;
+  ShowBufferVideo = INIT_SHOWBUFFERVIDEO;
+  ShowBufferAudio = 5;
+
   LogDebug("CTsReaderFilter::Pause() - IsTimeShifting = %d - state = %d", IsTimeShifting(), m_State);
   CAutoLock cObjectLock(m_pLock);
 
Index: VideoPin.cpp
===================================================================
--- VideoPin.cpp	(revision 27941)
+++ VideoPin.cpp	(working copy)
@@ -245,7 +245,7 @@
   return S_FALSE;
 }
 
-int ShowBuffer=100;
+int ShowBufferVideo = INIT_SHOWBUFFERVIDEO;
 
 HRESULT CVideoPin::FillBuffer(IMediaSample *pSample)
 {
@@ -264,7 +264,7 @@
       //we dont try to read any packets, but simply return...
       if (m_pTsReaderFilter->IsSeeking() || m_pTsReaderFilter->IsStopping()) //|| m_bSeeking*/ || m_pTsReaderFilter->IsSeekingToEof())
       {
-        //if (ShowBuffer) LogDebug("vid:isseeking:%d %d",m_pTsReaderFilter->IsSeeking() ,m_bSeeking);
+        //if (ShowBufferVideo) LogDebug("vid:isseeking:%d %d",m_pTsReaderFilter->IsSeeking() ,m_bSeeking);
         Sleep(5);
         pSample->SetActualDataLength(0);
         return NOERROR;
@@ -327,7 +327,7 @@
           //else
           // Sample is too late.
           //m_ShowSample = false ;
-       }
+        }
 
         if (m_bPresentSample)
         {
@@ -356,7 +356,7 @@
               float clock = (double)(RefClock-m_rtStart.m_time)/10000000.0 ;
               float fTime=(float)cRefTime.Millisecs()/1000.0f - clock ;
 
-              if (ShowBuffer || fTime < 0.030)
+              if (ShowBufferVideo || fTime < 0.030)
               {
                 int cntA, cntV;
                 CRefTime firstAudio, lastAudio;
@@ -365,8 +365,13 @@
                 cntV = demux.GetVideoBufferPts(firstVideo, lastVideo) + 1;
 
                 LogDebug("Vid/Ref : %03.3f, Late %c-frame(%02d), Compensated = %03.3f ( %0.3f A/V buffers=%02d/%02d), Clk : %f, State %d", (float)RefTime.Millisecs()/1000.0f,buffer->GetFrameType(),buffer->GetFrameCount(), (float)cRefTime.Millisecs()/1000.0f, fTime, cntA,cntV,clock, m_pTsReaderFilter->State());
-								}
-              if (ShowBuffer) ShowBuffer--;
+							}
+							if (ShowBufferVideo == 1 || ShowBufferVideo == (INIT_SHOWBUFFERVIDEO - 5) )
+							{
+                pSample->SetDiscontinuity(TRUE);
+                LogDebug("vid: ShowBuffer = %d, force discontinuity", ShowBufferVideo);
+							}
+              if (ShowBufferVideo) ShowBufferVideo--;
             }
           }
           else
Index: VideoPin.h
===================================================================
--- VideoPin.h	(revision 27941)
+++ VideoPin.h	(working copy)
@@ -23,6 +23,8 @@
 #define __VideoPin_H
 #include "tsreader.h"
 
+#define INIT_SHOWBUFFERVIDEO 20
+
 class CVideoPin : public CSourceStream, public CSourceSeeking
 {
 public:
