Mercurial > libdvdnav.hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
299:f57d023eb107 | 300:cbd2b606f343 |
---|---|
960 pthread_mutex_unlock(&this->vm_lock); | 960 pthread_mutex_unlock(&this->vm_lock); |
961 | 961 |
962 return retval; | 962 return retval; |
963 } | 963 } |
964 | 964 |
965 int8_t dvdnav_get_spu_logical_stream(dvdnav_t *this, uint8_t subp_num) { | 965 dvdnav_status_t dvdnav_get_audio_attr(dvdnav_t *this, uint8_t audio_num, audio_attr_t *audio_attr) { |
966 int8_t retval; | 966 if(!this->started) { |
967 | 967 printerr("Virtual DVD machine not started."); |
968 if(!this->started) { | 968 return -1; |
969 printerr("Virtual DVD machine not started."); | 969 } |
970 return -1; | |
971 } | |
972 | |
973 pthread_mutex_lock(&this->vm_lock); | 970 pthread_mutex_lock(&this->vm_lock); |
974 if (!this->vm->state.pgc) { | 971 if (!this->vm->state.pgc) { |
975 printerr("No current PGC."); | 972 printerr("No current PGC."); |
976 pthread_mutex_unlock(&this->vm_lock); | 973 pthread_mutex_unlock(&this->vm_lock); |
977 return -1; | 974 return -1; |
978 } | 975 } |
976 *audio_attr=vm_get_audio_attr(this->vm, audio_num); | |
977 pthread_mutex_unlock(&this->vm_lock); | |
978 | |
979 return DVDNAV_STATUS_OK; | |
980 } | |
981 | |
982 int8_t dvdnav_get_spu_logical_stream(dvdnav_t *this, uint8_t subp_num) { | |
983 int8_t retval; | |
984 | |
985 if(!this->started) { | |
986 printerr("Virtual DVD machine not started."); | |
987 return -1; | |
988 } | |
989 | |
990 pthread_mutex_lock(&this->vm_lock); | |
991 if (!this->vm->state.pgc) { | |
992 printerr("No current PGC."); | |
993 pthread_mutex_unlock(&this->vm_lock); | |
994 return -1; | |
995 } | |
979 retval = vm_get_subp_stream(this->vm, subp_num, 0); | 996 retval = vm_get_subp_stream(this->vm, subp_num, 0); |
980 pthread_mutex_unlock(&this->vm_lock); | 997 pthread_mutex_unlock(&this->vm_lock); |
981 | 998 |
982 return retval; | 999 return retval; |
1000 } | |
1001 | |
1002 dvdnav_status_t dvdnav_get_spu_attr(dvdnav_t *this, uint8_t audio_num, subp_attr_t *subp_attr) { | |
1003 if(!this->started) { | |
1004 printerr("Virtual DVD machine not started."); | |
1005 return -1; | |
1006 } | |
1007 pthread_mutex_lock(&this->vm_lock); | |
1008 if (!this->vm->state.pgc) { | |
1009 printerr("No current PGC."); | |
1010 pthread_mutex_unlock(&this->vm_lock); | |
1011 return -1; | |
1012 } | |
1013 *subp_attr=vm_get_subp_attr(this->vm, audio_num); | |
1014 pthread_mutex_unlock(&this->vm_lock); | |
1015 return DVDNAV_STATUS_OK; | |
983 } | 1016 } |
984 | 1017 |
985 int8_t dvdnav_get_active_audio_stream(dvdnav_t *this) { | 1018 int8_t dvdnav_get_active_audio_stream(dvdnav_t *this) { |
986 int8_t retval; | 1019 int8_t retval; |
987 | 1020 |