From: David Flynn <[email protected]>

includes
 decoder: remove spurious schro_parse_sync_underflow

Signed-off-by: David Flynn <[email protected]>
---
 schroedinger/schrodecoder.c |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/schroedinger/schrodecoder.c b/schroedinger/schrodecoder.c
index e2b6d4e..ea301f2 100644
--- a/schroedinger/schrodecoder.c
+++ b/schroedinger/schrodecoder.c
@@ -799,16 +799,23 @@ schro_decoder_push_old (SchroDecoder *decoder, 
SchroBuffer *buffer)
 int
 schro_decoder_push (SchroDecoder *decoder, SchroBuffer *buffer)
 {
+  int ret = SCHRO_DECODER_OK;
+  int x;
   /* 1. buffer is added to the decoder input queue.
    * 2. The synchronizer extracts (if possible) a data unit for parsing */
   if (buffer)
     schro_buflist_append (decoder->input_buflist, buffer);
 
-  buffer = schro_parse_sync (decoder->sps, decoder->input_buflist);
-  if (!buffer)
-    return SCHRO_DECODER_OK;
-
-  return schro_decoder_push_old (decoder, buffer);
+  while (schro_decoder_push_ready (decoder))
+  {
+    buffer = schro_parse_sync (decoder->sps, decoder->input_buflist);
+    /* has the syncroniser run out of buffer? */
+    if (!buffer)
+      return ret;
+    x = schro_decoder_push_old (decoder, buffer);
+    ret = x != SCHRO_DECODER_OK ? x : ret;
+  }
+  return ret;
 }
 
 int
-- 
1.5.6.5


------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Schrodinger-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/schrodinger-devel

Reply via email to