Source: libburn
Version: 1.2.2-1
Severity: normal
Tags: upstream patch

CD SAO sessions with data tracks started by an audio pause.
This affects an old Sony CD burner which refuses to burn SAO.

Upstream fix: http://libburnia-project.org/changeset/4744

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-3-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
--- libburn-1.2.2.orig/doc/cookbook.txt
+++ libburn-1.2.2/doc/cookbook.txt
@@ -296,8 +296,9 @@ A pre-gap of 2 seconds is mandatory only
 post-gap may be needed with further tracks if they have neighbors with
 different DATA FORM values. (Such mixing is not yet supported by libburn.)
 
-DATA FORM is 00h for audio payload, 01h for audio pause, 10h for data,
-41h for CD-TEXT in Lead-in. 
+DATA FORM is 00h for audio payload, 01h for audio pause (Lead-in and Lead-out),
+10h for data, 14h for data pause (Lead-in and Lead-out).
+This shall be ored with 40h for CD-TEXT in Lead-in. 
 (mmc5r03c.pdf 6.33.3.11 CD-DA Data Form, 6.33.3.12 CD-ROM mode 1 Form)
 
 SCMS value 80h in conjunction with bit5 of CTL is an indicator for exhausted
@@ -318,7 +319,8 @@ The next entry (eventually being the fir
 Its content is 
 (CTL|ADR ,00h,00h, DATA FORM ,00h,00h,00h,00h)
 With the CTL|ADR for the first track: 41h for data, 01h for audio.
-DATA FORM is 41h if CD-TEXT shall be stored in Lean-in. Else it is 01h.
+DATA FORM is pause (audio=01h, data=14h). Ored with 40h if CD-TEXT shall
+be stored in Lean-in.
 
 The LBA for the first write is negative: -150. This corresponds to MSF address
 00h:00h:00h. All addresses are to be given in MSF format.
@@ -354,8 +356,9 @@ A track must at least contain 300 payloa
 (mmc5r03c.pdf 6.33.3.6)
 
 At the end of the session there is a lead-out entry
-(CTL|ADR,AAh,01h,01h,00h,MIN,SEC,FRAME)
+(CTL|ADR,AAh,01h,DATA FORM,00h,MIN,SEC,FRAME)
 marking the end of the last track. (With libburn CTL is as of the last track.)
+DATA FORM is 01h for audio, 14h for data.
 
 
 -------------------------------------------------------------------------------
--- libburn-1.2.2.orig/libburn/write.c
+++ libburn-1.2.2/libburn/write.c
@@ -508,11 +508,13 @@ struct cue_sheet *burn_create_toc_entrie
 			"Track mode has unusable value", 0, 0);
 		goto failed;
 	}
+	if (tar[0]->mode & BURN_AUDIO)
+		leadin_form = 0x01;
+	else
+		leadin_form = 0x14;
 	if (o->num_text_packs > 0) {
-		leadin_form = 0x41;
+		leadin_form |= 0x40;
 	} else {
-		leadin_form = 0x01;
-
 		/* Check for CD-TEXT in session. Not the final creation,
 		   because the cue sheet content might be needed for CD-TEXT
 		   pack type 0x88 "TOC".
@@ -522,7 +524,7 @@ struct cue_sheet *burn_create_toc_entrie
 			if (ret < 0)
 				goto failed;
 			else if (ret > 0)
-				leadin_form = 0x41;
+				leadin_form |= 0x40;
 		}
 	}
 
@@ -803,7 +805,9 @@ XXX this is untested :)
 	e[2].pmin = m;
 	e[2].psec = s;
 	e[2].pframe = f;
-	ret = add_cue(sheet, ctladr | 1, 0xAA, 1, 1, 0, runtime);
+
+	ret = add_cue(sheet, ctladr | 1, 0xAA, 1, leadin_form & 0x3f,
+                      0, runtime);
 	if (ret <= 0)
 		goto failed;
 	return sheet;
--- libburn-1.2.2.orig/libburn/mmc.c
+++ libburn-1.2.2/libburn/mmc.c
@@ -908,6 +908,12 @@ int mmc_write(struct burn_drive *d, int
 	extern int burn_sg_log_scsi;
 #endif
 
+/*
+fprintf(stderr, "libburn_DEBUG: buffer sectors= %d  bytes= %d\n",
+        buf->sectors, buf->bytes);
+*/
+
+
 	c = &(d->casual_command);
 
 #ifdef Libburn_log_in_and_out_streaM

Reply via email to