diff options
author | titer <[email protected]> | 2006-04-19 20:25:37 +0000 |
---|---|---|
committer | titer <[email protected]> | 2006-04-19 20:25:37 +0000 |
commit | 1d4535870a4212535c56f79f784c30a018a3e646 (patch) | |
tree | 750fb15df400421474e393563ce2e4edda9c9b96 /libhb | |
parent | 72738ac78c91e391c1e03714f7142d325116d5a6 (diff) |
Show the name of the DVD instead of /dev/rdiskX
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@64 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb')
-rw-r--r-- | libhb/dvd.c | 23 | ||||
-rw-r--r-- | libhb/hb.h | 2 |
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. */ |