summaryrefslogtreecommitdiffstats
path: root/libhb
diff options
context:
space:
mode:
Diffstat (limited to 'libhb')
-rw-r--r--libhb/dvd.c23
-rw-r--r--libhb/hb.h2
2 files changed, 25 insertions, 0 deletions
diff --git a/libhb/dvd.c b/libhb/dvd.c
index f0cc521bc..7d19fae11 100644
--- a/libhb/dvd.c
+++ b/libhb/dvd.c
@@ -41,6 +41,29 @@ struct hb_dvd_s
static void FindNextCell( hb_dvd_t * );
static int dvdtime2msec( dvd_time_t * );
+char * hb_dvd_name( char * path )
+{
+ static char name[1024];
+ unsigned char unused[1024];
+ dvd_reader_t * reader;
+
+ reader = DVDOpen( path );
+ if( !reader )
+ {
+ return NULL;
+ }
+
+ if( DVDUDFVolumeInfo( reader, name, sizeof( name ),
+ unused, sizeof( unused ) ) )
+ {
+ DVDClose( reader );
+ return NULL;
+ }
+
+ DVDClose( reader );
+ return name;
+}
+
/***********************************************************************
* hb_dvd_init
***********************************************************************
diff --git a/libhb/hb.h b/libhb/hb.h
index 5feef6c94..e989a6bc0 100644
--- a/libhb/hb.h
+++ b/libhb/hb.h
@@ -66,6 +66,8 @@ int hb_check_update( hb_handle_t * h, char ** version );
ports.h) */
void hb_set_cpu_count( hb_handle_t *, int );
+char * hb_dvd_name( char * path );
+
/* hb_scan()
Scan the specified path. Can be a DVD device, a VIDEO_TS folder or
a VOB file. If title_index is 0, scan all titles. */