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:
|
Date:
|
||||||
|
|
||||||
Release Version 0.5.1
|
Release Version 0.5.1
|
||||||
|
Fix bug: 100% CPU use during playback.
|
||||||
Fix bug: audio use 100% CPU during pause.
|
Fix bug: audio use 100% CPU during pause.
|
||||||
Guard audio skip against old PTS values.
|
Guard audio skip against old PTS values.
|
||||||
Improved audio skip, after channel switch.
|
Improved audio skip, after channel switch.
|
||||||
|
11
softhddev.c
11
softhddev.c
@ -2181,10 +2181,15 @@ int Poll(int timeout)
|
|||||||
#else
|
#else
|
||||||
int full;
|
int full;
|
||||||
int t;
|
int t;
|
||||||
|
int used;
|
||||||
|
int filled;
|
||||||
|
|
||||||
// one buffer is full
|
used = AudioUsedBytes();
|
||||||
full = AudioFreeBytes() < AUDIO_MIN_BUFFER_FREE
|
filled = atomic_read(&VideoPacketsFilled);
|
||||||
|| atomic_read(&VideoPacketsFilled) > VIDEO_PACKET_MAX - 3;
|
// 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) {
|
if (!full || !timeout) {
|
||||||
return !full;
|
return !full;
|
||||||
|
Loading…
Reference in New Issue
Block a user