return the current stream time - samples with start timestamps of this time or before should be rendered by now
| 248 | // return the current stream time - samples with start timestamps of this |
| 249 | // time or before should be rendered by now |
| 250 | HRESULT |
| 251 | CBaseMediaFilter::StreamTime(CRefTime &rtStream) |
| 252 | { |
| 253 | // Caller must lock for synchronization |
| 254 | // We can't grab the filter lock because we want to be able to call |
| 255 | // this from worker threads without deadlocking |
| 256 | |
| 257 | if (m_pClock == NULL) |
| 258 | { |
| 259 | return VFW_E_NO_CLOCK; |
| 260 | } |
| 261 | |
| 262 | // get the current reference time |
| 263 | HRESULT hr = m_pClock->GetTime((REFERENCE_TIME *)&rtStream); |
| 264 | if (FAILED(hr)) |
| 265 | { |
| 266 | return hr; |
| 267 | } |
| 268 | |
| 269 | // subtract the stream offset to get stream time |
| 270 | rtStream -= m_tStart; |
| 271 | |
| 272 | return S_OK; |
| 273 | } |
| 274 | |
| 275 | //===================================================================== |
| 276 | //===================================================================== |