How to do a video player loop properly?

This is a discussion on How to do a video player loop properly? within the C Programming forums, part of the General Programming Boards category; I am trying to write a simple player application for Mac that takes a directory of BMP images and displays ...

  1. #1
    Registered User
    Join Date
    Jun 2009
    Posts
    97

    How to do a video player loop properly?

    I am trying to write a simple player application for Mac that takes a directory of BMP images and displays them on screen at a specified FPS. The issue I am facing is how to write the loop that sends the images to the GUI. If I just do a simple loop, the loop runs all the way through and then only shows the last image. What I need is for the loop to run and update the GUI at the same time. I put the loop in a separate thread, but it still does the same thing. Any ideas?

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,333
    Just a guess, but won't the GUI try to buffer requests until you say "done", or some sufficient elapsed time of inactivity (on your part) means that what has been drawn so far might actually be worth pushing all the way through the render pipeline so you can see it on screen.

    Or VideoLAN - Official page for VLC media player, the Open Source video framework! and see how that code looks for the Mac
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Get the time of a Video Player?
    By fedep in forum C Programming
    Replies: 8
    Last Post: 11-17-2011, 11:44 AM
  2. Video player API etc.
    By g4j31a5 in forum C++ Programming
    Replies: 7
    Last Post: 09-19-2008, 11:53 AM
  3. Is it a watch? Is it an MP3 player? Is it a video player?
    By twomers in forum A Brief History of Cprogramming.com
    Replies: 10
    Last Post: 08-15-2006, 10:54 PM
  4. making a video player in C++
    By LogicError in forum Windows Programming
    Replies: 4
    Last Post: 03-31-2005, 10:39 AM
  5. linux video player
    By colmd in forum Linux Programming
    Replies: 2
    Last Post: 06-28-2004, 04:27 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21