]>
Commit | Line | Data |
---|---|---|
d304e206 AM |
1 | diff -up cdrkit-1.1.11/wodim/drv_mmc.c.format cdrkit-1.1.11/wodim/drv_mmc.c |
2 | --- cdrkit-1.1.11/wodim/drv_mmc.c.format 2011-05-18 16:49:14.591822130 +0200 | |
3 | +++ cdrkit-1.1.11/wodim/drv_mmc.c 2011-05-18 16:49:14.596822130 +0200 | |
4 | @@ -1507,6 +1507,11 @@ getdisktype_mdvd(SCSI *usalp, cdr_t *dp) | |
5 | dstat_t *dsp = dp->cdr_dstat; | |
6 | ||
7 | struct track_info track_info; | |
8 | + | |
9 | + extern char *buf; | |
10 | + struct disk_info *dip; | |
11 | + int profile; | |
12 | + | |
13 | if(lverbose) | |
14 | printf("HINT: use dvd+rw-mediainfo from dvd+rw-tools for information extraction.\n"); | |
15 | /* if(getdisktype_mmc(usalp, dp)<0) | |
16 | @@ -1521,6 +1526,18 @@ getdisktype_mdvd(SCSI *usalp, cdr_t *dp) | |
17 | dsp->ds_disktype&= ~DT_CD; | |
18 | dsp->ds_disktype|= DT_DVD; | |
19 | ||
20 | + profile = get_curprofile(usalp); | |
21 | + if (profile == 0x1A) { | |
22 | + dip = (struct disk_info *)buf; | |
23 | + if (get_diskinfo(usalp, dip) < 0) | |
24 | + return (-1); | |
25 | + if (dip->disk_status == DS_EMPTY) { /* Unformatted */ | |
26 | + dsp->ds_flags |= DSF_NEED_FORMAT; | |
27 | + if(lverbose) | |
28 | + printf("The medium is empty, it will be auto formatted.\n"); | |
29 | + } | |
30 | + } | |
31 | + | |
32 | return (ret); | |
33 | ||
34 | } | |
35 | diff -up cdrkit-1.1.11/wodim/scsi_cdr.c.format cdrkit-1.1.11/wodim/scsi_cdr.c | |
36 | --- cdrkit-1.1.11/wodim/scsi_cdr.c.format 2011-05-18 16:49:14.601822130 +0200 | |
37 | +++ cdrkit-1.1.11/wodim/scsi_cdr.c 2011-05-18 16:49:14.600822130 +0200 | |
38 | @@ -1328,7 +1328,7 @@ scsi_format(SCSI *usalp, caddr_t addr, i | |
39 | } | |
40 | sleep(10); | |
41 | printf("\rFormating in progress: 100.00 %% done. \n"); | |
42 | - if (pid) exit (0); | |
43 | + if (pid > 0) exit (0); | |
44 | return ret; | |
45 | } | |
46 | ||
47 | diff -up cdrkit-1.1.11/wodim/wodim.c.format cdrkit-1.1.11/wodim/wodim.c | |
48 | --- cdrkit-1.1.11/wodim/wodim.c.format 2011-05-18 16:49:14.584822130 +0200 | |
49 | +++ cdrkit-1.1.11/wodim/wodim.c 2011-05-18 17:21:59.510821630 +0200 | |
50 | @@ -946,6 +946,40 @@ int main(int argc, char *argv[]) | |
51 | print_toc(usalp, dp); | |
52 | comexit(0); | |
53 | } | |
54 | + | |
55 | + if ((flags & F_FORMAT) || (dp->cdr_dstat->ds_flags & DSF_NEED_FORMAT)) { | |
56 | + printf("wodim: media format asked\n"); | |
57 | + /* | |
58 | + * Do not abort if OPC failes. Just give it a chance | |
59 | + * for better laser power calibration than without OPC. | |
60 | + * | |
61 | + * Ricoh drives return with a vendor unique sense code. | |
62 | + * This is most likely because they refuse to do OPC | |
63 | + * on a non blank media. | |
64 | + */ | |
65 | + usalp->silent++; | |
66 | + do_opc(usalp, dp, flags); | |
67 | + usalp->silent--; | |
68 | + wait_unit_ready(usalp, 120); | |
69 | + if (gettimeofday(&starttime, (struct timezone *)0) < 0) | |
70 | + errmsg("Cannot get start time\n"); | |
71 | + | |
72 | + if ((*dp->cdr_format)(usalp, dp, formattype) < 0) { | |
73 | + errmsgno(EX_BAD, "Cannot format disk, aborting.\n"); | |
74 | + comexit(EX_BAD); | |
75 | + } | |
76 | + if (gettimeofday(&fixtime, (struct timezone *)0) < 0) | |
77 | + errmsg("Cannot get format time\n"); | |
78 | + if (lverbose) | |
79 | + prtimediff("Formatting time: ", &starttime, &fixtime); | |
80 | + | |
81 | + if (!wait_unit_ready(usalp, 240) || tracks == 0) { | |
82 | + comexit(0); | |
83 | + } | |
84 | + if (gettimeofday(&starttime, (struct timezone *)0) < 0) | |
85 | + errmsg("Cannot get start time\n"); | |
86 | + } | |
87 | + | |
88 | #ifdef XXX | |
89 | if ((*dp->cdr_check_session)() < 0) { | |
90 | comexit(EX_BAD); | |
91 | @@ -1230,38 +1264,6 @@ int main(int argc, char *argv[]) | |
92 | comexit(0); | |
93 | } | |
94 | } | |
95 | - if (flags & F_FORMAT) { | |
96 | - printf("wodim: media format asked\n"); | |
97 | - /* | |
98 | - * Do not abort if OPC failes. Just give it a chance | |
99 | - * for better laser power calibration than without OPC. | |
100 | - * | |
101 | - * Ricoh drives return with a vendor unique sense code. | |
102 | - * This is most likely because they refuse to do OPC | |
103 | - * on a non blank media. | |
104 | - */ | |
105 | - usalp->silent++; | |
106 | - do_opc(usalp, dp, flags); | |
107 | - usalp->silent--; | |
108 | - wait_unit_ready(usalp, 120); | |
109 | - if (gettimeofday(&starttime, (struct timezone *)0) < 0) | |
110 | - errmsg("Cannot get start time\n"); | |
111 | - | |
112 | - if ((*dp->cdr_format)(usalp, dp, formattype) < 0) { | |
113 | - errmsgno(EX_BAD, "Cannot format disk, aborting.\n"); | |
114 | - comexit(EX_BAD); | |
115 | - } | |
116 | - if (gettimeofday(&fixtime, (struct timezone *)0) < 0) | |
117 | - errmsg("Cannot get format time\n"); | |
118 | - if (lverbose) | |
119 | - prtimediff("Formatting time: ", &starttime, &fixtime); | |
120 | - | |
121 | - if (!wait_unit_ready(usalp, 240) || tracks == 0) { | |
122 | - comexit(0); | |
123 | - } | |
124 | - if (gettimeofday(&starttime, (struct timezone *)0) < 0) | |
125 | - errmsg("Cannot get start time\n"); | |
126 | - } | |
127 | /* | |
128 | * Reset start time so we will not see blanking time and | |
129 | * writing time counted together. |