Commit 3025af00 authored by GitLab CI's avatar GitLab CI

Merge remote-tracking branch 'upstream/master' into master-build

* upstream/master:
  LinGui: plug memory leaks
  hb_json: fix title dict format string
  fix initialization of libswscale stride data
  dvdnav: fix double free on close
  contrib: Add small patch fix to libdvdnav.
  contrib: Add small patch fix to libdvdread.
parents 5e239540 ea9dc517
From 320b88d3489a8dc03c88252fededd8db1bb7964e Mon Sep 17 00:00:00 2001
From: John Sullivan <jsgthb@kanargh.org.uk>
Date: Fri, 9 Aug 2019 13:33:49 +0100
Subject: [PATCH] Avoid division-by-zero when tmap search returns two tmap
entries with the same vobu_idx (which can happen at the end of a title).
---
src/searching.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/searching.c b/src/searching.c
index f638b613..6e6b78b2 100644
--- a/src/searching.c
+++ b/src/searching.c
@@ -1094,8 +1094,14 @@ static int32_t dvdnav_tmap_calc_time_for_tmap_entry(dvdnav_jump_args_t *args,
}
/* calc position of cell relative to lo */
- vobu_pct = ((pos->vobu_idx - lo->vobu_idx) * 1000)
- / ( hi->vobu_idx - lo->vobu_idx);
+ if (hi->vobu_idx == lo->vobu_idx) {
+ /* We are at the very end - pos should also equal lo so force that
+ * rather than hit the divide-by-zero. */
+ vobu_pct = 0;
+ } else {
+ vobu_pct = ((pos->vobu_idx - lo->vobu_idx) * 1000)
+ / ( hi->vobu_idx - lo->vobu_idx);
+ }
if (vobu_pct < 0 || vobu_pct > 1000) {
fprintf(MSG_OUT, "vobu_pct must be between 0 and 1000");
return 0;
--
2.21.0
From f95662fca27e7e2940c22110335654db46bf9c39 Mon Sep 17 00:00:00 2001
From: John Sullivan <jsgthb@kanargh.org.uk>
Date: Fri, 9 Aug 2019 13:23:15 +0100
Subject: [PATCH] Swap pgc_t's still_time and pg_playback_mode which are
currently the wrong way round, which prevents some discs from playing.
---
src/dvdread/ifo_types.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/dvdread/ifo_types.h b/src/dvdread/ifo_types.h
index 22ece66..f679d29 100644
--- a/src/dvdread/ifo_types.h
+++ b/src/dvdread/ifo_types.h
@@ -294,8 +294,8 @@ typedef struct {
uint16_t next_pgc_nr;
uint16_t prev_pgc_nr;
uint16_t goup_pgc_nr;
- uint8_t still_time;
uint8_t pg_playback_mode;
+ uint8_t still_time;
uint32_t palette[16]; /* New type struct {zero_1, Y, Cr, Cb} ? */
uint16_t command_tbl_offset;
uint16_t program_map_offset;
--
2.21.0
......@@ -153,7 +153,7 @@ ghb_adjust_audio_rate_combos(signal_user_data_t *ud, GhbValue *asettings)
ghb_ui_update(ud, "AudioBitrate",
ghb_dict_get_value(asettings, "Bitrate"));
gdouble quality = get_ui_quality(asettings);
ghb_ui_update(ud, "AudioTrackQualityX", ghb_double_value_new(quality));
ghb_ui_update(ud, "AudioTrackQualityX", ghb_double_value(quality));
ghb_ui_update(ud, "AudioSamplerate",
ghb_dict_get_value(asettings, "Samplerate"));
ghb_ui_update(ud, "AudioMixdown",
......@@ -400,7 +400,7 @@ void ghb_sanitize_audio_tracks(signal_user_data_t *ud)
ghb_ui_update(ud, "AudioBitrate",
ghb_dict_get_value(asettings, "Bitrate"));
gdouble quality = get_ui_quality(asettings);
ghb_ui_update(ud, "AudioTrackQualityX", ghb_double_value_new(quality));
ghb_ui_update(ud, "AudioTrackQualityX", ghb_double_value(quality));
ghb_ui_update(ud, "AudioSamplerate",
ghb_dict_get_value(asettings, "Samplerate"));
ghb_ui_update(ud, "AudioMixdown",
......@@ -464,6 +464,7 @@ audio_update_dialog_widgets(signal_user_data_t *ud, GhbValue *asettings)
drc = ghb_dict_get_double(asettings, "DRC");
s_drc = get_drc_string(drc);
ghb_ui_update(ud, "AudioTrackDRCValue", ghb_string_value(s_drc));
free(s_drc);
ghb_ui_update(ud, "AudioTrackGainSlider",
ghb_dict_get_value(asettings, "Gain"));
gain = ghb_dict_get_double(asettings, "Gain");
......@@ -473,9 +474,10 @@ audio_update_dialog_widgets(signal_user_data_t *ud, GhbValue *asettings)
int codec = ghb_settings_audio_encoder_codec(asettings, "Encoder");
quality = ghb_dict_get_double(asettings, "Quality");
qualityx = get_quality(codec, quality);
ghb_ui_update(ud, "AudioTrackQualityX", ghb_double_value_new(qualityx));
ghb_ui_update(ud, "AudioTrackQualityX", ghb_double_value(qualityx));
s_quality = get_quality_string(codec, quality);
ghb_ui_update(ud, "AudioTrackQualityValue", ghb_string_value(s_quality));
free(s_quality);
// Setting a radio button to FALSE does not automatically make
// the other one TRUE
qe = ghb_audio_quality_enabled(asettings);
......
......@@ -2459,6 +2459,7 @@ ghb_update_summary_info(signal_user_data_t *ud)
def = ghb_dict_get_bool(subsettings, "Default");
g_string_append_printf(str, "\n%s", desc);
free(desc);
if (force)
{
g_string_append_printf(str, ", Forced Only");
......@@ -4733,6 +4734,7 @@ when_complete_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
{
GhbValue * value = ghb_widget_value(widget);
ghb_ui_update(ud, "QueueWhenComplete", value);
ghb_value_free(&value);
ghb_widget_to_setting (ud->prefs, widget);
......@@ -4747,6 +4749,7 @@ queue_when_complete_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
{
GhbValue * value = ghb_widget_value(widget);
ghb_ui_update(ud, "WhenComplete", value);
ghb_value_free(&value);
}
G_MODULE_EXPORT void
......
......@@ -101,6 +101,7 @@ create_chapter_row(int index, int64_t start, int64_t duration,
str = g_strdup_printf("%d", index);
label = gtk_label_new(str);
free(str);
gtk_label_set_width_chars(GTK_LABEL(label), 5);
gtk_label_set_xalign(GTK_LABEL(label), 0);
ghb_box_append_child(hbox, label);
......@@ -108,6 +109,7 @@ create_chapter_row(int index, int64_t start, int64_t duration,
ghb_break_duration(start, &hh, &mm, &ss);
str = g_strdup_printf("%02d:%02d:%02d", hh, mm, ss);
label = gtk_label_new(str);
free(str);
gtk_label_set_width_chars(GTK_LABEL(label), 10);
gtk_label_set_xalign(GTK_LABEL(label), 1);
ghb_box_append_child(hbox, label);
......@@ -115,6 +117,7 @@ create_chapter_row(int index, int64_t start, int64_t duration,
ghb_break_duration(duration, &hh, &mm, &ss);
str = g_strdup_printf("%02d:%02d:%02d", hh, mm, ss);
label = gtk_label_new(str);
free(str);
gtk_label_set_width_chars(GTK_LABEL(label), 10);
gtk_label_set_xalign(GTK_LABEL(label), 1);
ghb_box_append_child(hbox, label);
......
......@@ -588,6 +588,7 @@ queue_update_summary(GhbValue * queueDict, signal_user_data_t *ud)
def = ghb_dict_get_bool(subsettings, "Default");
g_string_append_printf(str, "%s%s", sep, desc);
free(desc);
if (force)
{
g_string_append_printf(str, _(", Forced Only"));
......
......@@ -830,7 +830,7 @@ subtitle_forced_toggled_cb(GtkWidget *widget, signal_user_data_t *ud)
{
ghb_widget_to_setting(ud->settings, widget);
GhbValue *val = ghb_widget_value(widget);
subtitle_update_setting(ghb_value_dup(val), "Forced", ud);
subtitle_update_setting(val, "Forced", ud);
}
G_MODULE_EXPORT void
......@@ -841,7 +841,7 @@ subtitle_burned_toggled_cb(GtkWidget *widget, signal_user_data_t *ud)
ghb_widget_to_setting(ud->settings, widget);
GhbValue *val = ghb_widget_value(widget);
subtitle_update_setting(ghb_value_dup(val), "Burn", ud);
subtitle_update_setting(val, "Burn", ud);
subsettings = subtitle_get_selected_settings(ud, &index);
if (subsettings != NULL)
{
......@@ -862,7 +862,7 @@ subtitle_default_toggled_cb(GtkWidget *widget, signal_user_data_t *ud)
ghb_widget_to_setting(ud->settings, widget);
GhbValue *val = ghb_widget_value(widget);
subtitle_update_setting(ghb_value_dup(val), "Default", ud);
subtitle_update_setting(val, "Default", ud);
subsettings = subtitle_get_selected_settings(ud, &index);
if (subsettings != NULL)
{
......
......@@ -1868,11 +1868,11 @@ static void hb_dvdnav_close( hb_dvd_t ** _d )
if (d->dvdnav) dvdnav_close( d->dvdnav );
if (d->vmg) ifoClose( d->vmg );
TitleCloseIfo(d);
if (d->reader) DVDClose( d->reader );
free(d->path);
TitleCloseIfo(d);
free( d );
*_d = NULL;
......
......@@ -118,6 +118,8 @@ int hb_picture_fill(uint8_t *data[], int stride[], hb_buffer_t *buf)
for (ii = 0; ii <= buf->f.max_plane; ii++)
stride[ii] = buf->plane[ii].stride;
for (; ii < 4; ii++)
stride[ii] = stride[ii - 1];
ret = av_image_fill_pointers(data, buf->f.fmt,
buf->plane[0].height_stride,
......
......@@ -391,7 +391,7 @@ static hb_dict_t* hb_title_to_dict_internal( hb_title_t *title )
attributes = hb_audio_attributes_to_dict(audio->config.lang.attributes);
audio_dict = json_pack_ex(&error, 0,
"{s:o, s:o, s:o, s:o, s:o, s:o, s:o, s:o, s:o, s:o, s:o, s:o}",
"{s:o, s:o, s:o, s:o, s:o, s:o, s:o, s:o, s:o, s:o, s:o, s:o, s:o}",
"Description", hb_value_string(audio->config.lang.description),
"Language", hb_value_string(audio->config.lang.simple),
"LanguageCode", hb_value_string(audio->config.lang.iso639_2),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment