fixed gstreamer
This commit is contained in:
1 parent
125a624c92
commit
fcf4eaebf1
1 file changed
+8
-8
@@ -184,11 +184,9 @@ void GstreamerAudioStream::RefreshDuration()
|
|||||||
{
|
{
|
||||||
if(Element)
|
if(Element)
|
||||||
{
|
{
|
||||||
gint64 time;
|
gint64 time = -1000;
|
||||||
if(!gst_element_query_duration(Element, GST_FORMAT_TIME, &time)) {
|
if(gst_element_query_duration(Element, GST_FORMAT_TIME, &time))
|
||||||
LogError("Could not query duration");
|
Duration = (gfloat)((gdouble)(time/GST_SECOND));
|
||||||
}
|
|
||||||
Duration = (gfloat)((gdouble)(time/GST_SECOND));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -196,9 +194,11 @@ float GstreamerAudioStream::GetPosition()
|
|||||||
{
|
{
|
||||||
if(Element)
|
if(Element)
|
||||||
{
|
{
|
||||||
gint64 time;
|
gint64 time = 0;
|
||||||
gst_element_query_position(Element, GST_FORMAT_TIME, &time);
|
if (gst_element_query_position(Element, GST_FORMAT_TIME, &time))
|
||||||
return (float)((gdouble)time/GST_SECOND);
|
return (float)((gdouble)time/GST_SECOND);
|
||||||
|
else
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
else return -1;
|
else return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user