Ticket #8537: dvdnav_1206.resync.fixes.diff
| File dvdnav_1206.resync.fixes.diff, 27.1 KB (added by , 16 years ago) |
|---|
-
mythtv/libs/libmythdvdnav/dvdnav/vm/vm.c
54 54 #ifdef __OS2__ 55 55 #define INCL_DOS 56 56 #include <os2.h> 57 #include <io.h> /* setmode() */ 58 #include <fcntl.h> /* O_BINARY */ 57 59 #endif 58 60 59 61 /* … … 144 146 ULONG ulAction; 145 147 ULONG rc; 146 148 147 rc = DosOpen (name, &hfile, &ulAction, 0, FILE_NORMAL,149 rc = DosOpenL(name, &hfile, &ulAction, 0, FILE_NORMAL, 148 150 OPEN_ACTION_OPEN_IF_EXISTS | OPEN_ACTION_FAIL_IF_NEW, 149 151 OPEN_ACCESS_READONLY | OPEN_SHARE_DENYNONE | OPEN_FLAGS_DASD, 150 NULL );152 NULL); 151 153 152 if( rc)154 if(rc) 153 155 return -1; 154 156 155 return ( int )hfile; 157 setmode(hfile, O_BINARY); 158 159 return (int)hfile; 156 160 } 157 161 #endif 158 162 … … 354 358 fprintf(MSG_OUT, "libdvdnav: vm: failed to open/read the DVD\n"); 355 359 return 0; 356 360 } 357 dvd_read_name(vm->dvd_name, vm->dvd_serial, dvdroot);358 vm->map = remap_loadmap(vm->dvd_name);359 361 vm->vmgi = ifoOpenVMGI(vm->dvd); 360 362 if(!vm->vmgi) { 361 363 fprintf(MSG_OUT, "libdvdnav: vm: failed to read VIDEO_TS.IFO\n"); … … 386 388 /* return 0; Not really used for now.. */ 387 389 } 388 390 /* ifoRead_TXTDT_MGI(vmgi); Not implemented yet */ 391 dvd_read_name(vm->dvd_name, vm->dvd_serial, dvdroot); 392 vm->map = remap_loadmap(vm->dvd_name); 389 393 } 390 394 if (vm->vmgi) { 391 395 int i, mask; … … 861 865 break; 862 866 } 863 867 } 868 #endif 864 869 865 /* currently unused */866 870 void vm_get_subp_info(vm_t *vm, int *current, int *num_avail) { 867 871 switch ((vm->state).domain) { 868 872 case VTS_DOMAIN: … … 905 909 break; 906 910 } 907 911 } 908 #endif909 912 910 913 int vm_get_video_aspect(vm_t *vm) { 911 914 int aspect = vm_get_video_attr(vm).display_aspect_ratio; … … 1717 1720 /* Figure out the correct pgN from the cell and update (vm->state). */ 1718 1721 static int set_PGN(vm_t *vm) { 1719 1722 int new_pgN = 0; 1723 int dummy, part; 1720 1724 1721 1725 while(new_pgN < (vm->state).pgc->nr_of_programs 1722 1726 && (vm->state).cellN >= (vm->state).pgc->program_map[new_pgN]) … … 1733 1737 if((vm->state).TTN_REG > vm->vmgi->tt_srpt->nr_of_srpts) 1734 1738 return 0; /* ?? */ 1735 1739 pb_ty = &vm->vmgi->tt_srpt->title[(vm->state).TTN_REG - 1].pb_ty; 1736 if(pb_ty->multi_or_random_pgc_title == /* One_Sequential_PGC_Title */ 0) {1737 int dummy, part;1738 1740 vm_get_current_title_part(vm, &dummy, &part); 1739 1741 (vm->state).PTTN_REG = part; 1740 } else {1741 /* FIXME: Handle RANDOM or SHUFFLE titles.1742 fprintf(MSG_OUT, "libdvdnav: RANDOM or SHUFFLE titles are NOT handled yet.\n");1743 */1744 }1745 1742 } 1746 1743 return 1; 1747 1744 } -
mythtv/libs/libmythdvdnav/dvdnav/vm/vm.h
160 160 /* currently unused */ 161 161 void vm_get_audio_info(vm_t *vm, int *current, int *num_avail); 162 162 void vm_get_subp_info(vm_t *vm, int *current, int *num_avail); 163 #endif 163 164 void vm_get_video_res(vm_t *vm, int *width, int *height); 164 #endif165 165 int vm_get_video_aspect(vm_t *vm); 166 166 int vm_get_video_scale_permission(vm_t *vm); 167 167 int vm_get_video_format(vm_t *vm); -
mythtv/libs/libmythdvdnav/dvdnav/dvdnav.c
845 845 return retval; 846 846 } 847 847 848 int dvdnav_get_video_resolution(dvdnav_t *this, uint32_t *width, uint32_t *height) { 849 int w, h; 850 851 if(!this->started) { 852 printerr("Virtual DVD machine not started."); 853 return -1; 854 } 855 856 pthread_mutex_lock(&this->vm_lock); 857 vm_get_video_res(this->vm, &w, &h); 858 pthread_mutex_unlock(&this->vm_lock); 859 860 *width = w; 861 *height = h; 862 return 0; 863 } 864 848 865 uint8_t dvdnav_get_video_scale_permission(dvdnav_t *this) { 849 866 uint8_t retval; 850 867 -
mythtv/libs/libmythdvdnav/dvdnav/dvdnav_internal.h
34 34 #define pthread_mutex_init(a, b) InitializeCriticalSection(a) 35 35 #define pthread_mutex_lock(a) EnterCriticalSection(a) 36 36 #define pthread_mutex_unlock(a) LeaveCriticalSection(a) 37 #define pthread_mutex_destroy(a) 37 #define pthread_mutex_destroy(a) DeleteCriticalSection(a) 38 38 39 39 #if HAVE_GETTIMEOFDAY == 0 40 40 /* replacement gettimeofday implementation */ … … 60 60 #endif /* WIN32 */ 61 61 62 62 /* where should libdvdnav write its messages (stdout/stderr) */ 63 #define MSG_OUT std out63 #define MSG_OUT stderr 64 64 65 65 /* Maximum length of an error string */ 66 66 #define MAX_ERR_LEN 255 -
mythtv/libs/libmythdvdnav/dvdnav/dvdnav.h
561 561 uint8_t dvdnav_get_video_aspect(dvdnav_t *self); 562 562 563 563 /* 564 * Get video resolution. 565 */ 566 int dvdnav_get_video_resolution(dvdnav_t *self, uint32_t *width, uint32_t *height); 567 568 /* 564 569 * Get video scaling permissions. 565 570 * The scaling permission does only change on VTS boundaries. 566 571 * See the DVDNAV_VTS_CHANGE event. -
mythtv/libs/libmythdvdnav/dvdread/dvd_reader.c
20 20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 21 21 */ 22 22 23 #include "config.h"24 25 23 #include <sys/types.h> 26 24 #include <sys/stat.h> 27 25 #include <sys/time.h> /* For the timing of dvdcss_title crack. */ … … 30 28 #include <stdio.h> 31 29 #include <errno.h> 32 30 #include <string.h> 31 #include <ctype.h> 33 32 #include <unistd.h> 34 33 #include <limits.h> 35 34 #include <dirent.h> … … 53 52 #define lseek64 _lseeki64 54 53 #endif 55 54 56 #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__bsdi__) || defined(__ DARWIN__)55 #if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__bsdi__) || defined(__APPLE__) 57 56 #define SYS_BSD 1 58 57 #endif 59 58 … … 249 248 250 249 if( have_css ) { 251 250 /* Only if DVDCSS_METHOD = title, a bit if it's disc or if 252 * DVDCSS_METHOD = key but region mis smatch. Unfortunaly we251 * DVDCSS_METHOD = key but region mismatch. Unfortunately we 253 252 * don't have that information. */ 254 253 255 254 dvd->css_state = 1; /* Need key init. */ … … 304 303 #endif 305 304 306 305 #if defined(SYS_BSD) 307 /* FreeBSD /dev/(r)(a)cd0c (a is for atapi), recomended to _not_ use r 306 /* FreeBSD /dev/(r)(a)cd0c (a is for atapi), recommended to _not_ use r 307 update: FreeBSD and DragonFly no longer uses the prefix so don't add it. 308 308 OpenBSD /dev/rcd0c, it needs to be the raw device 309 309 NetBSD /dev/rcd0[d|c|..] d for x86, c (for non x86), perhaps others 310 310 Darwin /dev/rdisk0, it needs to be the raw device 311 BSD/OS /dev/sr0c (if not mounted) or /dev/rsr0c ('c' any letter will do) */ 311 BSD/OS /dev/sr0c (if not mounted) or /dev/rsr0c ('c' any letter will do) 312 returns a string allocated with strdup. It should be freed when no longer 313 used. */ 312 314 static char *bsd_block2char( const char *path ) 313 315 { 316 #if defined(__FreeBSD__) || defined(__DragonFly__) 317 return (char *) strdup( path ); 318 #else 314 319 char *new_path; 315 320 316 321 /* If it doesn't start with "/dev/" or does start with "/dev/r" exit */ … … 323 328 strcat( new_path, path + strlen( "/dev/" ) ); 324 329 325 330 return new_path; 331 #endif /* __FreeBSD__ || __DragonFly__ */ 326 332 } 327 333 #endif 328 334 … … 330 336 dvd_reader_t *DVDOpen( const char *ppath ) 331 337 { 332 338 struct stat fileinfo; 333 int ret, have_css ;339 int ret, have_css, retval, cdir = -1; 334 340 dvd_reader_t *ret_val = NULL; 335 341 char *dev_name = NULL; 336 char *path ;342 char *path = NULL, *new_path = NULL, *path_copy = NULL; 337 343 338 #if def _MSC_VER344 #if defined(_WIN32) || defined(__OS2__) 339 345 int len; 340 346 #endif 341 347 342 348 if( ppath == NULL ) 343 return 0;349 goto DVDOpen_error; 344 350 345 351 path = strdup(ppath); 346 352 if( path == NULL ) 347 return 0;353 goto DVDOpen_error; 348 354 349 355 /* Try to open libdvdcss or fall back to standard functions */ 350 356 have_css = dvdinput_setup(); 351 357 352 #if def _MSC_VER358 #if defined(_WIN32) || defined(__OS2__) 353 359 /* Strip off the trailing \ if it is not a drive */ 354 360 len = strlen(path); 355 361 if ((len > 1) && … … 374 380 /* If we can't stat the file, give up */ 375 381 fprintf( stderr, "libdvdread: Can't stat %s\n", path ); 376 382 perror(""); 377 free(path); 378 return NULL; 383 goto DVDOpen_error; 379 384 } 380 385 381 386 /* First check if this is a block/char device or a file*/ … … 386 391 /** 387 392 * Block devices and regular files are assumed to be DVD-Video images. 388 393 */ 394 dvd_reader_t *dvd = NULL; 389 395 #if defined(__sun) 390 ret_val = DVDOpenImageFile( sun_block2char( path ), have_css);396 dev_name = sun_block2char( path ); 391 397 #elif defined(SYS_BSD) 392 ret_val = DVDOpenImageFile( bsd_block2char( path ), have_css);398 dev_name = bsd_block2char( path ); 393 399 #else 394 ret_val = DVDOpenImageFile( path, have_css);400 dev_name = strdup( path ); 395 401 #endif 396 402 dvd = DVDOpenImageFile( dev_name, have_css ); 403 free( dev_name ); 397 404 free(path); 398 return ret_val; 399 405 return dvd; 400 406 } else if( S_ISDIR( fileinfo.st_mode ) ) { 401 407 dvd_reader_t *auth_drive = 0; 402 char *path_copy;403 408 #if defined(SYS_BSD) 404 409 struct fstab* fe; 405 410 #elif defined(__sun) || defined(__linux__) … … 407 412 #endif 408 413 409 414 /* XXX: We should scream real loud here. */ 410 if( !(path_copy = strdup( path ) ) ) { 411 free(path); 412 return NULL; 413 } 415 if( !(path_copy = strdup( path ) ) ) 416 goto DVDOpen_error; 414 417 415 418 #ifndef WIN32 /* don't have fchdir, and getcwd( NULL, ... ) is strange */ 416 419 /* Also WIN32 does not have symlinks, so we don't need this bit of code. */ 417 420 418 /* Resolve any symlinks and get the absolut dir name. */421 /* Resolve any symlinks and get the absolute dir name. */ 419 422 { 420 char *new_path; 421 int cdir = open( ".", O_RDONLY ); 422 423 if( cdir >= 0 ) { 424 chdir( path_copy ); 423 if( ( cdir = open( ".", O_RDONLY ) ) >= 0 ) { 424 if( chdir( path_copy ) == -1 ) { 425 goto DVDOpen_error; 426 } 425 427 new_path = malloc(PATH_MAX+1); 426 428 if(!new_path) { 427 free(path); 428 return NULL; 429 goto DVDOpen_error; 429 430 } 430 getcwd(new_path, PATH_MAX ); 431 fchdir( cdir ); 431 if( getcwd( new_path, PATH_MAX ) == NULL ) { 432 goto DVDOpen_error; 433 } 434 retval = fchdir( cdir ); 432 435 close( cdir ); 433 free( path_copy ); 434 path_copy = new_path; 436 cdir = -1; 437 if( retval == -1 ) { 438 goto DVDOpen_error; 439 } 440 path_copy = new_path; 441 new_path = NULL; 435 442 } 436 443 } 437 444 #endif 438 445 439 446 /** 440 447 * If we're being asked to open a directory, check if that directory 441 * is the mount point for a DVD-ROM which we can use instead.448 * is the mount point for a DVD-ROM which we can use instead. 442 449 */ 443 450 444 451 if( strlen( path_copy ) > 1 ) { … … 447 454 } 448 455 } 449 456 457 #if defined(_WIN32) || defined(__OS2__) 458 if(strlen(path_copy) > TITLES_MAX) { 459 if(!strcasecmp(&(path_copy[strlen( path_copy ) - TITLES_MAX]), 460 "\\video_ts")) 461 path_copy[strlen(path_copy) - (TITLES_MAX-1)] = '\0'; 462 } 463 #endif 450 464 if( strlen( path_copy ) > TITLES_MAX ) { 451 465 if( !strcasecmp( &(path_copy[ strlen( path_copy ) - TITLES_MAX ]), 452 466 "/video_ts" ) ) { … … 508 522 } 509 523 fclose( mntfile ); 510 524 } 511 #elif defined(_MSC_VER) || defined(__OS2__) 525 #elif defined(_WIN32) || defined(__OS2__) 526 #ifdef __OS2__ 527 /* Use DVDOpenImageFile() only if it is a drive */ 528 if(isalpha(path[0]) && path[1] == ':' && 529 ( !path[2] || 530 ((path[2] == '\\' || path[2] == '/') && !path[3]))) 531 #endif 512 532 auth_drive = DVDOpenImageFile( path, have_css ); 513 533 #endif 514 534 515 #if !defined(_ MSC_VER) && !defined(__OS2__)535 #if !defined(_WIN32) && !defined(__OS2__) 516 536 if( !dev_name ) { 517 537 fprintf( stderr, "libdvdread: Couldn't find device name.\n" ); 518 538 } else if( !auth_drive ) { … … 522 542 #else 523 543 if( !auth_drive ) { 524 544 fprintf( stderr, "libdvdread: Device %s inaccessible, " 525 "CSS authentication not available.\n", dev_name);545 "CSS authentication not available.\n", path ); 526 546 } 527 547 #endif 528 548 529 549 free( dev_name ); 550 dev_name = NULL; 530 551 free( path_copy ); 552 path_copy = NULL; 531 553 532 554 /** 533 555 * If we've opened a drive, just use that. … … 544 566 return ret_val; 545 567 } 546 568 569 DVDOpen_error: 547 570 /* If it's none of the above, screw it. */ 548 571 fprintf( stderr, "libdvdread: Could not open %s\n", path ); 572 if( path != NULL ) 549 573 free( path ); 574 if ( path_copy != NULL ) 575 free( path_copy ); 576 if ( cdir >= 0 ) 577 close( cdir ); 578 if ( new_path != NULL ) 579 free( new_path ); 550 580 return NULL; 551 581 } 552 582 … … 875 905 int i; 876 906 877 907 if( dvd_file ) { 878 if( dvd_file->dvd->isImageFile ) { 879 ; 880 } else { 908 if( !dvd_file->dvd->isImageFile ) { 881 909 for( i = 0; i < TITLES_MAX; ++i ) { 882 910 if( dvd_file->title_devs[ i ] ) { 883 911 dvdinput_close( dvd_file->title_devs[i] ); … … 890 918 } 891 919 } 892 920 921 static int DVDFileStatVOBUDF( dvd_reader_t *dvd, int title, 922 int menu, dvd_stat_t *statbuf ) 923 { 924 char filename[ MAX_UDF_FILE_NAME_LEN ]; 925 uint32_t size; 926 off_t tot_size; 927 off_t parts_size[ 9 ]; 928 int nr_parts = 0; 929 int n; 930 931 if( title == 0 ) 932 sprintf( filename, "/VIDEO_TS/VIDEO_TS.VOB" ); 933 else 934 sprintf( filename, "/VIDEO_TS/VTS_%02d_%d.VOB", title, menu ? 0 : 1 ); 935 936 if( !UDFFindFile( dvd, filename, &size ) ) 937 return -1; 938 939 tot_size = size; 940 nr_parts = 1; 941 parts_size[ 0 ] = size; 942 943 if( !menu ) { 944 int cur; 945 946 for( cur = 2; cur < 10; cur++ ) { 947 sprintf( filename, "/VIDEO_TS/VTS_%02d_%d.VOB", title, cur ); 948 if( !UDFFindFile( dvd, filename, &size ) ) 949 break; 950 951 parts_size[ nr_parts ] = size; 952 tot_size += size; 953 nr_parts++; 954 } 955 } 956 957 statbuf->size = tot_size; 958 statbuf->nr_parts = nr_parts; 959 for( n = 0; n < nr_parts; n++ ) 960 statbuf->parts_size[ n ] = parts_size[ n ]; 961 962 return 0; 963 } 964 965 966 static int DVDFileStatVOBPath( dvd_reader_t *dvd, int title, 967 int menu, dvd_stat_t *statbuf ) 968 { 969 char filename[ MAX_UDF_FILE_NAME_LEN ]; 970 char full_path[ PATH_MAX + 1 ]; 971 struct stat fileinfo; 972 off_t tot_size; 973 off_t parts_size[ 9 ]; 974 int nr_parts = 0; 975 int n; 976 977 if( title == 0 ) 978 sprintf( filename, "VIDEO_TS.VOB" ); 979 else 980 sprintf( filename, "VTS_%02d_%d.VOB", title, menu ? 0 : 1 ); 981 982 if( !findDVDFile( dvd, filename, full_path ) ) 983 return -1; 984 985 if( stat( full_path, &fileinfo ) < 0 ) { 986 fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename ); 987 return -1; 988 } 989 990 tot_size = fileinfo.st_size; 991 nr_parts = 1; 992 parts_size[ 0 ] = fileinfo.st_size; 993 994 if( !menu ) { 995 int cur; 996 for( cur = 2; cur < 10; cur++ ) { 997 sprintf( filename, "VTS_%02d_%d.VOB", title, cur ); 998 if( !findDVDFile( dvd, filename, full_path ) ) 999 break; 1000 1001 if( stat( full_path, &fileinfo ) < 0 ) { 1002 fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename ); 1003 break; 1004 } 1005 1006 parts_size[ nr_parts ] = fileinfo.st_size; 1007 tot_size += parts_size[ nr_parts ]; 1008 nr_parts++; 1009 } 1010 } 1011 1012 statbuf->size = tot_size; 1013 statbuf->nr_parts = nr_parts; 1014 for( n = 0; n < nr_parts; n++ ) 1015 statbuf->parts_size[ n ] = parts_size[ n ]; 1016 1017 return 0; 1018 } 1019 1020 1021 int DVDFileStat( dvd_reader_t *dvd, int titlenum, 1022 dvd_read_domain_t domain, dvd_stat_t *statbuf ) 1023 { 1024 char filename[ MAX_UDF_FILE_NAME_LEN ]; 1025 char full_path[ PATH_MAX + 1 ]; 1026 struct stat fileinfo; 1027 uint32_t size; 1028 1029 /* Check arguments. */ 1030 if( dvd == NULL || titlenum < 0 ) { 1031 errno = EINVAL; 1032 return -1; 1033 } 1034 1035 switch( domain ) { 1036 case DVD_READ_INFO_FILE: 1037 if( titlenum == 0 ) 1038 sprintf( filename, "/VIDEO_TS/VIDEO_TS.IFO" ); 1039 else 1040 sprintf( filename, "/VIDEO_TS/VTS_%02i_0.IFO", titlenum ); 1041 1042 break; 1043 case DVD_READ_INFO_BACKUP_FILE: 1044 if( titlenum == 0 ) 1045 sprintf( filename, "/VIDEO_TS/VIDEO_TS.BUP" ); 1046 else 1047 sprintf( filename, "/VIDEO_TS/VTS_%02i_0.BUP", titlenum ); 1048 1049 break; 1050 case DVD_READ_MENU_VOBS: 1051 if( dvd->isImageFile ) 1052 return DVDFileStatVOBUDF( dvd, titlenum, 1, statbuf ); 1053 else 1054 return DVDFileStatVOBPath( dvd, titlenum, 1, statbuf ); 1055 1056 break; 1057 case DVD_READ_TITLE_VOBS: 1058 if( titlenum == 0 ) 1059 return -1; 1060 1061 if( dvd->isImageFile ) 1062 return DVDFileStatVOBUDF( dvd, titlenum, 0, statbuf ); 1063 else 1064 return DVDFileStatVOBPath( dvd, titlenum, 0, statbuf ); 1065 1066 break; 1067 default: 1068 fprintf( stderr, "libdvdread: Invalid domain for file stat.\n" ); 1069 errno = EINVAL; 1070 return -1; 1071 } 1072 1073 if( dvd->isImageFile ) { 1074 if( UDFFindFile( dvd, filename, &size ) ) { 1075 statbuf->size = size; 1076 statbuf->nr_parts = 1; 1077 statbuf->parts_size[ 0 ] = size; 1078 return 0; 1079 } 1080 } else { 1081 if( findDVDFile( dvd, filename, full_path ) ) { 1082 if( stat( full_path, &fileinfo ) < 0 ) 1083 fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename ); 1084 else { 1085 statbuf->size = fileinfo.st_size; 1086 statbuf->nr_parts = 1; 1087 statbuf->parts_size[ 0 ] = statbuf->size; 1088 return 0; 1089 } 1090 } 1091 } 1092 return -1; 1093 } 1094 893 1095 /* Internal, but used from dvd_udf.c */ 894 1096 int UDFReadBlocksRaw( dvd_reader_t *device, uint32_t lb_number, 895 1097 size_t block_count, unsigned char *data, -
mythtv/libs/libmythdvdnav/dvdread/nav_print.c
23 23 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 24 24 */ 25 25 26 #include "config.h"27 28 26 #include <stdio.h> 29 27 #include <inttypes.h> 30 28 -
mythtv/libs/libmythdvdnav/dvdread/dvd_input.h
31 31 32 32 typedef struct dvd_input_s *dvd_input_t; 33 33 34 #if defined( __MINGW32__ ) 35 # undef lseek 36 # define lseek _lseeki64 37 # undef off_t 38 # define off_t off64_t 39 # undef stat 40 # define stat _stati64 41 # define fstat _fstati64 42 # define wstat _wstati64 43 #endif 44 34 45 /** 35 46 * Function pointers that will be filled in by the input implementation. 36 47 * These functions provide the main API. -
mythtv/libs/libmythdvdnav/dvdread/bitreader.c
18 18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 19 19 */ 20 20 21 #include "config.h"22 23 21 #include <stdio.h> 24 22 #include <stdlib.h> 25 23 #include <string.h> -
mythtv/libs/libmythdvdnav/dvdread/dvd_reader.h
70 70 typedef struct dvd_file_s dvd_file_t; 71 71 72 72 /** 73 * Public type that is used to provide statistics on a handle. 74 */ 75 typedef struct { 76 off_t size; /**< Total size of file in bytes */ 77 int nr_parts; /**< Number of file parts */ 78 off_t parts_size[9]; /**< Size of each part in bytes */ 79 } dvd_stat_t; 80 81 /** 73 82 * Opens a block device of a DVD-ROM file, or an image file, or a directory 74 83 * name for a mounted DVD or HD copy of a DVD. 75 84 * … … 117 126 } dvd_read_domain_t; 118 127 119 128 /** 129 * Stats a file on the DVD given the title number and domain. 130 * The information about the file is stored in a dvd_stat_t 131 * which contains information about the size of the file and 132 * the number of parts in case of a multipart file and the respective 133 * sizes of the parts. 134 * A multipart file is for instance VTS_02_1.VOB, VTS_02_2.VOB, VTS_02_3.VOB 135 * The size of VTS_02_1.VOB will be stored in stat->parts_size[0], 136 * VTS_02_2.VOB in stat->parts_size[1], ... 137 * The total size (sum of all parts) is stored in stat->size and 138 * stat->nr_parts will hold the number of parts. 139 * Only DVD_READ_TITLE_VOBS (VTS_??_[1-9].VOB) can be multipart files. 140 * 141 * This function is only of use if you want to get the size of each file 142 * in the filesystem. These sizes are not needed to use any other 143 * functions in libdvdread. 144 * 145 * @param dvd A dvd read handle. 146 * @param titlenum Which Video Title Set should be used, VIDEO_TS is 0. 147 * @param domain Which domain. 148 * @param stat Pointer to where the result is stored. 149 * @return If successful 0, otherwise -1. 150 * 151 * int DVDFileStat(dvd, titlenum, domain, stat); 152 */ 153 int DVDFileStat(dvd_reader_t *, int, dvd_read_domain_t, dvd_stat_t *); 154 155 /** 120 156 * Opens a file on the DVD given the title number and domain. 121 157 * 122 158 * If the title number is 0, the video manager information is opened -
mythtv/libs/libmythdvdnav/dvdread/dvdread_internal.h
19 19 #ifndef LIBDVDREAD_DVDREAD_INTERNAL_H 20 20 #define LIBDVDREAD_DVDREAD_INTERNAL_H 21 21 22 #ifdef _ MSC_VER22 #ifdef _WIN32 23 23 #include <unistd.h> 24 #endif /* _ MSC_VER*/24 #endif /* _WIN32 */ 25 25 26 26 #define CHECK_VALUE(arg) \ 27 27 if(!(arg)) { \ -
mythtv/libs/libmythdvdnav/dvdread/dvd_udf.c
28 28 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 29 29 */ 30 30 31 #include "config.h"32 33 31 #include <stdio.h> 34 32 #include <stdlib.h> 35 33 #include <string.h> … … 445 443 446 444 L_EA = GETN4( 168 ); 447 445 L_AD = GETN4( 172 ); 446 447 if (176 + L_EA + L_AD > DVD_VIDEO_LB_LEN) 448 return 0; 449 448 450 p = 176 + L_EA; 449 451 while( p < 176 + L_EA + L_AD ) { 450 452 switch( flags & 0x0007 ) { … … 928 930 if(GetUDFCache(device, PVDCache, 0, pvd)) 929 931 return 1; 930 932 931 if(!UDFGetDescriptor( device, 1, pvd_buf, 932 sizeof(pvd_buf_base) - (pvd_buf - pvd_buf_base))) 933 if(!UDFGetDescriptor( device, 1, pvd_buf, DVD_VIDEO_LB_LEN)) 933 934 return 0; 934 935 935 936 memcpy(pvd->VolumeIdentifier, &pvd_buf[24], 32); -
mythtv/libs/libmythdvdnav/dvdread/md5.c
20 20 21 21 /* Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995. */ 22 22 23 #ifdef HAVE_CONFIG_H24 # include <config.h>25 #endif26 27 23 #include <sys/types.h> 28 24 29 25 #include <stdlib.h> -
mythtv/libs/libmythdvdnav/dvdread/ifo_print.c
130 130 printf("(please send a bug report), "); 131 131 } 132 132 133 // Wide is al lways allowed..!!!133 // Wide is always allowed..!!! 134 134 switch(attr->permitted_df) { 135 135 case 0: 136 136 printf("pan&scan+letterboxed, "); … … 328 328 case 1: // Normal audio 329 329 printf("Normal Caption "); 330 330 break; 331 case 2: // visually impa ried331 case 2: // visually impaired 332 332 printf("Audio for visually impaired "); 333 333 break; 334 334 case 3: // Directors 1 … … 685 685 break; 686 686 case 2: 687 687 case 3: 688 printf("(send bug rep port) ");688 printf("(send bug report) "); 689 689 break; 690 690 } 691 691 } … … 781 781 } 782 782 } 783 783 784 /* Mem mory offsets to div. tables. */784 /* Memory offsets to div. tables. */ 785 785 ifoPrint_PGC_COMMAND_TBL(pgc->command_tbl); 786 786 ifoPrint_PGC_PROGRAM_MAP(pgc->program_map, pgc->nr_of_programs); 787 787 ifoPrint_CELL_PLAYBACK(pgc->cell_playback, pgc->nr_of_cells); … … 806 806 printf("\tTitle playback type: (%02x)\n", 807 807 *(uint8_t *)&(tt_srpt->title[i].pb_ty)); 808 808 printf("\t\t%s\n", 809 tt_srpt->title[i].pb_ty.multi_or_random_pgc_title ? "Random or Shuffle" : "Sequen cial");809 tt_srpt->title[i].pb_ty.multi_or_random_pgc_title ? "Random or Shuffle" : "Sequential"); 810 810 if (tt_srpt->title[i].pb_ty.jlc_exists_in_cell_cmd) printf("\t\tJump/Link/Call exists in cell cmd\n"); 811 811 if (tt_srpt->title[i].pb_ty.jlc_exists_in_prepost_cmd) printf("\t\tJump/Link/Call exists in pre/post cmd\n"); 812 812 if (tt_srpt->title[i].pb_ty.jlc_exists_in_button_cmd) printf("\t\tJump/Link/Call exists in button cmd\n"); … … 1109 1109 printf("No PGCI Unit table present\n"); 1110 1110 } 1111 1111 1112 printf("\nParental Man egment Information table\n");1112 printf("\nParental Management Information table\n"); 1113 1113 printf( "------------------------------------\n"); 1114 1114 if(ifohandle->ptl_mait) { 1115 1115 ifoPrint_PTL_MAIT(ifohandle->ptl_mait); … … 1129 1129 printf("No Text Data Manager Information present\n"); 1130 1130 } 1131 1131 1132 printf("\nMenu Cell Adress table\n"); 1132 1133 printf("\nMenu Cell Address table\n"); 1133 1134 printf( "-----------------\n"); 1134 1135 if(ifohandle->menu_c_adt) { 1135 1136 ifoPrint_C_ADT(ifohandle->menu_c_adt); 1136 1137 } else { 1137 printf("No Menu Cell Ad ress table present\n");1138 printf("No Menu Cell Address table present\n"); 1138 1139 } 1139 1140 1140 1141 printf("\nVideo Manager Menu VOBU address map\n"); … … 1176 1177 printf("No VTS Time Map table present\n"); 1177 1178 } 1178 1179 1179 printf("\nMenu Cell Ad ress table\n");1180 printf("\nMenu Cell Address table\n"); 1180 1181 printf( "-----------------\n"); 1181 1182 if(ifohandle->menu_c_adt) { 1182 1183 ifoPrint_C_ADT(ifohandle->menu_c_adt); 1183 1184 } else { 1184 printf("No Cell Ad ress table present\n");1185 printf("No Cell Address table present\n"); 1185 1186 } 1186 1187 1187 1188 printf("\nVideo Title Set Menu VOBU address map\n"); -
mythtv/libs/libmythdvdnav/dvdread/dvd_input.c
19 19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 20 20 */ 21 21 22 #include "config.h"23 24 22 #include <stdio.h> 25 23 #include <stdlib.h> 26 24 #include <fcntl.h> 27 25 #include <unistd.h> 28 26 27 #include "config.h" 29 28 #include "dvdread/dvd_reader.h" 30 29 #include "dvd_input.h" 31 30 … … 170 169 } 171 170 172 171 /* Open the device */ 173 #if ndef WIN32172 #if !defined(WIN32) && !defined(__OS2__) 174 173 dev->fd = open(target, O_RDONLY); 175 174 #else 176 175 dev->fd = open(target, O_RDONLY | O_BINARY);
