From c65e18b7d10eef960b463e04dbb32b7c4aa902bc Mon Sep 17 00:00:00 2001 From: bkrish003 Date: Mon, 27 Jan 2020 11:53:33 +0000 Subject: [PATCH] Removing MAX_LANGUAGE_COUNT restriction for audio stream count --- examples/pxScene2d/src/pxVideo.cpp | 6 +++--- examples/pxScene2d/src/pxVideo.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/pxScene2d/src/pxVideo.cpp b/examples/pxScene2d/src/pxVideo.cpp index 9dc50634fb..3f86724aa9 100644 --- a/examples/pxScene2d/src/pxVideo.cpp +++ b/examples/pxScene2d/src/pxVideo.cpp @@ -302,7 +302,7 @@ rtError pxVideo::availableAudioLanguages(rtObjectRef& languages) const rtRef array = new rtArrayObject; for (int i = 0; i < mPlaybackMetadata.languageCount; i++) { - array->pushBack(mPlaybackMetadata.languages[i]); + array->pushBack(mPlaybackMetadata.languages.at(i).c_str()); } languages = array; @@ -666,10 +666,10 @@ class MediaMetadataListener : public AAMPEventListener { assert(AAMP_EVENT_MEDIA_METADATA == event.type); - mMetadata.languageCount = event.data.metadata.languageCount; + mMetadata.languageCount = event.languages.size(); for (int i = 0; i < mMetadata.languageCount; i++) { - strncpy(mMetadata.languages[i], event.data.metadata.languages[i], MAX_LANGUAGE_TAG_LENGTH); + mMetadata.languages.push_back(event.languages.at(i)); } mMetadata.supportedSpeedCount = event.data.metadata.supportedSpeedCount; diff --git a/examples/pxScene2d/src/pxVideo.h b/examples/pxScene2d/src/pxVideo.h index 46f69d2510..2a97877c63 100644 --- a/examples/pxScene2d/src/pxVideo.h +++ b/examples/pxScene2d/src/pxVideo.h @@ -34,7 +34,7 @@ struct PlaybackMetadata { int languageCount; /**< Available language count */ - char languages[MAX_LANGUAGE_COUNT][MAX_LANGUAGE_TAG_LENGTH]; /**< Available languages */ + std::vector languages; /**< Available languages */ int supportedSpeedCount; /**< Supported playback speed count */ int supportedSpeeds[MAX_SUPPORTED_SPEED_COUNT]; /**< Supported playback speeds */ };