예제 #1
0
STDMETHODIMP CTsReaderFilter::Run(REFERENCE_TIME tStart)
{
  CRefTime runTime=tStart;
  double msec=(double)runTime.Millisecs();
  msec/=1000.0;
  LogDebug("CTsReaderFilter::Run(%05.2f) state %d seeking %d", msec, m_State, IsSeeking());
  
  m_RandomCompensation = 0;

  if (m_bStreamCompensated && m_bLiveTv)
  {
    LogDebug("Elapsed time from pause to Audio/Video ( total zapping time ) : %d mS",GetTickCount()-m_lastPause);
  }
 
  m_ShowBufferVideo = INIT_SHOWBUFFERVIDEO;
  m_ShowBufferAudio = INIT_SHOWBUFFERAUDIO;

  CAutoLock cObjectLock(m_pLock);

  m_bSeekAfterRcDone = false;

  if(m_pSubtitlePin) m_pSubtitlePin->SetRunningStatus(true);
	
	//are we using RTSP or local file
  if (m_fileDuration==NULL)
  {
    //using RTSP, if its streaming is paused then
    //stop pausing and continue streaming
    if (m_rtspClient.IsPaused())
    {
      LogDebug(" CTsReaderFilter::Run()  -->is paused,continue rtsp");
      m_rtspClient.Continue();
      LogDebug(" CTsReaderFilter::Run()  --> rtsp running");
    }
//    m_demultiplexer.SetHoldAudio(false);
//    m_demultiplexer.SetHoldVideo(false);
//    m_demultiplexer.SetHoldSubtitle(false);
  }

  m_demultiplexer.m_LastDataFromRtsp=GetTickCount();
  //Set our StreamTime Reference offset to zero
  HRESULT hr= CSource::Run(tStart);
  SetMediaPosition(m_MediaPos) ;   // reset offset.

  FindSubtitleFilter();
  m_bPauseOnClockTooFast=false ;
  LogDebug("CTsReaderFilter::Run(%05.2f) state %d -->done",msec,m_State);
  return hr;
}
예제 #2
0
STDMETHODIMP CBDReaderFilter::Run(REFERENCE_TIME tStart)
{
  LogDebug("CBDReaderFilter::Run(%05.2f) state %d", tStart / 10000000.0, m_State);
  
  m_rtRun = tStart;

  CAutoLock cObjectLock(m_pLock);
  lib.SetState(State_Running);  
  
  if (m_pSubtitlePin) 
    m_pSubtitlePin->SetRunningStatus(true);
	
  HRESULT hr = CSource::Run(tStart);

  FindSubtitleFilter();
  LogDebug("CBDReaderFilter::Run(%05.2f) state %d -->done", tStart / 10000000.0, m_State);

  if (!m_hCommandThread)
    m_hCommandThread = CreateThread(NULL, 0, CBDReaderFilter::CommandThreadEntryPoint, (LPVOID)this, 0, &m_dwThreadId);

  return hr;
}