Code cleanup. remove unnecessary code 49/296449/2 accepted/tizen_8.0_unified tizen_8.0 accepted/tizen/8.0/unified/20231005.093446 accepted/tizen/unified/20230731.175319 tizen_8.0_m2_release
authorjiyong.min <jiyong.min@samsung.com>
Fri, 28 Jul 2023 03:26:11 +0000 (12:26 +0900)
committerjiyong.min <jiyong.min@samsung.com>
Fri, 28 Jul 2023 03:53:29 +0000 (12:53 +0900)
Change-Id: I4c07c92c5e74e9b06812f7be19570140c425534c

formats/ffmpeg/mm_file_format_amr.c
formats/ffmpeg/mm_file_format_ffmpeg.c
formats/ffmpeg/mm_file_format_frame.c
packaging/libmm-fileinfo.spec
utils/mm_file_util_io_mmap.c

index 496d59e..bfa78ac 100644 (file)
@@ -239,11 +239,9 @@ static bool __mmfile_amrparser_open(MMFileAMRHandle *handle, const char *path)
 
        return true;
 exception:
-       if (privateData) {
-               mmfile_close(privateData->hFile);
-               mmfile_free(privateData);
-               *handle = NULL;
-       }
+       mmfile_close(privateData->hFile);
+       mmfile_free(privateData);
+       *handle = NULL;
        return false;
 }
 
index ca4729e..457a7f4 100644 (file)
@@ -561,14 +561,12 @@ int mmfile_format_read_stream_ffmpg(MMFileFormatContext *formatContext)
                        formatContext->audioTotalTrackNum += 1;
 
                        pAudioCodecCtx = pFormatCtx->streams[i]->codecpar;
-                       if (pAudioCodecCtx) {
-                               audioStream->codecId            = __convert_audio_codec_type(pAudioCodecCtx->codec_id);
-                               audioStream->bitRate            = pAudioCodecCtx->bit_rate;
-                               audioStream->nbChannel          = pAudioCodecCtx->ch_layout.nb_channels;
-                               audioStream->samplePerSec       = pAudioCodecCtx->sample_rate;
-                               audioStream->bitPerSample       = pAudioCodecCtx->bits_per_coded_sample;
-                               audioStream->is_uhqa = __check_uhqa(audioStream->samplePerSec, pFormatCtx->streams[i]->codecpar->format);
-                       }
+                       audioStream->codecId            = __convert_audio_codec_type(pAudioCodecCtx->codec_id);
+                       audioStream->bitRate            = pAudioCodecCtx->bit_rate;
+                       audioStream->nbChannel          = pAudioCodecCtx->ch_layout.nb_channels;
+                       audioStream->samplePerSec       = pAudioCodecCtx->sample_rate;
+                       audioStream->bitPerSample       = pAudioCodecCtx->bits_per_coded_sample;
+                       audioStream->is_uhqa = __check_uhqa(audioStream->samplePerSec, pFormatCtx->streams[i]->codecpar->format);
                }
        }
 
index ad34515..80c85d2 100755 (executable)
@@ -497,10 +497,8 @@ static int __mmfile_get_frame(AVFormatContext *pFormatCtx,
 #endif
        debug_msg(RELEASE, "frame : %p", *frame);
 
-       if (pFrame)
-               av_frame_free(&pFrame);
-       if (pVideoCodecCtx)
-               avcodec_free_context(&pVideoCodecCtx);
+       av_frame_free(&pFrame);
+       avcodec_free_context(&pVideoCodecCtx);
 
        return MMFILE_FORMAT_SUCCESS;
 
@@ -509,8 +507,7 @@ exception:
 
        if (pFrame)
                av_frame_free(&pFrame);
-       if (pVideoCodecCtx)
-               avcodec_free_context(&pVideoCodecCtx);
+       avcodec_free_context(&pVideoCodecCtx);
 
        return ret;
 }
index 050a961..29c8bdb 100644 (file)
@@ -1,6 +1,6 @@
 Name:      libmm-fileinfo
 Summary:    Media Fileinfo
-Version:    1.0.19
+Version:    1.0.20
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0
index 3510df6..143862c 100755 (executable)
@@ -95,19 +95,17 @@ static int mmf_mmap_open(MMFileIOHandle *handle, const char *filename, int flags
        return MMFILE_UTIL_SUCCESS;
 
 exception:
-       if (mmapHandle) {
-               if (mmapHandle->ptr) {
-                       munmap(mmapHandle->ptr, mmapHandle->size);
-               }
-
-               if (mmapHandle->fd > 2) {
-                       close(mmapHandle->fd);
-               }
+       if (mmapHandle->ptr) {
+               munmap(mmapHandle->ptr, mmapHandle->size);
+       }
 
-               mmfile_free(mmapHandle);
-               handle->privateData = NULL;
+       if (mmapHandle->fd > 2) {
+               close(mmapHandle->fd);
        }
 
+       mmfile_free(mmapHandle);
+       handle->privateData = NULL;
+
        return MMFILE_UTIL_FAIL;
 }