mirror of
https://projects.vdr-developer.org/git/vdr-plugin-softhddevice.git
synced 2023-10-10 19:16:51 +02:00
Fix bug: 100% CPU use during playback.
This commit is contained in:
parent
d486fb2ca1
commit
b5162bae5c
@ -2,6 +2,7 @@ User johns
|
||||
Date:
|
||||
|
||||
Release Version 0.5.1
|
||||
Fix bug: 100% CPU use during playback.
|
||||
Fix bug: audio use 100% CPU during pause.
|
||||
Guard audio skip against old PTS values.
|
||||
Improved audio skip, after channel switch.
|
||||
|
11
softhddev.c
11
softhddev.c
@ -2181,10 +2181,15 @@ int Poll(int timeout)
|
||||
#else
|
||||
int full;
|
||||
int t;
|
||||
int used;
|
||||
int filled;
|
||||
|
||||
// one buffer is full
|
||||
full = AudioFreeBytes() < AUDIO_MIN_BUFFER_FREE
|
||||
|| atomic_read(&VideoPacketsFilled) > VIDEO_PACKET_MAX - 3;
|
||||
used = AudioUsedBytes();
|
||||
filled = atomic_read(&VideoPacketsFilled);
|
||||
// soft limit + hard limit
|
||||
full = (used > AUDIO_MIN_BUFFER_FREE && filled > 3)
|
||||
|| AudioFreeBytes() < AUDIO_MIN_BUFFER_FREE
|
||||
|| filled >= VIDEO_PACKET_MAX - 3;
|
||||
|
||||
if (!full || !timeout) {
|
||||
return !full;
|
||||
|
Loading…
Reference in New Issue
Block a user