Mercurial > libdvdnav.hg
changeset 315:9abc06e356ff src
now dvdnav_describe_title_chapters() also returns the duration of the title
author | nicodvb |
---|---|
date | Thu, 29 Nov 2007 23:24:05 +0000 |
parents | ba9c3555e92f |
children | e60fce5af518 |
files | dvdnav.h searching.c |
diffstat | 2 files changed, 5 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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
--- 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;