equal
deleted
inserted
replaced
73 int cdrec_opt_count=0; |
73 int cdrec_opt_count=0; |
74 |
74 |
75 long long totalSize=0; |
75 long long totalSize=0; |
76 int disknum=1; |
76 int disknum=1; |
77 int secs; |
77 int secs; |
|
78 long layerbreak=0; |
78 struct tm curtime; /* global, so multi-disks get all the same time */ |
79 struct tm curtime; /* global, so multi-disks get all the same time */ |
79 int auto_size=0; |
80 int auto_size=0; |
80 |
81 |
81 /****************************************************************************/ |
82 /****************************************************************************/ |
82 |
83 |
104 *p++=exename; |
105 *p++=exename; |
105 |
106 |
106 if(virt_dump || dvd) { |
107 if(virt_dump || dvd) { |
107 *p++="-dao"; |
108 *p++="-dao"; |
108 *p++=make_arg("tsize=%ds",secs); |
109 *p++=make_arg("tsize=%ds",secs); |
|
110 /* work around the oddidity that cdrecord refuses to burn the disk, if |
|
111 the tracksize is less than the first layer size on dual-layer disks */ |
|
112 if(layerbreak>0 && secs<layerbreak) |
|
113 *p++=make_arg("driveropts=layerbreak=%ld",layerbreak); |
109 } |
114 } |
110 else { |
115 else { |
111 *p++="-multi"; |
116 *p++="-multi"; |
112 *p++="-tao"; |
117 *p++="-tao"; |
113 *p++=make_arg("padsize=%ds",padsize); |
118 *p++=make_arg("padsize=%ds",padsize); |
148 if(!p) fprintf(stderr,"%s: atip command failed\n",prg_name); |
153 if(!p) fprintf(stderr,"%s: atip command failed\n",prg_name); |
149 else { |
154 else { |
150 char buff[256]; |
155 char buff[256]; |
151 while(fgets(buff,sizeof(buff),p)) { |
156 while(fgets(buff,sizeof(buff),p)) { |
152 if(dvd) { |
157 if(dvd) { |
|
158 /* get layerbreak position */ |
|
159 if(!strncmp(buff,"layer break at:",15)) layerbreak=strtol(&buff[15],NULL,10); |
153 /* DVD-R */ |
160 /* DVD-R */ |
154 if(!strncmp(buff,"rzone size:",11)) size=strtol(&buff[11],NULL,10); |
161 if(!strncmp(buff,"rzone size:",11)) size=strtol(&buff[11],NULL,10); |
155 /* DVD+R */ |
162 /* DVD+R */ |
156 else if(!strncmp(buff,"phys size:...",13)) size=strtol(&buff[13],NULL,10); |
163 else if(!strncmp(buff,"phys size:...",13)) size=strtol(&buff[13],NULL,10); |
157 } |
164 } |
160 } |
167 } |
161 pclose(p); |
168 pclose(p); |
162 free(cmd); |
169 free(cmd); |
163 if(size>0 && verbose) { |
170 if(size>0 && verbose) { |
164 char buff[16]; |
171 char buff[16]; |
165 fprintf(stderr,"%s: auto-detected media size %s (%ld blocks)\n",prg_name,FlexSize(buff,(long long)size*CD_FRAMESIZE),size); |
172 fprintf(stderr,"%s: auto-detected media size %s (%ld blocks, layerbreak at %ld)\n",prg_name,FlexSize(buff,(long long)size*CD_FRAMESIZE),size,layerbreak); |
166 } |
173 } |
167 return size; |
174 return size; |
168 } |
175 } |
169 |
176 |
170 /****************************************************************************/ |
177 /****************************************************************************/ |