Ticket #7331: endless-fdk-aac-handle-transport-sync-error.patch

File endless-fdk-aac-handle-transport-sync-error.patch, 1.4 KB (added by Robert McQueen, 8 years ago)

untested patch (my build environment is broken atm)

  • libavcodec/libfdk-aacdec.c

    Description: handle transport sync errors arising from libfdk-aac
     GStreamer can successfully play an .m4a file that ffplay cannot, albeit
     with some audible glitching. GStreamer handles the AAC_DEC_TRANSPORT_SYNC_ERROR
     (see https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/ext/fdkaac/gstfdkaacdec.c#n214)
     but libavcodec does not. It is documented that the input buffer should
     be discarded in this case, but decoding not stopped, so we attempt
     to do this in order to make decoding more robust.
     (see https://github.com/esrlabs/fdk-aac/blob/master/libAACdec/include/aacdecoder_lib.h#L362)
    Author: Robert McQueen <rob@endlessm.com>
    
    ---
    The information above should follow the Patch Tagging Guidelines, please
    checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
    are templates for supplementary fields that you might want to add:
    
    Origin: vendor
    Bug: https://phabricator.endlessm.com/T23374
    Last-Update: 2018-07-27
    
    old new static int fdk_aac_decode_frame(AVCodecC  
    326326    }
    327327
    328328    err = aacDecoder_DecodeFrame(s->handle, (INT_PCM *) s->decoder_buffer, s->decoder_buffer_size / sizeof(INT_PCM), 0);
    329     if (err == AAC_DEC_NOT_ENOUGH_BITS) {
     329    if (err == AAC_DEC_NOT_ENOUGH_BITS || err == AAC_DEC_TRANSPORT_SYNC_ERROR) {
    330330        ret = avpkt->size - valid;
    331331        goto end;
    332332    }