speed element

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

speed element

cristian
In my application I want to use the "speed" element, it works just fine, I set the playback speed time with :  g_object_set (G_OBJECT (speed), "speed", speedFactor, NULL); // where speedFactor is 1.0 or anyspeed I set from my keyboard. After that when I initiate the speed that I want to play I do have a thread that always display my current time :
while(enableTime == TRUE)
        {
                gst_element_query_position(pipeline, &fmt, &pos);
                g_print("Current time of stream is --->[%" GST_TIME_FORMAT "]\n",GST_TIME_ARGS (pos));
                if (speedFactor == 1.0) sleep(1); else
                if (speedFactor == 2.0) usleep(500000); else
                if (speedFactor == 4.0) usleep(250000); else
                if (speedFactor == 6.0) usleep(170000);
        }
It is very simple what I have done, when I have the 2x speed set I want to display time more faster to correspond to my real time. My problem is that the current time is not extracted correctly, at 4x speed my current time is displayed 4 times the same every 250ms. Is this a bug? Or am I doing something wrong?

Thanks, Cristi.