fix get play position

Origin commit data
------------------
Branch: master
Commit: cb33592f3c
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2017-10-24 (Tue, 24 Oct 2017)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
Jacek Jendrzej
2017-10-24 15:57:30 +02:00
committed by TangoCash
parent d01a02bbb1
commit ccfd5f9625

View File

@@ -747,13 +747,18 @@ bool cPlayback::GetPosition(int &position, int &duration)
{
//position
GstFormat fmt = GST_FORMAT_TIME; //Returns time in nanosecs
gint64 pts = 0;
unsigned long long int sec = 0;
gst_element_query_position(m_gst_playbin, fmt, &pts);
if (audioSink || videoSink)
{
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__);
}
}else{
if(!gst_element_query_position(m_gst_playbin, fmt, &pts))
lt_info( "%s - %d failed\n", __FUNCTION__, __LINE__);
}
position = pts / 1000000.0;
// duration
GstFormat fmt_d = GST_FORMAT_TIME; //Returns time in nanosecs
double length = 0;