Commit 7ef5a220 authored by npzacs's avatar npzacs

Added extended AACS error codes

parent 6181d501
- Added extended AACS error codes
2012-03-19: Version 0.2.2
- Fixed displaying of single-loop animated buttons when not using animations
- Added events for pop-up menu availability and IG menu status
......
# library version number
m4_define([bluray_major], 0)
m4_define([bluray_minor], 2)
m4_define([bluray_micro], 2)
m4_define([bluray_micro], 3)
m4_define([bluray_version],[bluray_major.bluray_minor.bluray_micro])
# shared library version (.so version)
......@@ -12,9 +12,9 @@ m4_define([bluray_version],[bluray_major.bluray_minor.bluray_micro])
#
# Library file name will be libbluray.so.(current-age).age.revision
#
m4_define([lt_current], 2)
m4_define([lt_revision], 0)
m4_define([lt_age], 1)
m4_define([lt_current], 3)
m4_define([lt_revision], 1)
m4_define([lt_age], 0)
# initilization
AC_INIT([libbluray], bluray_version, [http://www.videolan.org/developers/libbluray.html])
......
......@@ -701,7 +701,14 @@ static int _libaacs_open(BLURAY *bd, const char *keyfile_path)
return 0;
}
bd->aacs = bd->libaacs_open(bd->device_path, keyfile_path);
int error_code = 0;
fptr_p_void aacs_open2 = (fptr_p_void)dl_dlsym(bd->h_libaacs, "aacs_open2");
if (!aacs_open2) {
BD_DEBUG(DBG_BLURAY, "Using old aacs_open(), no verbose error reporting available (%p)\n", bd->aacs);
bd->aacs = bd->libaacs_open(bd->device_path, keyfile_path);
} else {
bd->aacs = aacs_open2(bd->device_path, keyfile_path, &error_code);
}
if (bd->aacs) {
BD_DEBUG(DBG_BLURAY, "Opened libaacs (%p)\n", bd->aacs);
......@@ -712,6 +719,29 @@ static int _libaacs_open(BLURAY *bd, const char *keyfile_path)
BD_DEBUG(DBG_BLURAY, "aacs_open() failed!\n");
bd->disc_info.aacs_handled = 0;
switch (error_code) {
case 0: /* AACS_SUCCESS */
break;
case -1: /* AACS_ERROR_CORRUPTED_DISC */
bd->disc_info.aacs_error_code = BD_AACS_CORRUPTED_DISC;
break;
case -2: /* AACS_ERROR_NO_CONFIG */
bd->disc_info.aacs_error_code = BD_AACS_NO_CONFIG;
break;
case -3: /* AACS_ERROR_NO_PK */
bd->disc_info.aacs_error_code = BD_AACS_NO_PK;
break;
case -4: /* AACS_ERROR_NO_CERT */
bd->disc_info.aacs_error_code = BD_AACS_NO_CERT;
break;
case -5: /* AACS_ERROR_CERT_REVOKED */
bd->disc_info.aacs_error_code = BD_AACS_CERT_REVOKED;
break;
case -6: /* AACS_ERROR_MMC_OPEN */
bd->disc_info.aacs_error_code = BD_AACS_MMC_FAILED;
break;
}
_libaacs_unload(bd);
return 0;
}
......
......@@ -407,6 +407,14 @@ uint64_t bd_tell_time(BLURAY *bd);
* Disc info
*/
/* AACS error codes */
#define BD_AACS_CORRUPTED_DISC -1
#define BD_AACS_NO_CONFIG -2
#define BD_AACS_NO_PK -3
#define BD_AACS_NO_CERT -4
#define BD_AACS_CERT_REVOKED -5
#define BD_AACS_MMC_FAILED -6
typedef struct {
uint8_t bluray_detected;
......@@ -425,6 +433,9 @@ typedef struct {
uint8_t libbdplus_detected;
uint8_t bdplus_handled;
/* aacs error code */
int aacs_error_code;
} BLURAY_DISC_INFO;
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment