[libbluray-devel] bd_get_event(): accept NULL event parameter. Initializes event queue without returning any event.

hpi1 git at videolan.org
Mon Jul 11 08:54:00 CEST 2011


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Wed Jul  6 12:38:45 2011 +0300| [150d399ca885877f319941fab3d03662d35b6a98] | committer: hpi1

bd_get_event(): accept NULL event parameter. Initializes event queue without returning any event.

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=150d399ca885877f319941fab3d03662d35b6a98
---

 player_wrappers/xine/input_bluray.c |    5 ++---
 src/libbluray/bluray.c              |    6 +++++-
 src/libbluray/bluray.h              |    2 +-
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/player_wrappers/xine/input_bluray.c b/player_wrappers/xine/input_bluray.c
index 753e221..21f5009 100644
--- a/player_wrappers/xine/input_bluray.c
+++ b/player_wrappers/xine/input_bluray.c
@@ -1227,9 +1227,8 @@ static int bluray_plugin_open (input_plugin_t *this_gen)
   bd_set_player_setting_str(this->bdh, BLURAY_PLAYER_SETTING_MENU_LANG,    this->class->language);
   bd_set_player_setting_str(this->bdh, BLURAY_PLAYER_SETTING_COUNTRY_CODE, this->class->country);
 
-  /* init eq */
-  BD_EVENT ev;
-  bd_get_event(this->bdh, &ev);
+  /* init event queue */
+  bd_get_event(this->bdh, NULL);
 
   /* get disc name */
 
diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index 5960b85..4e2fce3 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -2211,7 +2211,11 @@ int bd_get_event(BLURAY *bd, BD_EVENT *event)
         _queue_initial_psr_events(bd);
     }
 
-    return _get_event(bd, event);
+    if (event) {
+        return _get_event(bd, event);
+    }
+
+    return 0;
 }
 
 /*
diff --git a/src/libbluray/bluray.h b/src/libbluray/bluray.h
index a5b44ca..ec4187d 100644
--- a/src/libbluray/bluray.h
+++ b/src/libbluray/bluray.h
@@ -512,7 +512,7 @@ typedef struct {
  *  Get event from libbluray event queue.
  *
  * @param bd  BLURAY object
- * @param event next BD_EVENT from event queue
+ * @param event next BD_EVENT from event queue, NULL to initialize event queue
  * @return 1 on success, 0 if no events
  */
 int  bd_get_event(BLURAY *bd, BD_EVENT *event);



More information about the libbluray-devel mailing list