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

Commit 034566c1 authored by Insun Kang's avatar Insun Kang Committed by James Dong
Browse files

Bug fix: set 'und' as default metadata language info for srt.

o Previously, it leaves language code empty and it is inconsistent with
  other code which gives 'und'. As a result, selected SRT track returned
  empty language info. With this fix, it returns 'und'.

Bug: 7227230

TESTED=runtest -d cts-media -c android.media.cts.MediaPlayerTest -m
testGetTrackInfo

Change-Id: I225848f029637dd782c376e0d770dddd5c849550
parent 45490af0
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -36,6 +36,9 @@ TimedTextSRTSource::TimedTextSRTSource(const sp<DataSource>& dataSource)
        : mSource(dataSource),
          mMetaData(new MetaData),
          mIndex(0) {
    // TODO: Need to detect the language, because SRT doesn't give language
    // information explicitly.
    mMetaData->setCString(kKeyMediaLanguage, "und");
}

TimedTextSRTSource::~TimedTextSRTSource() {
@@ -46,14 +49,10 @@ status_t TimedTextSRTSource::start() {
    if (err != OK) {
        reset();
    }
    // TODO: Need to detect the language, because SRT doesn't give language
    // information explicitly.
    mMetaData->setCString(kKeyMediaLanguage, "");
    return err;
}

void TimedTextSRTSource::reset() {
    mMetaData->clear();
    mTextVector.clear();
    mIndex = 0;
}