[libbluray-devel] commit: Added DBG_STREAM debug mask. Separated bd_read() and _read_block() debug messages from others. (hpi1 )
git at videolan.org
git at videolan.org
Sun Oct 17 15:11:25 CEST 2010
libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Sun Oct 17 16:05:59 2010 +0300| [144a204c0268708606386f8dafa746c7054aeed6] | committer: hpi1
Added DBG_STREAM debug mask. Separated bd_read() and _read_block() debug messages from others.
> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=144a204c0268708606386f8dafa746c7054aeed6
---
src/libbluray/bluray.c | 20 ++++++++++----------
src/util/log_control.h | 1 +
2 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index c75bc7e..9669f4e 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -259,7 +259,7 @@ static int _read_block(BLURAY *bd, BD_STREAM *st, uint8_t *buf)
const int len = 6144;
if (st->fp) {
- DEBUG(DBG_BLURAY, "Reading unit [%d bytes] at %"PRIu64"... (%p)\n",
+ DEBUG(DBG_STREAM, "Reading unit [%d bytes] at %"PRIu64"... (%p)\n",
len, st->clip_block_pos, bd);
if (len + st->clip_block_pos <= st->clip_size) {
@@ -267,11 +267,11 @@ static int _read_block(BLURAY *bd, BD_STREAM *st, uint8_t *buf)
if ((read_len = file_read(st->fp, buf, len))) {
if (read_len != len)
- DEBUG(DBG_BLURAY | DBG_CRIT, "Read %d bytes at %"PRIu64" ; requested %d ! (%p)\n", read_len, st->clip_block_pos, len, bd);
+ DEBUG(DBG_STREAM | DBG_CRIT, "Read %d bytes at %"PRIu64" ; requested %d ! (%p)\n", read_len, st->clip_block_pos, len, bd);
if (bd->libaacs_decrypt_unit) {
if (!bd->libaacs_decrypt_unit(bd->aacs, buf)) {
- DEBUG(DBG_BLURAY, "Unable decrypt unit! (%p)\n", bd);
+ DEBUG(DBG_AACS | DBG_CRIT, "Unable decrypt unit! (%p)\n", bd);
return 0;
} // decrypt
@@ -292,17 +292,17 @@ static int _read_block(BLURAY *bd, BD_STREAM *st, uint8_t *buf)
}
- DEBUG(DBG_BLURAY, "Read unit OK! (%p)\n", bd);
+ DEBUG(DBG_STREAM, "Read unit OK! (%p)\n", bd);
return 1;
}
- DEBUG(DBG_BLURAY | DBG_CRIT, "Read %d bytes at %"PRIu64" failed ! (%p)\n", len, st->clip_block_pos, bd);
+ DEBUG(DBG_STREAM | DBG_CRIT, "Read %d bytes at %"PRIu64" failed ! (%p)\n", len, st->clip_block_pos, bd);
return 0;
}
- DEBUG(DBG_BLURAY | DBG_CRIT, "Read past EOF ! (%p)\n", bd);
+ DEBUG(DBG_STREAM | DBG_CRIT, "Read past EOF ! (%p)\n", bd);
return 0;
}
@@ -721,7 +721,7 @@ int bd_read(BLURAY *bd, unsigned char *buf, int len)
if (st->fp) {
out_len = 0;
- DEBUG(DBG_BLURAY, "Reading [%d bytes] at %"PRIu64"... (%p)\n", len, bd->s_pos, bd);
+ DEBUG(DBG_STREAM, "Reading [%d bytes] at %"PRIu64"... (%p)\n", len, bd->s_pos, bd);
while (len > 0) {
uint32_t clip_pkt;
@@ -763,7 +763,7 @@ int bd_read(BLURAY *bd, unsigned char *buf, int len)
if (clip_pkt >= st->clip->end_pkt) {
st->clip = nav_next_clip(bd->title, st->clip);
if (st->clip == NULL) {
- DEBUG(DBG_BLURAY, "End of title (%p)\n", bd);
+ DEBUG(DBG_BLURAY|DBG_STREAM, "End of title (%p)\n", bd);
return out_len;
}
if (!_open_m2ts(bd, st)) {
@@ -797,12 +797,12 @@ int bd_read(BLURAY *bd, unsigned char *buf, int len)
bd_psr_write(bd->regs, PSR_CHAPTER, current_chapter + 1);
}
- DEBUG(DBG_BLURAY, "%d bytes read OK! (%p)\n", out_len, bd);
+ DEBUG(DBG_STREAM, "%d bytes read OK! (%p)\n", out_len, bd);
return out_len;
}
- DEBUG(DBG_BLURAY, "No valid title selected! (%p)\n", bd);
+ DEBUG(DBG_STREAM | DBG_CRIT, "bd_read(): no valid title selected! (%p)\n", bd);
return -1;
}
diff --git a/src/util/log_control.h b/src/util/log_control.h
index 3c5a7fa..6eeebe9 100644
--- a/src/util/log_control.h
+++ b/src/util/log_control.h
@@ -39,6 +39,7 @@ enum debug_mask_enum {
DBG_CRIT = 2048, // this is libbluray's default debug mask so use this if you want to display critical info
DBG_HDMV = 4096,
DBG_BDJ = 8192,
+ DBG_STREAM = 16384,
};
typedef enum debug_mask_enum debug_mask_t;
More information about the libbluray-devel
mailing list