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

Commit c486e134 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "NuPlayer: return error when neither audio nor video source has metadata." into nyc-mr1-dev

parents 054ad5b3 1de83d5a
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -1339,7 +1339,16 @@ void NuPlayer::onStart(int64_t startPositionUs) {
    }

    sp<MetaData> audioMeta = mSource->getFormatMeta(true /* audio */);
    sp<MetaData> videoMeta = mSource->getFormatMeta(false /* audio */);
    if (audioMeta == NULL && videoMeta == NULL) {
        ALOGE("no metadata for either audio or video source");
        mSource->stop();
        mSourceStarted = false;
        notifyListener(MEDIA_ERROR, MEDIA_ERROR_UNKNOWN, ERROR_MALFORMED);
        return;
    }
    ALOGV_IF(audioMeta == NULL, "no metadata for audio source");  // video only stream

    audio_stream_type_t streamType = AUDIO_STREAM_MUSIC;
    if (mAudioSink != NULL) {
        streamType = mAudioSink->getAudioStreamType();