1. Fix a bug when media has only audio track
authorHyunjun Ko <zzoon.ko@samsung.com>
Tue, 9 Apr 2013 07:56:17 +0000 (16:56 +0900)
committerHyunjun Ko <zzoon.ko@samsung.com>
Tue, 9 Apr 2013 07:56:17 +0000 (16:56 +0900)
formats/ffmpeg/mm_file_format_ffmpeg.c
formats/ffmpeg/mm_file_format_mp3.c
mm_file.c
packaging/libmm-fileinfo.spec

index c15ea2e..aa0cd97 100755 (executable)
@@ -177,7 +177,8 @@ HANDLING_DRM_DIVX:
                        #ifdef __MMFILE_TEST_MODE__
                        debug_msg ("FFMPEG video codec id: 0x%08X\n", pFormatCtx->streams[i]->codec->codec_id);
                        #endif
-                       formatContext->videoTotalTrackNum += 1;
+                       if (ConvertVideoCodecEnum(pFormatCtx->streams[i]->codec->codec_id) != MM_VIDEO_CODEC_NONE)
+                               formatContext->videoTotalTrackNum += 1;
                }
                if (pFormatCtx->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
                        #ifdef __MMFILE_TEST_MODE__
index 0584f0d..8b6e48a 100755 (executable)
@@ -605,22 +605,7 @@ __AvParseXingHeader( AvFileContentInfo* pInfo, unsigned char* buf )
                }
        }
        else
-       if((pInfo->mpegVersion == AV_MPEG_VER_2) && (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((pInfo->mpegVersion == AV_MPEG_VER_25) && (pInfo->channels == 1))
+       if((pInfo->mpegVersion == AV_MPEG_VER_2 || pInfo->mpegVersion == AV_MPEG_VER_25) && (pInfo->channels == 1))
        {
                if (buf[13] =='X') {
                        if( buf[14] != 'i' ) return false;
@@ -659,11 +644,7 @@ __AvParseXingHeader( AvFileContentInfo* pInfo, unsigned char* buf )
                        debug_error ("invalid Xing header\n");
                        return false;
                }
-       
-               /* 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 )  ;
index 1dc12ae..945b0b8 100755 (executable)
--- a/mm_file.c
+++ b/mm_file.c
@@ -411,7 +411,7 @@ _get_contents_info (mmf_attrs_t *attrs, MMFileSourceType *src, MMFILE_PARSE_INFO
                        if (formatContext->videoTotalTrackNum > 0) {
                                MMFileFormatStream *videoStream = formatContext->streams[MMFILE_VIDEO_STREAM];
                                unsigned int timestamp = _SEEK_POINT_;
-                               
+
                                ret = mmfile_format_read_frame (formatContext, timestamp, &frameContext);
                                if (MMFILE_FORMAT_FAIL == ret) {
                                        debug_error ("error: mmfile_format_read_frame\n");
index 7c99dd5..003534f 100755 (executable)
@@ -1,7 +1,7 @@
 Name:      libmm-fileinfo
 Summary:    Media Fileinfo
 Version:    0.6.0
-Release:    20
+Release:    21
 Group:      System/Libraries
 License:    Apache License, Version 2.0
 Source0:    %{name}-%{version}.tar.gz