[libbluray-devel] commit: Added BD_EVENT_ENCRYPTED. (hpi1 )
git at videolan.org
git at videolan.org
Mon Dec 6 14:33:29 CET 2010
libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Mon Dec 6 15:31:50 2010 +0200| [5957c2be44b3c0d48bc3659f4c005ed318aa61f0] | committer: hpi1
Added BD_EVENT_ENCRYPTED.
Make bd_read() fail if aligned unit copy permission indicator is set.
> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=5957c2be44b3c0d48bc3659f4c005ed318aa61f0
---
src/libbluray/bluray.c | 8 ++++++++
src/libbluray/bluray.h | 1 +
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index 6d158f9..5371fb6 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -302,6 +302,14 @@ static int _read_block(BLURAY *bd, BD_STREAM *st, uint8_t *buf)
}
+ /* Check TP_extra_header Copy_permission_indicator. If != 0, unit is still encrypted. */
+ if (buf[0] & 0xc0) {
+ DEBUG(DBG_BLURAY | DBG_CRIT,
+ "TP header copy permission indicator != 0, unit is still encrypted? (%p)\n", bd);
+ _queue_event(bd, (BD_EVENT){BD_EVENT_ENCRYPTED, 0});
+ return 0;
+ }
+
DEBUG(DBG_STREAM, "Read unit OK! (%p)\n", bd);
return 1;
diff --git a/src/libbluray/bluray.h b/src/libbluray/bluray.h
index 3da7c11..01e9f38 100644
--- a/src/libbluray/bluray.h
+++ b/src/libbluray/bluray.h
@@ -442,6 +442,7 @@ void bd_stop_bdj(BLURAY *bd); // shutdown BD-J and clean up resources
typedef enum {
BD_EVENT_NONE = 0,
BD_EVENT_ERROR,
+ BD_EVENT_ENCRYPTED,
/* current playback position */
BD_EVENT_ANGLE, /* current angle, 1...N */
More information about the libbluray-devel
mailing list