[content] Fix CheckContentType
authorSeokpil Park <seokpil.park@samsung.com>
Mon, 20 May 2013 05:48:45 +0000 (14:48 +0900)
committerSeokpil Park <seokpil.park@samsung.com>
Mon, 20 May 2013 07:58:20 +0000 (16:58 +0900)
Change-Id: I9fcfb2ff2c30f1fe83529f899be796303030b2fa
Signed-off-by: Seokpil Park <seokpil.park@samsung.com>
src/FCnt_ContentManagerUtilImpl.cpp
src/FCnt_PlayListImpl.cpp
src/FCnt_PlayListManagerImpl.cpp

index de68e10..0b6b2b9 100755 (executable)
@@ -1773,17 +1773,17 @@ _ContentManagerUtilImpl::CheckStream(const String& contentPath)
                                "[%s] metadata_extractor_get_metadata failed.", GetErrorMessage(r));
        }
 
-       if (*(pAudio.get()) > 0 && *(pVideo.get()) == 0)
+       if (*(pAudio.get()) > '0' && *(pVideo.get()) == '0')
        {
                SysLog(NID_CNT, "The result of CheckStream() is audio");
                return CONTENT_TYPE_AUDIO;
        }
-       else if (*(pAudio.get()) == 0 && *(pVideo.get()) > 0)
+       else if (*(pAudio.get()) == '0' && *(pVideo.get()) > '0')
        {
                SysLog(NID_CNT, "The result of CheckStream() is video");
                return CONTENT_TYPE_VIDEO;
        }
-       else if (*(pAudio.get()) > 0 && *(pVideo.get()) > 0)
+       else if (*(pAudio.get()) > '0' && *(pVideo.get()) > '0')
        {
                SysLog(NID_CNT, "The result of CheckStream() is video");
                return CONTENT_TYPE_VIDEO;
index ba3f2c9..84483c1 100644 (file)
@@ -96,6 +96,7 @@ _PlayListImpl::Construct(const Tizen::Base::String& playListName, bool isAdd)
                media_playlist_h tempHandle = null;
                ret = media_playlist_insert_to_db(pInputCond.get(), &tempHandle);
                r = MapCoreErrorToNativeResult(ret);
+               SysTryReturnResult(NID_CNT, !IsFailed(r), r, "Failed to perform media_playlist_insert_to_db operation.");
 
                std::unique_ptr<media_playlist_s, PlayListHandleDeleter> pPlaylistHandle(tempHandle);
                SysTryReturnResult(NID_CNT, pPlaylistHandle != null, E_OUT_OF_MEMORY, "pPlaylistHandle is null.");
@@ -712,6 +713,11 @@ _PlayListImpl::MapCoreErrorToNativeResult(int reason) const
                r = E_SUCCESS;
                break;
 
+       case MEDIA_CONTENT_ERROR_OUT_OF_MEMORY:
+               r = E_OUT_OF_MEMORY;
+               SysLog(NID_CNT, "MEDIA_CONTENT_ERROR_OUT_OF_MEMORY");
+               break;
+
        case MEDIA_CONTENT_ERROR_INVALID_PARAMETER:
                r = E_INVALID_ARG;
                SysLog(NID_CNT, "MEDIA_CONTENT_ERROR_INVALID_PARAMETER");
@@ -746,6 +752,11 @@ _PlayListImpl::MapCoreDatabaseErrorToNativeResult(int reason) const
                r = E_SUCCESS;
                break;
 
+       case MEDIA_CONTENT_ERROR_OUT_OF_MEMORY:
+               r = E_OUT_OF_MEMORY;
+               SysLog(NID_CNT, "MEDIA_CONTENT_ERROR_OUT_OF_MEMORY");
+               break;
+
        case MEDIA_CONTENT_ERROR_DB_FAILED:
                r = E_DATABASE;
                SysLog(NID_CNT, "MEDIA_CONTENT_ERROR_DB_FAILED");
index bfa9b76..aba4cb2 100644 (file)
@@ -300,6 +300,11 @@ _PlayListManagerImpl::MapCoreErrorToNativeResult(int reason) const
                r = E_SUCCESS;
                break;
 
+       case MEDIA_CONTENT_ERROR_OUT_OF_MEMORY:
+               r = E_OUT_OF_MEMORY;
+               SysLog(NID_CNT, "MEDIA_CONTENT_ERROR_OUT_OF_MEMORY");
+               break;
+
        case MEDIA_CONTENT_ERROR_INVALID_PARAMETER:
                r = E_INVALID_ARG;
                SysLog(NID_CNT, "MEDIA_CONTENT_ERROR_INVALID_PARAMETER");
@@ -334,6 +339,11 @@ _PlayListManagerImpl::MapCoreDatabaseErrorToNativeResult(int reason) const
                r = E_SUCCESS;
                break;
 
+       case MEDIA_CONTENT_ERROR_OUT_OF_MEMORY:
+               r = E_OUT_OF_MEMORY;
+               SysLog(NID_CNT, "MEDIA_CONTENT_ERROR_OUT_OF_MEMORY");
+               break;
+
        case MEDIA_CONTENT_ERROR_DB_FAILED:
                r = E_DATABASE;
                SysLog(NID_CNT, "MEDIA_CONTENT_ERROR_DB_FAILED");