add new drm error type
authorYounghwan Ahn <younghwan_.an@samsung.com>
Mon, 14 Jan 2013 14:11:36 +0000 (23:11 +0900)
committerYounghwan Ahn <younghwan_.an@samsung.com>
Mon, 14 Jan 2013 14:11:36 +0000 (23:11 +0900)
Change-Id: Ibfd4f8ff8c4d5fa1262a70117f961c82aa5c6a6e

src/mm_player_priv.c

index c7926bc..c583c8d 100755 (executable)
@@ -9109,9 +9109,12 @@ __mmplayer_handle_gst_error ( mm_player_t* player, GstMessage * message, GError*
        /* post error to application */
        if ( ! player->posted_msg )
        {
-               if (msg_param.code == MM_MESSAGE_DRM_NOT_AUTHORIZED)
+               if (msg_param.code == MM_MESSAGE_DRM_NOT_AUTHORIZED ||
+                       msg_param.code == MM_MESSAGE_DRM_NO_LICENSE ||
+                       msg_param.code == MM_MESSAGE_DRM_FUTURE_USE ||
+                       msg_param.code == MM_MESSAGE_DRM_EXPIRED )
                {
-                       MMPLAYER_POST_MSG( player, MM_MESSAGE_DRM_NOT_AUTHORIZED, NULL );
+                       MMPLAYER_POST_MSG( player, msg_param.code, NULL );
                }
                else
                {
@@ -9604,7 +9607,21 @@ __gst_transform_gsterror( mm_player_t* player, GstMessage * message, GError* err
                case GST_STREAM_ERROR_DECRYPT:
                case GST_STREAM_ERROR_DECRYPT_NOKEY:
                {
-                       debug_error("decryption error, %s failed reason : %s\n", src_element_name, error->message);
+                       debug_error("decryption error, [%s] failed, reason : [%s]\n", src_element_name, error->message);
+
+                       if ( strstr(error->message, "rights expired") )
+                       {
+                               return MM_MESSAGE_DRM_EXPIRED;
+                       }
+                       else if ( strstr(error->message, "no rights") )
+                       {
+                               return MM_MESSAGE_DRM_NO_LICENSE;
+                       }
+                       else if ( strstr(error->message, "has future rights") )
+                       {
+                               return MM_MESSAGE_DRM_FUTURE_USE;
+                       }
+
                        return MM_MESSAGE_DRM_NOT_AUTHORIZED;
                }
                break;