测试平台
Platform: RK3328
OS: Android 8
现象
flac文件无法获取专辑信息
解决方案
查看代码可知在setDataSource时,由于默认没有对flac进行判断,所以默认createRetriever导致flac的信息始终为空.添加flac支持返回StagefrightMetadataRetriever即可.
diff --git a/frameworks/av/media/libmediaplayerservice/MetadataRetrieverClient.cpp b/frameworks/av/media/libmediaplayerservice/MetadataRetrieverClient.cpp
index 276f77b..bb43cf2 100755
--- a/frameworks/av/media/libmediaplayerservice/MetadataRetrieverClient.cpp
+++ b/frameworks/av/media/libmediaplayerservice/MetadataRetrieverClient.cpp
@@ -14,7 +14,7 @@
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-
+//#undef NDEBUG
//#define LOG_NDEBUG 0
#define LOG_TAG "MetadataRetrieverClient"
#include
@@ -196,9 +196,12 @@ status_t MetadataRetrieverClient::setDataSource(int fd, int64_t offset, int64_t
offset,
length);
ALOGV("player typ
测试平台
Platform: RK3328
OS: Android 8
现象
flac文件无法获取专辑信息
解决方案
查看代码可知在setDataSource时,由于默认没有对flac进行判断,所以默认createRetriever导致flac的信息始终为空.添加flac支持返回StagefrightMetadataRetriever即可.
diff --git a/frameworks/av/media/libmediaplayerservice/MetadataRetrieverClient.cpp b/frameworks/av/media/libmediaplayerservice/MetadataRetrieverClient.cpp
index 276f77b..bb43cf2 100755
--- a/frameworks/av/media/libmediaplayerservice/MetadataRetrieverClient.cpp
+++ b/frameworks/av/media/libmediaplayerservice/MetadataRetrieverClient.cpp
@@ -14,7 +14,7 @@
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-
+//#undef NDEBUG
//#define LOG_NDEBUG 0
#define LOG_TAG "MetadataRetrieverClient"
#include
@@ -196,9 +196,12 @@ status_t MetadataRetrieverClient::setDataSource(int fd, int64_t offset, int64_t
offset,
length);
ALOGV("player typ
举报