diff options
author | Hyunjun Ko <zzoon.ko@samsung.com> | 2013-03-29 17:33:06 +0900 |
---|---|---|
committer | Hyunjun Ko <zzoon.ko@samsung.com> | 2013-03-29 17:33:06 +0900 |
commit | abb726ea9c0b065b9fa457cbc410b652bbce2e45 (patch) | |
tree | 67a4ba2d280a97934bd7b712cab8f28848d3b9d6 | |
parent | 94ed05c584166aa58380ea1ab1f5344932e5ab4e (diff) | |
download | libmm-fileinfo-abb726ea9c0b065b9fa457cbc410b652bbce2e45.tar.gz libmm-fileinfo-abb726ea9c0b065b9fa457cbc410b652bbce2e45.tar.bz2 libmm-fileinfo-abb726ea9c0b065b9fa457cbc410b652bbce2e45.zip |
1. in special case, the lyrics of music content are not displayed 2. Get valid duration for mpeg2.5
-rwxr-xr-x | formats/ffmpeg/mm_file_format_mp3.c | 22 | ||||
-rwxr-xr-x | packaging/libmm-fileinfo.spec | 2 | ||||
-rwxr-xr-x | utils/mm_file_util_tag.c | 5 |
3 files changed, 27 insertions, 2 deletions
diff --git a/formats/ffmpeg/mm_file_format_mp3.c b/formats/ffmpeg/mm_file_format_mp3.c index 4dcfb8d..0584f0d 100755 --- a/formats/ffmpeg/mm_file_format_mp3.c +++ b/formats/ffmpeg/mm_file_format_mp3.c @@ -620,6 +620,21 @@ __AvParseXingHeader( AvFileContentInfo* pInfo, unsigned char* buf ) } } else + if((pInfo->mpegVersion == AV_MPEG_VER_25) && (pInfo->channels == 1)) + { + if (buf[13] =='X') { + if( buf[14] != 'i' ) return false; + if( buf[15] != 'n' ) return false; + if( buf[16] != 'g' ) return false; + } else if (buf[13] == 'I') { + if( buf[14] != 'n' ) return false; + if( buf[15] != 'f' ) return false; + if( buf[16] != 'o' ) return false; + } else { + return false; + } + } + else { if (buf[21] =='X') { if( buf[22] != 'i' ) return false; @@ -645,7 +660,10 @@ __AvParseXingHeader( AvFileContentInfo* pInfo, unsigned char* buf ) return false; } - pInfo->sampleRate = data.sampRate; + /* Temporary fix code for MPEG 2.5 */ + if (pInfo->mpegVersion != AV_MPEG_VER_25) { + pInfo->sampleRate = data.sampRate; + } pInfo->datafileLen = data.bytes; pInfo->frameNum = data.frames; pInfo->frameSize = (int) ( (float) data.bytes / (float) data.frames ) ; @@ -1433,6 +1451,8 @@ static int mmf_file_mp3_get_infomation (char *filename, AvFileContentInfo* pInfo frameSamples = MPEG_2_SIZE_LAYER_2_3; } + debug_msg("frameSamples : %d, tempduration : %ld", frameSamples, tempduration); + if(tempduration < (unsigned long long)pInfo->sampleRate) { tempduration = (tempduration*frameSamples*10)/pInfo->sampleRate; diff --git a/packaging/libmm-fileinfo.spec b/packaging/libmm-fileinfo.spec index bf04cdc..3f47bb9 100755 --- a/packaging/libmm-fileinfo.spec +++ b/packaging/libmm-fileinfo.spec @@ -1,7 +1,7 @@ Name: libmm-fileinfo Summary: Media Fileinfo Version: 0.6.0 -Release: 19 +Release: 20 Group: System/Libraries License: Apache License, Version 2.0 Source0: %{name}-%{version}.tar.gz diff --git a/utils/mm_file_util_tag.c b/utils/mm_file_util_tag.c index fe28fc6..ce40f36 100755 --- a/utils/mm_file_util_tag.c +++ b/utils/mm_file_util_tag.c @@ -2462,6 +2462,11 @@ bool mm_file_id3tag_parse_v223(AvFileContentInfo* pInfo, unsigned char *buffer) //pExtContent[tmp+1] value should't have encoding value if(pExtContent[tmp] == 0x00 || pExtContent[tmp] == 0xFF|| pExtContent[tmp] == 0xFE) { + if (pExtContent[tmp] == 0x00) { + realCpyFrameNum -= 2; + tmp = 5; + } + if((IS_ENCODEDBY_UTF16(pExtContent+tmp) || IS_ENCODEDBY_UTF16_R(pExtContent+tmp)) && realCpyFrameNum > 2) { while((NEWLINE_OF_UTF16(pExtContent + tmp) || NEWLINE_OF_UTF16_R(pExtContent + tmp))&& realCpyFrameNum > 4) |