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

Don't use fps() deprecated method

parent 00e2c3a4
......@@ -699,7 +699,19 @@ STDMETHODIMP VLCInput::get_fps(double* fps)
if( NULL == fps )
return E_POINTER;
*fps = static_cast<double>( _plug->get_player().get_mp().fps() );
auto media = _plug->get_player().get_mp().media();
if ( media == nullptr )
return INVOKERESULT_GENERIC_ERROR;
auto tracks = media->tracks();
for ( const auto& t : tracks )
{
if ( t.type() == VLC::MediaTrack::Type::Video )
{
*fps = (float)( (float)t.fpsNum() / (float)t.fpsDen() );
return S_OK;
}
}
*fps = 0.0;
return S_OK;
}
......
......@@ -472,7 +472,19 @@ LibvlcInputNPObject::getProperty(int index, npapi::OutVariant& result)
}
case ID_input_fps:
{
result = mp.fps();
auto media = mp.media();
if ( media == nullptr )
return INVOKERESULT_GENERIC_ERROR;
auto tracks = media->tracks();
for ( const auto& t : tracks )
{
if ( t.type() == VLC::MediaTrack::Type::Video )
{
result = (float)( (float)t.fpsNum() / (float)t.fpsDen() );
return INVOKERESULT_GENERIC_ERROR;
}
}
result = 0.0f;
return INVOKERESULT_NO_ERROR;
}
case ID_input_hasvout:
......
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