comparison dvdread/dvd_reader.c @ 323:d132820611d3 src

fail DVDDiscID if no ifo files are found. ogle-1766
author nicodvb
date Sun, 30 Dec 2007 14:29:20 +0000
parents f57d023eb107
children f59175f21e06
comparison
equal deleted inserted replaced
322:fc94594033a8 323:d132820611d3
1077 1077
1078 int DVDDiscID( dvd_reader_t *dvd, unsigned char *discid ) 1078 int DVDDiscID( dvd_reader_t *dvd, unsigned char *discid )
1079 { 1079 {
1080 struct md5_ctx ctx; 1080 struct md5_ctx ctx;
1081 int title; 1081 int title;
1082 int nr_of_files = 0;
1082 1083
1083 /* Check arguments. */ 1084 /* Check arguments. */
1084 if( dvd == NULL || discid == NULL ) 1085 if( dvd == NULL || discid == NULL )
1085 return 0; 1086 return 0;
1086 1087
1111 1112
1112 md5_process_bytes( buffer, file_size, &ctx ); 1113 md5_process_bytes( buffer, file_size, &ctx );
1113 1114
1114 DVDCloseFile( dvd_file ); 1115 DVDCloseFile( dvd_file );
1115 free( buffer_base ); 1116 free( buffer_base );
1117 nr_of_files++;
1116 } 1118 }
1117 } 1119 }
1118 md5_finish_ctx( &ctx, discid ); 1120 md5_finish_ctx( &ctx, discid );
1121 if(!nr_of_files)
1122 return -1;
1119 1123
1120 return 0; 1124 return 0;
1121 } 1125 }
1122 1126
1123 1127