Mercurial > libdvdnav.hg
changeset 300:cbd2b606f343 src
implemented dvdnav_get_audio_attr and dvdnav_get_spu_attr; patch by Attila Otvos
author | nicodvb |
---|---|
date | Mon, 11 Jun 2007 21:14:12 +0000 |
parents | f57d023eb107 |
children | 4e24652c5ddf |
files | dvdnav.c dvdnav.h |
diffstat | 2 files changed, 45 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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;
--- 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. */