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

Commit 937f22cf authored by Divya Narayanan Poojary's avatar Divya Narayanan Poojary Committed by Steve Kondik
Browse files

audio : Fixed usage of QTI_FLAC_DECODER

QTI FLAC Decoder specific code is not placed under QTI_FLAC_DECODER
properly in some places in the framework. This is causing an issue for
the customer who has their own FLACDecoder.

Made sure that Qcom FLAC specific code is placed properly under
QTI_FLAC_DECODER

Change-Id: Ifc49f86643412095682477f35659760b228ec633
CRs-fixed: 769129
parent 991bf3dd
Loading
Loading
Loading
Loading
+5 −3
Original line number Original line Diff line number Diff line
@@ -286,16 +286,18 @@ status_t NuMediaExtractor::selectTrack(size_t index) {


    const char *mime;
    const char *mime;
    CHECK(source->getFormat()->findCString(kKeyMIMEType, &mime));
    CHECK(source->getFormat()->findCString(kKeyMIMEType, &mime));
    if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_FLAC)) {
#ifdef QTI_FLAC_DECODER
#ifdef QTI_FLAC_DECODER
    if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_FLAC)) {
        sp<MediaSource> mFlacSource = new FLACDecoder(source);
        sp<MediaSource> mFlacSource = new FLACDecoder(source);
        info->mSource = mFlacSource;
        info->mSource = mFlacSource;
        mFlacSource->start();
        mFlacSource->start();
#endif
    }
    } else {
#else
    {
        CHECK_EQ((status_t)OK, source->start());
        CHECK_EQ((status_t)OK, source->start());
        info->mSource = source;
        info->mSource = source;
    }
    }
#endif


    info->mTrackIndex = index;
    info->mTrackIndex = index;
    info->mFinalResult = OK;
    info->mFinalResult = OK;
+6 −2
Original line number Original line Diff line number Diff line
@@ -289,7 +289,8 @@ void OMXCodec::findMatchingCodecs(
        return;
        return;
    }
    }


    if (matchComponentName && !strncmp("FLACDecoder", matchComponentName, 10)) {
#ifdef QTI_FLAC_DECODER
    if (matchComponentName && !strncmp("FLACDecoder", matchComponentName, strlen("FLACDecoder"))) {
            matchingCodecs->add();
            matchingCodecs->add();


            CodecNameAndQuirks *entry = &matchingCodecs->editItemAt(index);
            CodecNameAndQuirks *entry = &matchingCodecs->editItemAt(index);
@@ -297,6 +298,7 @@ void OMXCodec::findMatchingCodecs(
            entry->mQuirks = 0;
            entry->mQuirks = 0;
            return;
            return;
    }
    }
#endif
#endif
#endif


    for (;;) {
    for (;;) {
@@ -420,10 +422,12 @@ sp<MediaSource> OMXCodec::Create(


    Vector<CodecNameAndQuirks> matchingCodecs;
    Vector<CodecNameAndQuirks> matchingCodecs;


    if (!strncmp(mime, MEDIA_MIMETYPE_AUDIO_FLAC, 10)) {
#ifdef QTI_FLAC_DECODER
    if (!strncmp(mime, MEDIA_MIMETYPE_AUDIO_FLAC, strlen(MEDIA_MIMETYPE_AUDIO_FLAC))) {
        findMatchingCodecs(mime, createEncoder,
        findMatchingCodecs(mime, createEncoder,
            "FLACDecoder", flags, &matchingCodecs);
            "FLACDecoder", flags, &matchingCodecs);
    } else
    } else
#endif
        findMatchingCodecs(
        findMatchingCodecs(
            mime, createEncoder, matchComponentName, flags, &matchingCodecs);
            mime, createEncoder, matchComponentName, flags, &matchingCodecs);