[gst-cvs] gst-plugins-ugly: mad: just flush data when seeing BADDATAPTR instead of going into error state

Zaheer Abbas Merali zaheer at kemper.freedesktop.org
Thu Feb 19 11:09:37 PST 2009


Module: gst-plugins-ugly
Branch: master
Commit: a2b0e47739294280af89c6e21f59c41cfe2554c7
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-ugly/commit/?id=a2b0e47739294280af89c6e21f59c41cfe2554c7

Author: Zaheer Merali <zaheerabbas at merali.org>
Date:   Thu Feb 19 19:08:10 2009 +0000

mad: just flush data when seeing BADDATAPTR instead of going into error state

---

 ext/mad/gstmad.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/ext/mad/gstmad.c b/ext/mad/gstmad.c
index 59a6f26..0b78475 100644
--- a/ext/mad/gstmad.c
+++ b/ext/mad/gstmad.c
@@ -1392,6 +1392,7 @@ gst_mad_chain (GstPad * pad, GstBuffer * buffer)
         }
       }
 
+      GST_LOG ("sample rate %d", mad->frame.header.samplerate);
       GST_LOG ("decoding one frame now");
 
       if (mad_frame_decode (&mad->frame, &mad->stream) == -1) {
@@ -1408,6 +1409,9 @@ gst_mad_chain (GstPad * pad, GstBuffer * buffer)
             GST_LOG ("sync error, flushing unneeded data");
             goto next_no_samples;
           }
+        } else if (mad->stream.error == MAD_ERROR_BADDATAPTR) {
+          /* Flush data */
+          goto next_no_samples;
         }
         /* we are in an error state */
         mad->in_error = TRUE;





More information about the Gstreamer-commits mailing list