| 2394 | } |
| 2395 | |
| 2396 | gchar* |
| 2397 | ghb_create_volume_label(const hb_title_t * title) |
| 2398 | { |
| 2399 | char * volname = NULL; |
| 2400 | |
| 2401 | if (title != NULL && title->name != NULL && title->name[0] != 0) |
| 2402 | { |
| 2403 | GStatBuf stat_buf; |
| 2404 | |
| 2405 | if (g_stat(title->path, &stat_buf) == 0) |
| 2406 | { |
| 2407 | if (!S_ISBLK(stat_buf.st_mode)) |
| 2408 | { |
| 2409 | volname = get_file_label(title->path); |
| 2410 | } |
| 2411 | else |
| 2412 | { |
| 2413 | // DVD and BD volume labels are often all upper case |
| 2414 | volname = strdup(title->name); |
| 2415 | if (title->type == HB_DVD_TYPE) |
| 2416 | { |
| 2417 | ghb_dvd_sanitize_volname(volname); |
| 2418 | } |
| 2419 | if (uppers_and_unders(volname)) |
| 2420 | { |
| 2421 | camel_convert(volname); |
| 2422 | } |
| 2423 | } |
| 2424 | } |
| 2425 | if (volname == NULL) |
| 2426 | { |
| 2427 | volname = strdup(title->name); |
| 2428 | if (title->type == HB_DVD_TYPE) |
| 2429 | { |
| 2430 | ghb_dvd_sanitize_volname(volname); |
| 2431 | } |
| 2432 | } |
| 2433 | } |
| 2434 | else |
| 2435 | { |
| 2436 | volname = g_strdup(_("No Title Found")); |
| 2437 | } |
| 2438 | return volname; |
| 2439 | } |
| 2440 | |
| 2441 | gchar* |
| 2442 | ghb_create_title_label(const hb_title_t *title) |
no test coverage detected