Mercurial > libdvdnav.hg
diff dvdnav.c @ 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 | b9783221fb6e |
children | f08dbb15ece1 |
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;