shithub: openh264

Download patch

ref: 30d7352d03ab9a5b07d7c94ad823020a27947459
parent: 4f4adcec4940dd2f96ed4e7d9804f8fd3118e9f8
author: Matthew Gregan <kinetik@flim.org>
date: Tue Jan 13 13:58:48 EST 2015

Call InputExhausted when input has not produced a frame, call Error when
the decoder did not produce valid output, call DrainComplete in Drain
and FlushComplete in Flush.  Without these, the caller of the GMP may
end up waiting forever on a requested operation to complete.

--- a/module/gmp-openh264.cpp
+++ b/module/gmp-openh264.cpp
@@ -653,9 +653,15 @@
   }
 
   virtual void Reset() {
+    if (callback_) {
+      callback_->ResetComplete ();
+    }
   }
 
   virtual void Drain() {
+    if (callback_) {
+      callback_->DrainComplete ();
+    }
   }
 
   virtual void DecodingComplete() {
@@ -713,11 +719,14 @@
 
     // If we don't actually have data, just abort.
     if (!valid) {
+      GMPLOG (GL_ERROR, "No valid data decoded");
       Error (GMPDecodeErr);
       return;
     }
 
     if (decoded->iBufferStatus != 1) {
+      GMPLOG (GL_ERROR, "iBufferStatus=" << decoded->iBufferStatus);
+      callback_->InputDataExhausted();
       return;
     }