[libbluray-devel] Added BD_EVENT_READ_ERROR
hpi1
git at videolan.org
Wed Oct 19 13:34:30 CEST 2011
libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Sun Jul 3 16:12:46 2011 +0300| [5a478d553211a63227e4c53b7638367dba79e702] | committer: hpi1
Added BD_EVENT_READ_ERROR
> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=5a478d553211a63227e4c53b7638367dba79e702
---
player_wrappers/xine/input_bluray.c | 5 +++++
src/examples/hdmv_test.c | 6 ++++++
src/libbluray/bluray.c | 1 +
src/libbluray/bluray.h | 5 +++--
4 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/player_wrappers/xine/input_bluray.c b/player_wrappers/xine/input_bluray.c
index 21f5009..29e8669 100644
--- a/player_wrappers/xine/input_bluray.c
+++ b/player_wrappers/xine/input_bluray.c
@@ -458,6 +458,11 @@ static void handle_libbluray_event(bluray_input_plugin_t *this, BD_EVENT ev)
this->error = 1;
return;
+ case BD_EVENT_READ_ERROR:
+ LOGMG("m2ts file read error");
+ /*stream_flush(this); leave error detection and handling for upper layer */
+ return;
+
case BD_EVENT_ENCRYPTED:
lprintf("BD_EVENT_ENCRYPTED\n");
_x_message (this->stream, XINE_MSG_ENCRYPTED_SOURCE,
diff --git a/src/examples/hdmv_test.c b/src/examples/hdmv_test.c
index fb542ba..9401c3d 100644
--- a/src/examples/hdmv_test.c
+++ b/src/examples/hdmv_test.c
@@ -33,6 +33,12 @@ static void _print_event(BD_EVENT *ev)
case BD_EVENT_ERROR:
printf("EVENT_ERROR:\t%d\n", ev->param);
break;
+ case BD_EVENT_READ_ERROR:
+ printf("EVENT_READ_ERROR:\t%d\n", ev->param);
+ break;
+ case BD_EVENT_ENCRYPTED:
+ printf("EVENT_ENCRYPTED:\t%d\n", ev->param);
+ break;
/* current playback position */
diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index 4e2fce3..fd69c62 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -434,6 +434,7 @@ static int _read_block(BLURAY *bd, BD_STREAM *st, uint8_t *buf)
BD_DEBUG(DBG_STREAM | DBG_CRIT, "Read %d bytes at %"PRIu64" failed ! (%p)\n", len, st->clip_block_pos, bd);
+ _queue_event(bd, (BD_EVENT){BD_EVENT_READ_ERROR, 0});
return 0;
}
diff --git a/src/libbluray/bluray.h b/src/libbluray/bluray.h
index f3777d8..83cf1a1 100644
--- a/src/libbluray/bluray.h
+++ b/src/libbluray/bluray.h
@@ -466,8 +466,9 @@ 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,
+ BD_EVENT_ERROR, /* Fatal error. Playback can't be continued. */
+ BD_EVENT_READ_ERROR, /* Reading of .m2ts aligned unit failed. Next call to read will try next block. */
+ BD_EVENT_ENCRYPTED, /* .m2ts file is encrypted and can't be played */
/* current playback position */
BD_EVENT_ANGLE, /* current angle, 1...N */
More information about the libbluray-devel
mailing list