MCPcopy Create free account
hub / github.com/HandBrake/HandBrake / ghb_create_volume_label

Function ghb_create_volume_label

gtk/src/hb-backend.c:2396–2439  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2394}
2395
2396gchar*
2397ghb_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
2441gchar*
2442ghb_create_title_label(const hb_title_t *title)

Callers 1

ghb_set_title_settingsFunction · 0.85

Calls 4

get_file_labelFunction · 0.85
ghb_dvd_sanitize_volnameFunction · 0.85
uppers_and_undersFunction · 0.70
camel_convertFunction · 0.70

Tested by

no test coverage detected