# HG changeset patch # User nicodvb # Date 1196378645 0 # Node ID 9abc06e356ff3b3e553c7e12b2be5613c5e667ac # Parent ba9c3555e92f0ae1b0c1ba5a89f24da499bebdf0 now dvdnav_describe_title_chapters() also returns the duration of the title diff -r ba9c3555e92f -r 9abc06e356ff dvdnav.h --- a/dvdnav.h Thu Nov 29 23:09:59 2007 +0000 +++ b/dvdnav.h Thu Nov 29 23:24:05 2007 +0000 @@ -286,10 +286,11 @@ /* * Stores in *times an array (that the application *must* free) of * dvdtimes corresponding to the chapter times for the chosen title. + * *duration will have the duration of the title * The number of entries in *times is the result of the function. * On error *times is NULL and the output is 0 */ -uint32_t dvdnav_describe_title_chapters(dvdnav_t *this, int32_t title, uint64_t **times); +uint32_t dvdnav_describe_title_chapters(dvdnav_t *this, int32_t title, uint64_t **times, uint64_t *duration); /* * Play the specified amount of parts of the specified title of diff -r ba9c3555e92f -r 9abc06e356ff searching.c --- a/searching.c Thu Nov 29 23:09:59 2007 +0000 +++ b/searching.c Thu Nov 29 23:24:05 2007 +0000 @@ -551,7 +551,7 @@ return DVDNAV_STATUS_OK; } -uint32_t dvdnav_describe_title_chapters(dvdnav_t *this, int32_t title, uint64_t **times) { +uint32_t dvdnav_describe_title_chapters(dvdnav_t *this, int32_t title, uint64_t **times, uint64_t *duration) { int32_t retval=0; uint16_t parts, i; title_info_t *ptitle = NULL; @@ -562,6 +562,7 @@ uint64_t length, *tmp=NULL; *times = NULL; + *duration = 0; pthread_mutex_lock(&this->vm_lock); if(!this->vm->vmgi) { printerr("Bad VM state or missing VTSI."); @@ -613,6 +614,7 @@ cellnr++; } while(cellnr < endcellnr); } + *duration = length; vm_ifo_close(ifo); retval = parts; *times = tmp;