comparison libmpdemux/demux_mkv.c @ 25304:fb719ee583b5

Move temp variable declaration into inner loop scope.
author ulion
date Mon, 10 Dec 2007 04:37:26 +0000
parents 23894348d1e5
children 7957b8762195
comparison
equal deleted inserted replaced
25303:9139c368a493 25304:fb719ee583b5
304 } 304 }
305 305
306 static int 306 static int
307 vobsub_parse_palette (sh_sub_t *sh, const char *start) 307 vobsub_parse_palette (sh_sub_t *sh, const char *start)
308 { 308 {
309 int i, tmp; 309 int i;
310 310
311 start += 8; 311 start += 8;
312 while (isspace(*start)) 312 while (isspace(*start))
313 start++; 313 start++;
314 for (i = 0; i < 16; i++) 314 for (i = 0; i < 16; i++)
315 { 315 {
316 unsigned int tmp;
316 if (sscanf(start, "%06x", &tmp) != 1) 317 if (sscanf(start, "%06x", &tmp) != 1)
317 break; 318 break;
318 sh->palette[i] = vobsub_palette_to_yuv(tmp); 319 sh->palette[i] = vobsub_palette_to_yuv(tmp);
319 start += 6; 320 start += 6;
320 while ((*start == ',') || isspace(*start)) 321 while ((*start == ',') || isspace(*start))
354 use_custom_colors = 0; 355 use_custom_colors = 0;
355 mp_msg(MSGT_DEMUX, MSGL_V, "[mkv] VobSub custom colors: %s\n", 356 mp_msg(MSGT_DEMUX, MSGL_V, "[mkv] VobSub custom colors: %s\n",
356 use_custom_colors ? "ON" : "OFF"); 357 use_custom_colors ? "ON" : "OFF");
357 if ((start = strstr(start, "colors:")) != NULL) 358 if ((start = strstr(start, "colors:")) != NULL)
358 { 359 {
359 unsigned int tmp;
360 start += 7; 360 start += 7;
361 while (isspace(*start)) 361 while (isspace(*start))
362 start++; 362 start++;
363 for (i = 0; i < 4; i++) 363 for (i = 0; i < 4; i++)
364 { 364 {
365 unsigned int tmp;
365 if (sscanf(start, "%06x", &tmp) != 1) 366 if (sscanf(start, "%06x", &tmp) != 1)
366 break; 367 break;
367 sh->colors[i] = vobsub_rgb_to_yuv(tmp); 368 sh->colors[i] = vobsub_rgb_to_yuv(tmp);
368 start += 6; 369 start += 6;
369 while ((*start == ',') || isspace(*start)) 370 while ((*start == ',') || isspace(*start))