fixed gstreamer

This commit is contained in:
Alexander Eckart committed 2013-04-07 16:43:48 +02:00
1 parent 125a624c92
commit fcf4eaebf1
1 file changed
+6 -6
+6 -6
View File
@@ -184,10 +184,8 @@ void GstreamerAudioStream::RefreshDuration()
{
if(Element)
{
gint64 time;
if(!gst_element_query_duration(Element, GST_FORMAT_TIME, &time)) {
LogError("Could not query duration");
}
gint64 time = -1000;
if(gst_element_query_duration(Element, GST_FORMAT_TIME, &time))
Duration = (gfloat)((gdouble)(time/GST_SECOND));
}
}
@@ -196,9 +194,11 @@ float GstreamerAudioStream::GetPosition()
{
if(Element)
{
gint64 time;
gst_element_query_position(Element, GST_FORMAT_TIME, &time);
gint64 time = 0;
if (gst_element_query_position(Element, GST_FORMAT_TIME, &time))
return (float)((gdouble)time/GST_SECOND);
else
return -1;
}
else return -1;
}