return false in decoder have no time

This commit is contained in:
Jacek Jendrzej
2017-11-11 16:52:38 +01:00
committed by Thilo Graf
parent c0963b38f0
commit 0e1d7fe1b5

View File

@@ -847,11 +847,14 @@ bool cPlayback::GetPosition(int &position, int &duration)
g_signal_emit_by_name(audioSink ? audioSink : videoSink, "get-decoder-time", &pts);
if (!GST_CLOCK_TIME_IS_VALID(pts)){
lt_info( "%s - %d failed\n", __FUNCTION__, __LINE__);
return false;
}
}else{
if(!gst_element_query_position(m_gst_playbin, fmt, &pts))
if(!gst_element_query_position(m_gst_playbin, fmt, &pts)){
{
lt_info( "%s - %d failed\n", __FUNCTION__, __LINE__);
return false;
}
}
}
position = pts / 1000000.0;