From c112b850d82055c7b661168eccc1bec435030392 Mon Sep 17 00:00:00 2001 From: Johns Date: Wed, 16 May 2012 20:35:35 +0200 Subject: Fix bug: 100% cpu use. Fix bug: audio/video out of sync after jump in recordings. --- softhddev.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/softhddev.c b/softhddev.c index d5426f9..1c041d4 100644 --- a/softhddev.c +++ b/softhddev.c @@ -1451,7 +1451,10 @@ int VideoPollInput(void) VideoClearBuffers = 0; return 1; } - return 0; + if (!atomic_read(&VideoPacketsFilled)) { + return -1; + } + return 1; } /** @@ -1468,9 +1471,6 @@ int VideoDecodeInput(void) int saved_size; static int last_codec_id = CODEC_ID_NONE; - if (StreamFreezed) { // stream freezed - return 1; - } if (VideoClearBuffers) { atomic_set(&VideoPacketsFilled, 0); VideoPacketRead = VideoPacketWrite; @@ -1481,6 +1481,10 @@ int VideoDecodeInput(void) VideoClearBuffers = 0; return 1; } + if (StreamFreezed) { // stream freezed + // clear is called during freezed + return 1; + } filled = atomic_read(&VideoPacketsFilled); if (!filled) { @@ -2029,7 +2033,8 @@ void Clear(void) int i; VideoResetPacket(); // terminate work - VideoSetClosing(MyHwDecoder); + //closing not reset: + //VideoSetClosing(MyHwDecoder); VideoResetStart(MyHwDecoder); VideoClearBuffers = 1; AudioFlushBuffers(); -- cgit v1.2.3