Made recognition of CD media codes work in burn_guess_manufacturer()

This commit is contained in:
Thomas Schmitt 2009-09-06 09:22:26 +00:00
parent 1ef3a24885
commit 75dca6c6e9
2 changed files with 20 additions and 15 deletions

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2009.09.05.165257"
#define Cdrskin_timestamP "2009.09.06.092330"

View File

@ -225,10 +225,10 @@ char *burn_guess_manufacturer(int prf,
if (media_code2 != NULL &&
(prf == -1 || prf == 0x09 || prf == 0x0A)) {
if (strlen(media_code2) == 9 && media_code2[0] == '9' &&
media_code2[2] == 'm' && media_code2[5] == 's' &&
media_code2[8] == 'f' &&
strchr(media_code2, '%') == NULL) {
if (strlen(media_code2) == 9 && media_code1[0] == '9' &&
media_code1[2] == 'm' && media_code1[5] == 's' &&
media_code1[8] == 'f' &&
strchr(media_code1, '%') == NULL) {
sscanf(media_code1, "%dm%ds%df", &m_li, &s_li, &f_li);
sscanf(media_code2, "%dm%ds%df", &m_lo, &s_lo, &f_lo);
if (m_li >= 96 && m_li <= 97 && m_lo > 0) {
@ -267,19 +267,23 @@ char *burn_guess_manufacturer(int prf,
/* ts A90905 */
/* Make *text a single printable word */
/* IMPORTANT: text must be freeable memory !
@param flag bit0=escape '/' too
bit1=(overrides bit0) do not escape " _/"
*/
int burn_util_make_printable_word(char **text, int flag)
{
int i, esc_add = 0, ret;
char *wpt, *rpt, *new_text = NULL;
/* Make *text a single printable word */
if (flag & 2)
flag &= ~1;
for (i = 0; (*text)[i]; i++) {
rpt = (*text) + i;
if (*rpt < 32 || *rpt > 126 || *rpt == '_' ||
*rpt == 96 || *rpt == '%' ||
if (*rpt < 32 || *rpt > 126 || *rpt == 96 ||
((*rpt == '_' || *rpt == '%') && (!(flag & 2))) ||
(*rpt == '/' && (flag & 1)))
esc_add += 2;
}
@ -292,8 +296,8 @@ int burn_util_make_printable_word(char **text, int flag)
wpt = new_text;
for (i = 0; (*text)[i]; i++) {
rpt = (*text) + i;
if (*rpt < 32 || *rpt > 126 || *rpt == '_' ||
*rpt == 96 || *rpt == '%' ||
if (*rpt < 32 || *rpt > 126 || *rpt == 96 ||
((*rpt == '_' || *rpt == '%') && (!(flag & 2))) ||
(*rpt == '/' && (flag & 1))) {
sprintf(wpt, "%%%2.2X",
(unsigned int) *((unsigned char *) rpt));
@ -305,6 +309,7 @@ int burn_util_make_printable_word(char **text, int flag)
free(*text);
*text = new_text;
}
if (!(flag & 2))
for (i = 0; (*text)[i]; i++)
if ((*text)[i] == ' ')
(*text)[i] = '_';