fdkaacdec: do not error out of out of sync return
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Tue, 27 Sep 2016 15:15:44 +0000 (16:15 +0100)
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Tue, 27 Sep 2016 16:20:18 +0000 (17:20 +0100)
The docs say we should continue feeding in data and decoding

https://bugzilla.gnome.org/show_bug.cgi?id=772067

ext/fdkaac/gstfdkaacdec.c

index a9feca5..7e6dcb2 100644 (file)
@@ -210,6 +210,11 @@ gst_fdkaacdec_handle_frame (GstAudioDecoder * dec, GstBuffer * inbuf)
   if ((err =
           aacDecoder_DecodeFrame (self->dec, (gint16 *) self->decode_buffer,
               self->decode_buffer_size, flags)) != AAC_DEC_OK) {
+    if (err == AAC_DEC_TRANSPORT_SYNC_ERROR) {
+      ret = GST_FLOW_OK;
+      outbuf = NULL;
+      goto finish;
+    }
     GST_AUDIO_DECODER_ERROR (self, 1, STREAM, DECODE, (NULL),
         ("decoding error: %d", err), ret);
     goto out;
@@ -383,6 +388,7 @@ gst_fdkaacdec_handle_frame (GstAudioDecoder * dec, GstBuffer * inbuf)
         GST_AUDIO_INFO_CHANNELS (&info), pos, gst_pos);
   }
 
+finish:
   ret = gst_audio_decoder_finish_frame (dec, outbuf, 1);
 
 out: