Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 426a0c33 authored by Andy Hung's avatar Andy Hung Committed by Android Git Automerger
Browse files

am f388c9e6: am f3d3856f: Merge "Check for null codec from...

am f388c9e6: am f3d3856f: Merge "Check for null codec from AMediaCodec_createDecoderByType" into mnc-dev

* commit 'f388c9e6':
  Check for null codec from AMediaCodec_createDecoderByType
parents 3d7765cd f388c9e6
Loading
Loading
Loading
Loading
+5 −4
Original line number Original line Diff line number Diff line
@@ -514,7 +514,8 @@ static status_t decode(int fd, int64_t offset, int64_t length,
        if (strncmp(mime, "audio/", 6) == 0) {
        if (strncmp(mime, "audio/", 6) == 0) {


            AMediaCodec *codec = AMediaCodec_createDecoderByType(mime);
            AMediaCodec *codec = AMediaCodec_createDecoderByType(mime);
            if (AMediaCodec_configure(codec, format,
            if (codec == NULL
                    || AMediaCodec_configure(codec, format,
                            NULL /* window */, NULL /* drm */, 0 /* flags */) != AMEDIA_OK
                            NULL /* window */, NULL /* drm */, 0 /* flags */) != AMEDIA_OK
                    || AMediaCodec_start(codec) != AMEDIA_OK
                    || AMediaCodec_start(codec) != AMEDIA_OK
                    || AMediaExtractor_selectTrack(ex, i) != AMEDIA_OK) {
                    || AMediaExtractor_selectTrack(ex, i) != AMEDIA_OK) {