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@passwd.hu>
This commit is contained in:
Marton Balint 2012-09-16 19:00:51 +02:00
parent 094991eb69
commit d8f8e911bd
1 changed files with 3 additions and 1 deletions

View File

@ -2586,7 +2586,9 @@ static int read_thread(void *arg)
eof = 1; eof = 1;
if (ic->pb && ic->pb->error) if (ic->pb && ic->pb->error)
break; 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; continue;
} }
/* check if packet is in play range specified by user, then queue, otherwise discard */ /* check if packet is in play range specified by user, then queue, otherwise discard */