[FFmpeg-cvslog] ffplay: dont wait 100ms if data is not yet ready

Marton Balint git at videolan.org
Mon Sep 17 00:45:33 CEST 2012


ffmpeg | branch: master | Marton Balint <cus at passwd.hu> | Sun Sep 16 19:00:51 2012 +0200| [d8f8e911bd5efbd02dd34e9c5097df6828f4c603] | committer: Marton Balint

ffplay: dont wait 100ms if data is not yet ready

Also signal the wait if audio buffer is empty. This fixes jerky audio with
realtime sources.

Signed-off-by: Marton Balint <cus at passwd.hu>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d8f8e911bd5efbd02dd34e9c5097df6828f4c603
---

 ffplay.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ffplay.c b/ffplay.c
index 1c9a141..569e8c2 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -2586,7 +2586,9 @@ static int read_thread(void *arg)
                 eof = 1;
             if (ic->pb && ic->pb->error)
                 break;
-            SDL_Delay(100); /* wait for user event */
+            SDL_LockMutex(wait_mutex);
+            SDL_CondWaitTimeout(is->continue_read_thread, wait_mutex, 10);
+            SDL_UnlockMutex(wait_mutex);
             continue;
         }
         /* check if packet is in play range specified by user, then queue, otherwise discard */



More information about the ffmpeg-cvslog mailing list