[DVDnav-discuss] r940 - in trunk/libdvdnav/src: dvdnav.c dvdnav.h

nicodvb subversion at mplayerhq.hu
Mon Jun 11 23:14:12 CEST 2007


Author: nicodvb
Date: Mon Jun 11 23:14:12 2007
New Revision: 940

Log:
implemented dvdnav_get_audio_attr and dvdnav_get_spu_attr; patch by Attila Otvos

Modified:
   trunk/libdvdnav/src/dvdnav.c
   trunk/libdvdnav/src/dvdnav.h

Modified: trunk/libdvdnav/src/dvdnav.c
==============================================================================
--- trunk/libdvdnav/src/dvdnav.c	(original)
+++ trunk/libdvdnav/src/dvdnav.c	Mon Jun 11 23:14:12 2007
@@ -962,6 +962,23 @@ int8_t dvdnav_get_audio_logical_stream(d
   return retval;
 }
 
+dvdnav_status_t dvdnav_get_audio_attr(dvdnav_t *this, uint8_t audio_num, audio_attr_t *audio_attr) {
+  if(!this->started) {
+    printerr("Virtual DVD machine not started.");
+    return -1;
+  }
+  pthread_mutex_lock(&this->vm_lock);
+  if (!this->vm->state.pgc) {
+    printerr("No current PGC.");
+    pthread_mutex_unlock(&this->vm_lock); 
+    return -1;
+  }
+  *audio_attr=vm_get_audio_attr(this->vm, audio_num);
+  pthread_mutex_unlock(&this->vm_lock);
+
+  return DVDNAV_STATUS_OK;
+}
+
 int8_t dvdnav_get_spu_logical_stream(dvdnav_t *this, uint8_t subp_num) {
   int8_t       retval;
 
@@ -982,6 +999,22 @@ int8_t dvdnav_get_spu_logical_stream(dvd
   return retval;
 }
 
+dvdnav_status_t dvdnav_get_spu_attr(dvdnav_t *this, uint8_t audio_num, subp_attr_t *subp_attr) {
+  if(!this->started) {
+    printerr("Virtual DVD machine not started.");
+    return -1;
+  }
+  pthread_mutex_lock(&this->vm_lock);
+  if (!this->vm->state.pgc) {
+    printerr("No current PGC.");
+    pthread_mutex_unlock(&this->vm_lock); 
+    return -1;
+  }
+  *subp_attr=vm_get_subp_attr(this->vm, audio_num);
+  pthread_mutex_unlock(&this->vm_lock);
+  return DVDNAV_STATUS_OK;
+}
+
 int8_t dvdnav_get_active_audio_stream(dvdnav_t *this) {
   int8_t        retval;
 

Modified: trunk/libdvdnav/src/dvdnav.h
==============================================================================
--- trunk/libdvdnav/src/dvdnav.h	(original)
+++ trunk/libdvdnav/src/dvdnav.h	Mon Jun 11 23:14:12 2007
@@ -585,11 +585,23 @@ uint16_t dvdnav_spu_stream_to_lang(dvdna
  */
 int8_t dvdnav_get_audio_logical_stream(dvdnav_t *self, uint8_t audio_num);
 
+#define HAVE_GET_AUDIO_ATTR
+/*
+ * Get audio attr
+ */
+dvdnav_status_t dvdnav_get_audio_attr(dvdnav_t *self, uint8_t audio_mum, audio_attr_t *audio_attr);
+
 /*
  * Converts a *physical* (MPEG) subpicture stream id into a logical stream number.
  */
 int8_t dvdnav_get_spu_logical_stream(dvdnav_t *self, uint8_t subp_num);
 
+#define HAVE_GET_SPU_ATTR
+/*
+ * Get spu attr
+ */
+dvdnav_status_t dvdnav_get_spu_attr(dvdnav_t *self, uint8_t audio_mum, subp_attr_t *subp_attr);
+
 /*
  * Get active audio stream.
  */



More information about the DVDnav-discuss mailing list