[PATCH] videorec: Fix flushing encoders
authorVittorio Giovara <vittorio.giovara@gmail.com>
Tue, 10 Nov 2015 12:53:12 +0000 (13:53 +0100)
committerGianfranco Costamagna <locutusofborg@debian.org>
Thu, 12 Jan 2017 16:30:21 +0000 (16:30 +0000)
When passing NULL frames, encoders empty their queues, but we have
to stop polling from them when they don't any more data.

--HG--
extra : hg-git-rename-source : git

Gbp-Pq: Name 2488090353fc122b4af030ea55bbff494c204c9b.patch

hedgewars/avwrapper/avwrapper.c

index d6a07ab0b4de12e6643b592bea26d062190e2ec3..232398c567023e173ff10b85b10c13d28fb61413 100644 (file)
@@ -508,7 +508,7 @@ AVWRAP_DECL int AVWrapper_Close()
     {
         do
             ret = WriteFrame(NULL);
-        while (ret >= 0);
+        while (ret > 0);
         if (ret < 0)
             return ret;
     }
@@ -517,7 +517,7 @@ AVWRAP_DECL int AVWrapper_Close()
     {
         ret = WriteAudioFrame();
     }
-    while(ret >= 0);
+    while(ret > 0);
     if (ret < 0)
         return ret;