[DVDnav-discuss] r939 - in trunk/libdvdnav2/src: dvdnav.c dvdnav.h
nicodvb
subversion at mplayerhq.hu
Mon Jun 11 23:12:33 CEST 2007
Author: nicodvb
Date: Mon Jun 11 23:12:33 2007
New Revision: 939
Log:
implemented dvdnav_get_audio_attr and dvdnav_get_spu_attr; patch by Attila Otvos
Modified:
trunk/libdvdnav2/src/dvdnav.c
trunk/libdvdnav2/src/dvdnav.h
Modified: trunk/libdvdnav2/src/dvdnav.c
==============================================================================
--- trunk/libdvdnav2/src/dvdnav.c (original)
+++ trunk/libdvdnav2/src/dvdnav.c Mon Jun 11 23:12:33 2007
@@ -947,6 +947,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;
@@ -967,6 +984,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/libdvdnav2/src/dvdnav.h
==============================================================================
--- trunk/libdvdnav2/src/dvdnav.h (original)
+++ trunk/libdvdnav2/src/dvdnav.h Mon Jun 11 23:12:33 2007
@@ -583,11 +583,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