Commit 9b85c69d authored by Gildas Bazin's avatar Gildas Bazin

* modules/access/dshow/*: bug fixes.

parent fddcb08d
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* dshow.cpp : DirectShow access module for vlc * dshow.cpp : DirectShow access module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2002, 2003 VideoLAN * Copyright (C) 2002, 2003 VideoLAN
* $Id: dshow.cpp,v 1.25 2004/01/25 17:31:22 gbazin Exp $ * $Id: dshow.cpp,v 1.26 2004/01/28 16:46:52 gbazin Exp $
* *
* Author: Gildas Bazin <gbazin@netcourrier.com> * Author: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -414,17 +414,18 @@ static bool ConnectFilters( IFilterGraph *p_graph, IBaseFilter *p_filter, ...@@ -414,17 +414,18 @@ static bool ConnectFilters( IFilterGraph *p_graph, IBaseFilter *p_filter,
{ {
IEnumPins *p_enumpins; IEnumPins *p_enumpins;
IPin *p_output_pin; IPin *p_output_pin;
ULONG i_fetched;
if( S_OK != p_filter->EnumPins( &p_enumpins ) ) return false; if( S_OK != p_filter->EnumPins( &p_enumpins ) ) return false;
while( S_OK == p_enumpins->Next( 1, &p_output_pin, &i_fetched ) ) while( S_OK == p_enumpins->Next( 1, &p_output_pin, NULL ) )
{ {
if( S_OK == p_graph->ConnectDirect( p_output_pin, p_input_pin, 0 ) ) if( S_OK == p_graph->ConnectDirect( p_output_pin, p_input_pin, 0 ) )
{ {
p_output_pin->Release();
p_enumpins->Release(); p_enumpins->Release();
return true; return true;
} }
p_output_pin->Release();
} }
p_enumpins->Release(); p_enumpins->Release();
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* filter.c : DirectShow access module for vlc * filter.c : DirectShow access module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: filter.cpp,v 1.11 2004/01/26 18:24:17 gbazin Exp $ * $Id: filter.cpp,v 1.12 2004/01/28 16:46:52 gbazin Exp $
* *
* Author: Gildas Bazin <gbazin@netcourrier.com> * Author: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -777,18 +777,20 @@ STDMETHODIMP CaptureEnumPins::Next( ULONG cPins, IPin ** ppPins, ...@@ -777,18 +777,20 @@ STDMETHODIMP CaptureEnumPins::Next( ULONG cPins, IPin ** ppPins,
msg_Dbg( p_input, "CaptureEnumPins::Next" ); msg_Dbg( p_input, "CaptureEnumPins::Next" );
#endif #endif
*pcFetched = 0; unsigned int i_fetched = 0;
if( i_position < 1 && cPins > 0 ) if( i_position < 1 && cPins > 0 )
{ {
IPin *pPin = p_filter->CustomGetPin(); IPin *pPin = p_filter->CustomGetPin();
*ppPins = pPin; *ppPins = pPin;
pPin->AddRef(); pPin->AddRef();
*pcFetched = 1; i_fetched = 1;
i_position++; i_position++;
} }
return *pcFetched == cPins ? NOERROR : S_FALSE; if( pcFetched ) *pcFetched = i_fetched;
return (i_fetched == cPins) ? S_OK : S_FALSE;
}; };
STDMETHODIMP CaptureEnumPins::Skip( ULONG cPins ) STDMETHODIMP CaptureEnumPins::Skip( ULONG cPins )
{ {
...@@ -796,13 +798,14 @@ STDMETHODIMP CaptureEnumPins::Skip( ULONG cPins ) ...@@ -796,13 +798,14 @@ STDMETHODIMP CaptureEnumPins::Skip( ULONG cPins )
msg_Dbg( p_input, "CaptureEnumPins::Skip" ); msg_Dbg( p_input, "CaptureEnumPins::Skip" );
#endif #endif
if( cPins > 1 ) i_position += cPins;
if( i_position > 1 )
{ {
return S_FALSE; return S_FALSE;
} }
i_position += cPins; return S_OK;
return NOERROR;
}; };
STDMETHODIMP CaptureEnumPins::Reset() STDMETHODIMP CaptureEnumPins::Reset()
{ {
......
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