[DVDnav-discuss] r975 - in trunk/libdvdnav/src: dvdnav.h searching.c

nicodvb subversion at mplayerhq.hu
Fri Nov 30 00:24:07 CET 2007


Author: nicodvb
Date: Fri Nov 30 00:24:05 2007
New Revision: 975

Log:
now dvdnav_describe_title_chapters() also returns the duration of the title

Modified:
   trunk/libdvdnav/src/dvdnav.h
   trunk/libdvdnav/src/searching.c

Modified: trunk/libdvdnav/src/dvdnav.h
==============================================================================
--- trunk/libdvdnav/src/dvdnav.h	(original)
+++ trunk/libdvdnav/src/dvdnav.h	Fri Nov 30 00:24:05 2007
@@ -286,10 +286,11 @@ dvdnav_status_t dvdnav_part_play(dvdnav_
 /*
  * 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

Modified: trunk/libdvdnav/src/searching.c
==============================================================================
--- trunk/libdvdnav/src/searching.c	(original)
+++ trunk/libdvdnav/src/searching.c	Fri Nov 30 00:24:05 2007
@@ -551,7 +551,7 @@ dvdnav_status_t dvdnav_get_position_in_t
   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 @@ uint32_t dvdnav_describe_title_chapters(
   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 @@ uint32_t dvdnav_describe_title_chapters(
       cellnr++;
     } while(cellnr < endcellnr);
   }
+  *duration = length;
   vm_ifo_close(ifo);
   retval = parts;
   *times = tmp;



More information about the DVDnav-discuss mailing list