* hb-backend.c
*
* Fri Mar 28 10:38:44 2008
- * Copyright 2008 John Stebbins
+ * Copyright 2008-2011 John Stebbins
* <john at stebbins dot name>
****************************************************************************/
static options_map_t d_weightp_opts[] =
{
- {"Off", "0", 0, "0"},
- {"Blind", "1", 1, "1"},
- {"Smart", "2", 2, "2"},
+ {"Off", "0", 0, "0"},
+ {"Simple", "1", 1, "1"},
+ {"Smart", "2", 2, "2"},
};
combo_opts_t weightp_opts =
{
{
if (title->duration != 0)
{
- titles[ii] = g_strdup_printf ("%d - %02dh%02dm%02ds - %s",
+ char *tmp;
+ tmp = g_strdup_printf ("%d - %02dh%02dm%02ds - %s",
title->index, title->hours, title->minutes, title->seconds,
title->name);
+ titles[ii] = g_markup_escape_text(tmp, -1);
+ g_free(tmp);
}
else
{
- titles[ii] = g_strdup_printf ("%d - %s",
+ char *tmp;
+ tmp = g_strdup_printf ("%d - %s",
title->index, title->name);
+ titles[ii] = g_markup_escape_text(tmp, -1);
+ g_free(tmp);
}
}
else
}
}
-gint
-ghb_calculate_target_bitrate(GValue *settings, gint titleindex)
-{
- hb_list_t * list;
- hb_title_t * title;
- hb_job_t * job;
- gint size;
-
- if (h_scan == NULL) return 1500;
- list = hb_get_titles( h_scan );
- title = hb_list_item( list, titleindex );
- if (title == NULL) return 1500;
- job = title->job;
- if (job == NULL) return 1500;
- size = ghb_settings_get_int(settings, "VideoTargetSize");
- return hb_calc_bitrate( job, size );
-}
-
gboolean
ghb_validate_filter_string(const gchar *str, gint max_fields)
{
max = 62;
} break;
}
- if (vquality < min || vquality > max)
+ if (vcodec == HB_VCODEC_X264 && vquality == 0.0)
{
message = g_strdup_printf(
- "Interesting video quality choise: %d\n\n"
- "Typical values range from %d to %d.\n"
+ "Warning: lossless h.264 selected\n\n"
+ "Lossless h.264 is not well supported by\n"
+ "many players and editors.\n\n"
+ "It will produce enormous output files.\n\n"
+ "Are you sure you wish to use this setting?",
+ (gint)vquality, min, max);
+ if (!ghb_message_dialog(GTK_MESSAGE_QUESTION, message,
+ "Cancel", "Continue"))
+ {
+ g_free(message);
+ return FALSE;
+ }
+ g_free(message);
+ }
+ else if (vquality < min || vquality > max)
+ {
+ message = g_strdup_printf(
+ "Interesting video quality choice: %d\n\n"
+ "Typical values range from %d to %d.\n\n"
"Are you sure you wish to use this setting?",
(gint)vquality, min, max);
if (!ghb_message_dialog(GTK_MESSAGE_QUESTION, message,
gint start, end;
gint num_chapters = hb_list_count(title->list_chapter);
gint duration = title->duration / 90000;
+ job->chapter_markers = FALSE;
job->chapter_start = 1;
job->chapter_end = num_chapters;
}
if (ghb_settings_combo_int(js, "PtoPType") == 1)
{
- job->chapter_start = 1;
- job->chapter_end = num_chapters;
start = ghb_settings_get_int(js, "start_point");
end = ghb_settings_get_int(js, "end_point");
job->pts_to_start = (int64_t)MIN(duration-1, start) * 90000;
}
if (ghb_settings_combo_int(js, "PtoPType") == 2)
{
- job->chapter_start = 1;
- job->chapter_end = num_chapters;
start = ghb_settings_get_int(js, "start_point");
end = ghb_settings_get_int(js, "end_point");
gint64 max_frames;
job->frame_to_stop = (int64_t)MAX(start, end-1) -
job->frame_to_start;
}
- job->chapter_markers = ghb_settings_get_boolean(js, "ChapterMarkers");
+ if (job->chapter_start != job->chapter_end)
+ {
+ job->chapter_markers = ghb_settings_get_boolean(js, "ChapterMarkers");
+ }
if (job->chapter_start == job->chapter_end)
job->chapter_markers = 0;
if ( job->chapter_markers )
{
job->vrate = title->rate;
job->vrate_base = title->rate_base;
- job->cfr = 0;
}
else
{
job->vrate = 27000000;
job->vrate_base = vrate;
- gboolean pfr = ghb_settings_get_boolean(js, "VideoFrameratePFR");
- if (pfr)
- job->cfr = 2;
- else
- job->cfr = 1;
}
+ if (ghb_settings_get_boolean(js, "VideoFrameratePFR"))
+ job->cfr = 2;
+ else if (ghb_settings_get_boolean(js, "VideoFramerateCFR"))
+ job->cfr = 1;
+ else
+ job->cfr = 0;
const GValue *audio_list;
gint count, ii;
hb_audio_add( job, &audio );
tcount++;
}
- // I was tempted to move this up with the reset of the video quality
- // settings, but I suspect the settings above need to be made
- // first in order for hb_calc_bitrate to be accurate.
- if (ghb_settings_get_boolean(js, "vquality_type_target"))
- {
- gint size;
-
- size = ghb_settings_get_int(js, "VideoTargetSize");
- job->vbitrate = hb_calc_bitrate( job, size );
- job->vquality = -1.0;
- }
dest_str = ghb_settings_get_string(js, "destination");
job->file = dest_str;