Commit d64081f6 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Update deinterlace functions to recent API changes

parent c51e378f
...@@ -562,7 +562,12 @@ STDMETHODIMP VLCAudio::toggleMute() ...@@ -562,7 +562,12 @@ STDMETHODIMP VLCAudio::toggleMute()
STDMETHODIMP VLCDeinterlace::disable() STDMETHODIMP VLCDeinterlace::disable()
{ {
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
_plug->get_player().get_mp().setDeinterlace( VLC::MediaPlayer::DeinterlaceState::Disabled,
std::string() );
#else
_plug->get_player().get_mp().setDeinterlace( "" ); _plug->get_player().get_mp().setDeinterlace( "" );
#endif
return S_OK; return S_OK;
} }
...@@ -571,7 +576,12 @@ STDMETHODIMP VLCDeinterlace::enable(BSTR mode) ...@@ -571,7 +576,12 @@ STDMETHODIMP VLCDeinterlace::enable(BSTR mode)
char *psz_mode = CStrFromBSTR(CP_UTF8, mode); char *psz_mode = CStrFromBSTR(CP_UTF8, mode);
if ( psz_mode == nullptr ) if ( psz_mode == nullptr )
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
_plug->get_player().get_mp().setDeinterlace( VLC::MediaPlayer::DeinterlaceState::Enabled,
psz_mode );
#else
_plug->get_player().get_mp().setDeinterlace( psz_mode ); _plug->get_player().get_mp().setDeinterlace( psz_mode );
#endif
CoTaskMemFree(psz_mode); CoTaskMemFree(psz_mode);
return S_OK; return S_OK;
} }
......
...@@ -1981,7 +1981,12 @@ LibvlcDeinterlaceNPObject::invoke(int index, const NPVariant *args, ...@@ -1981,7 +1981,12 @@ LibvlcDeinterlaceNPObject::invoke(int index, const NPVariant *args,
switch( index ) switch( index )
{ {
case ID_deint_disable: case ID_deint_disable:
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
mp.setDeinterlace( VLC::MediaPlayer::DeinterlaceState::Disabled,
std::string() );
#else
mp.setDeinterlace( std::string() ); mp.setDeinterlace( std::string() );
#endif
break; break;
case ID_deint_enable: case ID_deint_enable:
...@@ -1992,7 +1997,11 @@ LibvlcDeinterlaceNPObject::invoke(int index, const NPVariant *args, ...@@ -1992,7 +1997,11 @@ LibvlcDeinterlaceNPObject::invoke(int index, const NPVariant *args,
if ( !v.is<const char*>() ) if ( !v.is<const char*>() )
return INVOKERESULT_INVALID_VALUE; return INVOKERESULT_INVALID_VALUE;
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
mp.setDeinterlace( VLC::MediaPlayer::DeinterlaceState::Enabled, v );
#else
mp.setDeinterlace( v ); mp.setDeinterlace( v );
#endif
break; break;
} }
default: default:
......
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