Commit 49391dc9 authored by Gildas Bazin's avatar Gildas Bazin

* 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()
msg_Dbg( p_input, "CapturePin::Disconnect [OK]" );
#if 1 // This used to create crashes sometimes. Is the problem fixed ?
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
/* samples_queue was already flushed in EndFlush() */
p_connected_pin->Release();
p_connected_pin = NULL;
......@@ -683,6 +672,18 @@ STDMETHODIMP CapturePin::EndFlush( void )
#ifdef DEBUG_DSHOW
msg_Dbg( p_input, "CapturePin::EndFlush" );
#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;
}
STDMETHODIMP CapturePin::NewSegment( REFERENCE_TIME tStart,
......@@ -898,6 +899,8 @@ STDMETHODIMP CaptureFilter::Stop()
msg_Dbg( p_input, "CaptureFilter::Stop" );
#endif
p_pin->EndFlush();
state = State_Stopped;
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