@ -309,7 +309,6 @@ static void extractAlbumArt(
void parseVorbisComment (
AMediaFormat * fileMeta , const char * comment , size_t commentLength ) {
// Haptic tag is only kept here as it will only be used in extractor to generate channel mask.
const char * const haptic = " haptic " ;
struct {
const char * const mTag ;
const char * mKey ;
@ -330,7 +329,7 @@ void parseVorbisComment(
{ " LYRICIST " , AMEDIAFORMAT_KEY_LYRICIST } ,
{ " METADATA_BLOCK_PICTURE " , AMEDIAFORMAT_KEY_ALBUMART } ,
{ " ANDROID_LOOP " , AMEDIAFORMAT_KEY_LOOP } ,
{ " ANDROID_HAPTIC " , haptic } ,
{ " ANDROID_HAPTIC " , AMEDIAFORMAT_KEY_HAPTIC_CHANNEL_COUNT } ,
} ;
for ( size_t j = 0 ; j < sizeof ( kMap ) / sizeof ( kMap [ 0 ] ) ; + + j ) {
@ -346,12 +345,12 @@ void parseVorbisComment(
if ( ! strcasecmp ( & comment [ tagLen + 1 ] , " true " ) ) {
AMediaFormat_setInt32 ( fileMeta , AMEDIAFORMAT_KEY_LOOP , 1 ) ;
}
} else if ( kMap [ j ] . mKey = = haptic ) {
} else if ( kMap [ j ] . mKey = = AMEDIAFORMAT_KEY_HAPTIC_CHANNEL_COUNT ) {
char * end ;
errno = 0 ;
const int hapticChannelCount = strtol ( & comment [ tagLen + 1 ] , & end , 10 ) ;
if ( errno = = 0 ) {
AMediaFormat_setInt32 ( fileMeta , haptic , hapticChannelCount ) ;
AMediaFormat_setInt32 ( fileMeta , kMap[ j ] . mKey , hapticChannelCount ) ;
} else {
ALOGE ( " Error(%d) when parsing haptic channel count " , errno ) ;
}