Commit 49391dc9 authored by gbazin's avatar gbazin
Browse files

* modules/access/dshow: flush the capture pin's buffers when the capture...

* modules/access/dshow: flush the capture pin's buffers when the capture filter is stopped (instead of doing it in the pin's destructor).
parent 3865b68f
...@@ -506,18 +506,7 @@ STDMETHODIMP CapturePin::Disconnect() ...@@ -506,18 +506,7 @@ STDMETHODIMP CapturePin::Disconnect()
msg_Dbg( p_input, "CapturePin::Disconnect [OK]" ); msg_Dbg( p_input, "CapturePin::Disconnect [OK]" );
#if 1 // This used to create crashes sometimes. Is the problem fixed ? /* samples_queue was already flushed in EndFlush() */
VLCMediaSample vlc_sample;
vlc_mutex_lock( &p_sys->lock );
while( samples_queue.size() )
{
vlc_sample = samples_queue.back();
samples_queue.pop_back();
vlc_sample.p_sample->Release();
}
vlc_mutex_unlock( &p_sys->lock );
#endif
p_connected_pin->Release(); p_connected_pin->Release();
p_connected_pin = NULL; p_connected_pin = NULL;
...@@ -683,6 +672,18 @@ STDMETHODIMP CapturePin::EndFlush( void ) ...@@ -683,6 +672,18 @@ STDMETHODIMP CapturePin::EndFlush( void )
#ifdef DEBUG_DSHOW #ifdef DEBUG_DSHOW
msg_Dbg( p_input, "CapturePin::EndFlush" ); msg_Dbg( p_input, "CapturePin::EndFlush" );
#endif #endif
VLCMediaSample vlc_sample;
vlc_mutex_lock( &p_sys->lock );
while( samples_queue.size() )
{
vlc_sample = samples_queue.back();
samples_queue.pop_back();
vlc_sample.p_sample->Release();
}
vlc_mutex_unlock( &p_sys->lock );
return S_OK; return S_OK;
} }
STDMETHODIMP CapturePin::NewSegment( REFERENCE_TIME tStart, STDMETHODIMP CapturePin::NewSegment( REFERENCE_TIME tStart,
...@@ -898,6 +899,8 @@ STDMETHODIMP CaptureFilter::Stop() ...@@ -898,6 +899,8 @@ STDMETHODIMP CaptureFilter::Stop()
msg_Dbg( p_input, "CaptureFilter::Stop" ); msg_Dbg( p_input, "CaptureFilter::Stop" );
#endif #endif
p_pin->EndFlush();
state = State_Stopped; state = State_Stopped;
return S_OK; return S_OK;
}; };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment