Enabled byte swapping for audio track sources, added anti option -swab

This commit is contained in:
2006-10-24 10:20:35 +00:00
parent d2d1883356
commit 03c2f0d21e
7 changed files with 66 additions and 14 deletions

View File

@ -849,6 +849,16 @@ int burn_session_remove_track(struct burn_session *s, struct burn_track *t);
void burn_track_define_data(struct burn_track *t, int offset, int tail,
int pad, int mode);
/* ts A61024 */
/** Define wether a track shall swap bytes of its input stream.
@param t The track to change
@param swap_source_bytes 0=do not swap, 1=swap byte pairs
@return 1=success , 0=unacceptable value
*/
int burn_track_set_byte_swap(struct burn_track *t, int swap_source_bytes);
/** Set the ISRC details for a track
@param t The track to change
@param country the 2 char country code. Each character must be

View File

@ -79,7 +79,7 @@ static int get_outmode(struct burn_write_opts *o)
static void get_bytes(struct burn_track *track, int count, unsigned char *data)
{
int valid, shortage, curr;
int valid, shortage, curr, i, tr;
/* no track pointer means we're just generating 0s */
if (!track) {
@ -147,9 +147,17 @@ static void get_bytes(struct burn_track *track, int count, unsigned char *data)
curr += valid;
}
}
if (!shortage)
return;
memset(data + curr, 0, shortage);
ex:;
/* ts A61024 : general finalizing processing */
if(shortage)
memset(data + curr, 0, shortage); /* this is old icculus.org */
if (track->swap_source_bytes == 1) {
for (i = 1; i < count; i += 2) {
tr = data[i];
data[i] = data[i-1];
data[i-1] = tr;
}
}
}
/* ts A61009 : seems to hand out sector start pointer in opts->drive->buffer

View File

@ -118,6 +118,9 @@ struct burn_track *burn_track_create(void)
t->postgap = 0;
t->pregap1 = 0;
t->pregap2 = 0;
/* ts A61024 */
t->swap_source_bytes = 0;
return t;
}
@ -227,6 +230,17 @@ void burn_track_define_data(struct burn_track *t, int offset, int tail,
t->tail = tail;
}
/* ts A61024 */
int burn_track_set_byte_swap(struct burn_track *t, int swap_source_bytes)
{
if(swap_source_bytes!=0 && swap_source_bytes!=1)
return 0;
t->swap_source_bytes = swap_source_bytes;
return 1;
}
void burn_track_set_isrc(struct burn_track *t, char *country, char *owner,
unsigned char year, unsigned int serial)
{

View File

@ -41,6 +41,10 @@ struct burn_track
/** The track contains a postgap */
int postgap;
struct isrc isrc;
/* ts A61024 */
/** Byte swapping on source data stream : 0=none , 1=pairwise */
int swap_source_bytes;
};
struct burn_session