Query duration of many sound files in a loop

Jiergir Ogoerg f35f22fan at gmail.com
Fri Aug 16 18:52:48 PDT 2013


Hi,

I wanna query a lot of sound files duration in a loop efficiently, so
instead of waiting in a sub-loop with a sleep method until the query
succeeds for each given file - I wanna go for the second approach by
processing the GST_MESSAGE_ASYNC_DONE message on the bus, thus bypassing
the potential need to do (several) sleep(s) for each sound file.

How do I do it properly?
The only thing I can think about is launching the files query loop in a
different thread, from there for each file block on a condition variable
until I get the async event on the bus on the main thread which would fire
pthread_cond_signal() to unblock the querying thread to query the
corresponding file and move on to the next sound file in the loop.

Is there a better way to implement this non-sleep approach?

How do I know that GST_MESSAGE_ASYNC_DONE isn't fired by some other source
since gstreamer is multi-threaded and can work with many sound sources in
parallel so the events on the bus might be rather random, right?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20130817/f377d7a1/attachment.html>


More information about the gstreamer-devel mailing list