summaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2017-06-02 08:51:21 -0700
committerBradley Sepos <[email protected]>2017-06-13 17:22:11 -0400
commit16cc03076330b23a0e8744ea125db61a5a2bd2e8 (patch)
tree9f3f38746c96dc2d70395f7b02e56aa60ae5d9b0 /gtk
parente018cdea0566e22edf72de4b82a6634c791a90bc (diff)
sync: work-around players with broken edit list support
This adds a preset key AlignAVStart that enables this work-around. When enabled, blank frames are inserted or frames are dropped to force alignment of the initial timestamp of every audio and video stream. Aligning the start times minimizes the impact of broken edit list support in players. Closes #763. Squashed: sync: improve alignment when passthru audio is present presets: enable AlignAVStart for General and Gmail presets LinGui: Improve AlignAVStart tooltip sync: avoid inserting a black frame < nominal frame duration sync: fix start alignment when doing p-to-p encoding sync: add comments
Diffstat (limited to 'gtk')
-rw-r--r--gtk/src/callbacks.c14
-rw-r--r--gtk/src/ghb.m429
2 files changed, 36 insertions, 7 deletions
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c
index c195a2584..5f7c04b8e 100644
--- a/gtk/src/callbacks.c
+++ b/gtk/src/callbacks.c
@@ -1014,7 +1014,8 @@ update_title_duration(signal_user_data_t *ud)
void ghb_show_container_options(signal_user_data_t *ud)
{
- GtkWidget *w2, *w3;
+ GtkWidget *w1, *w2, *w3;
+ w1 = GHB_WIDGET(ud->builder, "AlignAVStart");
w2 = GHB_WIDGET(ud->builder, "Mp4HttpOptimize");
w3 = GHB_WIDGET(ud->builder, "Mp4iPodCompatible");
@@ -1026,6 +1027,7 @@ void ghb_show_container_options(signal_user_data_t *ud)
gint enc = ghb_settings_video_encoder_codec(ud->settings, "VideoEncoder");
+ gtk_widget_set_visible(w1, (mux->format & HB_MUX_MASK_MP4));
gtk_widget_set_visible(w2, (mux->format & HB_MUX_MASK_MP4));
gtk_widget_set_visible(w3, (mux->format & HB_MUX_MASK_MP4) &&
(enc == HB_VCODEC_X264_8BIT));
@@ -1648,9 +1650,15 @@ container_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
{
g_debug("container_changed_cb ()");
ghb_widget_to_setting(ud->settings, widget);
- const char * mux = ghb_dict_get_string(ud->settings, "FileFormat");
+ const char * mux_id = ghb_dict_get_string(ud->settings, "FileFormat");
GhbValue *dest_dict = ghb_get_job_dest_settings(ud->settings);
- ghb_dict_set_string(dest_dict, "Mux", mux);
+ ghb_dict_set_string(dest_dict, "Mux", mux_id);
+
+ const hb_container_t *mux = ghb_lookup_container_by_name(mux_id);
+ if (!(mux->format & HB_MUX_MASK_MP4))
+ {
+ ghb_ui_update(ud, "AlignAVStart", ghb_boolean_value(FALSE));
+ }
ghb_check_dependency(ud, widget, NULL);
ghb_show_container_options(ud);
diff --git a/gtk/src/ghb.m4 b/gtk/src/ghb.m4
index 736ce9e1b..73577af35 100644
--- a/gtk/src/ghb.m4
+++ b/gtk/src/ghb.m4
@@ -1498,19 +1498,21 @@ This is often the feature title of a DVD.</property>
</packing>
</child>
<child>
- <object class="GtkCheckButton" id="Mp4iPodCompatible">
- <property name="label" translatable="yes">iPod 5G Support</property>
+ <object class="GtkCheckButton" id="AlignAVStart">
+ <property name="label" translatable="yes">Align A/V Start</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
- <property name="tooltip_text" translatable="yes">Add iPod Atom needed by some older iPods.</property>
+ <property name="tooltip_text" translatable="yes">Aligns the initial timestamps of all audio and video streams by
+inserting blank frames or dropping frames. May improve audio/video
+sync for broken players that do not honor MP4 edit lists.</property>
<property name="halign">start</property>
<property name="draw_indicator">True</property>
<signal name="toggled" handler="setting_widget_changed_cb" swapped="no"/>
</object>
<packing>
- <property name="top_attach">1</property>
+ <property name="top_attach">0</property>
<property name="left_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
@@ -1536,6 +1538,25 @@ This allows a player to initiate playback before downloading the entire file.</p
<property name="height">1</property>
</packing>
</child>
+ <child>
+ <object class="GtkCheckButton" id="Mp4iPodCompatible">
+ <property name="label" translatable="yes">iPod 5G Support</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="tooltip_text" translatable="yes">Add iPod Atom needed by some older iPods.</property>
+ <property name="halign">start</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="setting_widget_changed_cb" swapped="no"/>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="left_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">False</property>