Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

    Reliable MediaObject::totalTime() queries

    General and Desktop
    1
    1
    1476
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      jkyle last edited by

      I need to reliably retrieve the totalTime() of MediaObjects. The problem is, initially an object is in Phonon::LoadingState. In this state, totalTime (and most other object information) is not defined/available.

      This results in a sort of race condition where attempts to retrieve the totalTime of a MediaObjects results in undefined behavior.

      How may I force a MediaObject to retrieve this information and wait for it to be available? I realize it's likely a performance optimization, but the totalTime value is more important to me than a hit to initial loading performance.

      I tried to force it by calling MediaObject::stop(), putting the object into a different Phonon::State (Phonon::StoppedState) a transition the docs hinted may do the trick. But this didn't work.

      My last resort would be doing some kind of loop that breaks when the MediaObject leaves the Phonon::LoadingState (with timeout).

      1 Reply Last reply Reply Quote 0
      • First post
        Last post