# HG changeset patch # User nicodvb # Date 1181596452 0 # Node ID cbd2b606f343b5ec971aceabfa4684f8809f0e9b # Parent f57d023eb10751d9e4c09e396df69c0c5c01a80e implemented dvdnav_get_audio_attr and dvdnav_get_spu_attr; patch by Attila Otvos diff -r f57d023eb107 -r cbd2b606f343 dvdnav.c --- a/dvdnav.c Sat May 05 10:52:11 2007 +0000 +++ b/dvdnav.c Mon Jun 11 21:14:12 2007 +0000 @@ -962,6 +962,23 @@ 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 @@ 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; diff -r f57d023eb107 -r cbd2b606f343 dvdnav.h --- a/dvdnav.h Sat May 05 10:52:11 2007 +0000 +++ b/dvdnav.h Mon Jun 11 21:14:12 2007 +0000 @@ -585,11 +585,23 @@ */ 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. */