From 1bf58f0f2024024f398d47c6d27848935d73b46f Mon Sep 17 00:00:00 2001 From: Younghwan Ahn Date: Mon, 14 Jan 2013 23:11:36 +0900 Subject: [PATCH] add new drm error type Change-Id: Ibfd4f8ff8c4d5fa1262a70117f961c82aa5c6a6e --- src/mm_player_priv.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/mm_player_priv.c b/src/mm_player_priv.c index c7926bc..c583c8d 100755 --- a/src/mm_player_priv.c +++ b/src/mm_player_priv.c @@ -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; -- 2.34.1