Works similar to audio track names.
If source has a subtitle track name, hb_subtitle_t.name is set.
To set output subtitle track name, set hb_subtitle_config_t.name.
Source track names are available in title returned by hb_title_to_dict
and hb_title_to_json in SubtitleList[].Name
In job dict it is also SubtitleList[].Name
hb_preset_job_init and hb_preset_job_init_json initialize output tracks
with the source track name.
Also adds subtitle name support to LinGui
</action-widgets>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-subtitle-vbox">
+ <property name="orientation">vertical</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
</packing>
</child>
</object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid" id="subtitle_track_grid">
+ <property name="row-spacing">2</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="column_spacing">5</property>
+ <property name="halign">center</property>
+ <child>
+ <object class="GtkLabel" id="subtitle_track_label">
+ <property name="visible">True</property>
+ <property name="can_focus">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="label" translatable="yes">Source Track</property>
+ </object>
+ <packing>
+ <property name="top_attach">0</property>
+ <property name="left_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="SubtitleTrack">
+ <property name="valign">GTK_ALIGN_CENTER</property>
+ <property name="visible">True</property>
+ <property name="can_focus">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">List of subtitle tracks available from your source.</property>
+ <signal name="changed" handler="subtitle_track_changed_cb" swapped="no"/>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="left_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="subtitle_name_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Track Name:</property>
+ <property name="use_markup">True</property>
+ <property name="halign">center</property>
+ </object>
+ <packing>
+ <property name="top_attach">0</property>
+ <property name="left_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="SubtitleTrackName">
+ <property name="visible">True</property>
+ <property name="can_focus">True</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">Set the subtitle track name.
+
+Players may use this in the subtitle selection list.</property>
+ <property name="max_length">80</property>
+ <property name="width-chars">40</property>
+ <property name="activates_default">True</property>
+ <property name="truncate_multiline">True</property>
+ <signal name="changed" handler="subtitle_name_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="position">1</property>
</packing>
</child>
<child>
- <object class="GtkBox" id="subtitle_settings_box">
- <property name="orientation">horizontal</property>
+ <object class="GtkGrid" id="subtitle_import_grid">
<property name="visible">True</property>
+ <property name="row-spacing">2</property>
<property name="can_focus">False</property>
- <property name="spacing">6</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="column_spacing">4</property>
<child>
- <object class="GtkGrid" id="subtitle_import_grid">
+ <object class="GtkLabel" id="import_lang_label">
<property name="visible">True</property>
- <property name="row-spacing">2</property>
<property name="can_focus">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="column_spacing">4</property>
- <child>
- <object class="GtkLabel" id="import_lang_label">
- <property name="visible">True</property>
- <property name="can_focus">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="label" translatable="yes">Language</property>
- </object>
- <packing>
- <property name="top_attach">0</property>
- <property name="left_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="srt_code_label">
- <property name="visible">True</property>
- <property name="can_focus">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="label" translatable="yes">Character Code</property>
- </object>
- <packing>
- <property name="top_attach">0</property>
- <property name="left_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="import_file_label">
- <property name="visible">True</property>
- <property name="can_focus">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="label" translatable="yes">File:</property>
- <property name="halign">end</property>
- </object>
- <packing>
- <property name="top_attach">2</property>
- <property name="left_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="import_offset_label">
- <property name="visible">True</property>
- <property name="can_focus">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="label" translatable="yes">Offset (ms)</property>
- </object>
- <packing>
- <property name="top_attach">0</property>
- <property name="left_attach">4</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBox" id="ImportLanguage">
- <property name="valign">GTK_ALIGN_CENTER</property>
- <property name="visible">True</property>
- <property name="can_focus">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">Set the language of this subtitle.
+ <property name="label" translatable="yes">Language</property>
+ </object>
+ <packing>
+ <property name="top_attach">0</property>
+ <property name="left_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="srt_code_label">
+ <property name="visible">True</property>
+ <property name="can_focus">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="label" translatable="yes">Character Code</property>
+ </object>
+ <packing>
+ <property name="top_attach">0</property>
+ <property name="left_attach">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="import_file_label">
+ <property name="visible">True</property>
+ <property name="can_focus">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="label" translatable="yes">File:</property>
+ <property name="halign">end</property>
+ </object>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="left_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="import_offset_label">
+ <property name="visible">True</property>
+ <property name="can_focus">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="label" translatable="yes">Offset (ms)</property>
+ </object>
+ <packing>
+ <property name="top_attach">0</property>
+ <property name="left_attach">4</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="ImportLanguage">
+ <property name="valign">GTK_ALIGN_CENTER</property>
+ <property name="visible">True</property>
+ <property name="can_focus">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">Set the language of this subtitle.
This value will be used by players in subtitle menus.</property>
- <signal name="changed" handler="import_lang_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>
- <child>
- <object class="GtkComboBox" id="SrtCodeset">
- <property name="valign">GTK_ALIGN_FILL</property>
- <property name="width_request">150</property>
- <property name="visible">True</property>
- <property name="can_focus">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">Set the character code used by the SRT file you are importing.
+ <signal name="changed" handler="import_lang_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>
+ <child>
+ <object class="GtkComboBox" id="SrtCodeset">
+ <property name="valign">GTK_ALIGN_FILL</property>
+ <property name="width_request">150</property>
+ <property name="visible">True</property>
+ <property name="can_focus">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">Set the character code used by the SRT file you are importing.
SRTs come in all flavours of character sets.
We translate the character set to UTF-8.
The source's character code is needed in order to perform this translation.</property>
- <signal name="changed" handler="srt_codeset_changed_cb" swapped="no"/>
- <property name="has_entry">True</property>
- <child internal-child="entry">
- <object class="GtkEntry" id="combobox-entry1">
- <property name="can_focus">True</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="top_attach">1</property>
- <property name="left_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkFileChooserButton" id="ImportFile">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip_text" translatable="yes">Select the SRT file to import.</property>
- <property name="local_only">False</property>
- <property name="hexpand">True</property>
- <property name="title" translatable="yes">Import File</property>
- <signal name="selection-changed" handler="import_file_changed_cb" swapped="no"/>
- </object>
- <packing>
- <property name="top_attach">2</property>
- <property name="left_attach">1</property>
- <property name="width">2</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkSpinButton" id="ImportOffset">
- <property name="valign">GTK_ALIGN_FILL</property>
- <property name="vexpand">False</property>
- <property name="width-chars">8</property>
- <property name="visible">True</property>
+ <signal name="changed" handler="srt_codeset_changed_cb" swapped="no"/>
+ <property name="has_entry">True</property>
+ <child internal-child="entry">
+ <object class="GtkEntry" id="combobox-entry1">
<property name="can_focus">True</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">Adjust the offset in milliseconds between video and SRT timestamps</property>
- <property name="adjustment">adjustment31</property>
- <signal name="value-changed" handler="import_offset_changed_cb" swapped="no"/>
</object>
- <packing>
- <property name="top_attach">1</property>
- <property name="left_attach">4</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
</child>
</object>
<packing>
- <property name="position">0</property>
+ <property name="top_attach">1</property>
+ <property name="left_attach">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
- <object class="GtkBox" id="subtitle_track_box">
- <property name="orientation">vertical</property>
+ <object class="GtkFileChooserButton" id="ImportFile">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkLabel" id="subtitle_track_label">
- <property name="visible">True</property>
- <property name="can_focus">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="label" translatable="yes">Track</property>
- </object>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBox" id="SubtitleTrack">
- <property name="valign">GTK_ALIGN_CENTER</property>
- <property name="visible">True</property>
- <property name="can_focus">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">List of subtitle tracks available from your source.</property>
- <signal name="changed" handler="subtitle_track_changed_cb" swapped="no"/>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
+ <property name="can_focus">True</property>
+ <property name="tooltip_text" translatable="yes">Select the SRT file to import.</property>
+ <property name="local_only">False</property>
+ <property name="hexpand">True</property>
+ <property name="title" translatable="yes">Import File</property>
+ <signal name="selection-changed" handler="import_file_changed_cb" swapped="no"/>
</object>
<packing>
- <property name="position">1</property>
+ <property name="top_attach">2</property>
+ <property name="left_attach">1</property>
+ <property name="width">2</property>
+ <property name="height">1</property>
</packing>
</child>
<child>
- <object class="GtkBox" id="subtitle_options_box">
- <property name="orientation">vertical</property>
+ <object class="GtkSpinButton" id="ImportOffset">
+ <property name="valign">GTK_ALIGN_FILL</property>
+ <property name="vexpand">False</property>
+ <property name="width-chars">8</property>
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkCheckButton" id="SubtitleForced">
- <property name="label" translatable="yes">Forced Subtitles Only</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">Use only subtitles that have been flagged
+ <property name="can_focus">True</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">Adjust the offset in milliseconds between video and SRT timestamps</property>
+ <property name="adjustment">adjustment31</property>
+ <signal name="value-changed" handler="import_offset_changed_cb" swapped="no"/>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="left_attach">4</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="subtitle_options_box">
+ <property name="orientation">vertical</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_top">12</property>
+ <child>
+ <object class="GtkCheckButton" id="SubtitleForced">
+ <property name="label" translatable="yes">Forced Subtitles Only</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">Use only subtitles that have been flagged
as forced in the source subtitle track
"Forced" subtitles are usually used to show
subtitles during scenes where someone is speaking
a foreign language.</property>
- <property name="halign">start</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled" handler="subtitle_forced_toggled_cb" swapped="no"/>
- </object>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="SubtitleBurned">
- <property name="label" translatable="yes">Burn into video</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">Render the subtitle over the video.
+ <property name="halign">start</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="subtitle_forced_toggled_cb" swapped="no"/>
+ </object>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="SubtitleBurned">
+ <property name="label" translatable="yes">Burn into video</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">Render the subtitle over the video.
The subtitle will be part of the video and can not be disabled.</property>
- <property name="halign">start</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled" handler="subtitle_burned_toggled_cb" swapped="no"/>
- </object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="SubtitleDefaultTrack">
- <property name="label" translatable="yes">Set Default Track</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">Set the default output subtitle track.
+ <property name="halign">start</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="subtitle_burned_toggled_cb" swapped="no"/>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="SubtitleDefaultTrack">
+ <property name="label" translatable="yes">Set Default Track</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">Set the default output subtitle track.
Most players will automatically display this
subtitle track whenever the video is played.
This is useful for creating a "forced" track
in your output.</property>
- <property name="halign">start</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled" handler="subtitle_default_toggled_cb" swapped="no"/>
- </object>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
+ <property name="halign">start</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="subtitle_default_toggled_cb" swapped="no"/>
</object>
<packing>
<property name="position">2</property>
</child>
</object>
<packing>
- <property name="position">2</property>
+ <property name="position">3</property>
</packing>
</child>
</object>
<property name="tooltip_text" translatable="yes">Set the audio track name.
Players may use this in the audio selection list.</property>
- <property name="max_length">40</property>
+ <property name="max_length">80</property>
+ <property name="width-chars">40</property>
<property name="hexpand">True</property>
<property name="activates_default">True</property>
<property name="truncate_multiline">True</property>
</object>
</child>
<child>
- <object class="GtkBox" id="subtitle_settings_box">
- <property name="orientation">horizontal</property>
+ <object class="GtkGrid" id="subtitle_track_grid">
+ <property name="row-spacing">2</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="spacing">6</property>
+ <property name="column-spacing">5</property>
+ <property name="halign">center</property>
<child>
- <object class="GtkGrid" id="subtitle_import_grid">
+ <object class="GtkLabel" id="subtitle_track_label">
<property name="visible">True</property>
- <property name="row-spacing">2</property>
<property name="can_focus">False</property>
- <property name="column-spacing">4</property>
- <child>
- <object class="GtkLabel" id="import_lang_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Language</property>
- <layout>
- <property name="top-attach">0</property>
- <property name="left-attach">1</property>
- </layout>
- </object>
- </child>
- <child>
- <object class="GtkLabel" id="srt_code_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Character Code</property>
- <layout>
- <property name="top-attach">0</property>
- <property name="left-attach">2</property>
- </layout>
- </object>
- </child>
- <child>
- <object class="GtkLabel" id="import_file_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">File:</property>
- <property name="halign">end</property>
- <layout>
- <property name="top-attach">2</property>
- <property name="left-attach">0</property>
- </layout>
- </object>
- </child>
- <child>
- <object class="GtkLabel" id="import_offset_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Offset (ms)</property>
- <layout>
- <property name="top-attach">0</property>
- <property name="left-attach">4</property>
- </layout>
- </object>
- </child>
- <child>
- <object class="GtkComboBox" id="ImportLanguage">
- <property name="valign">GTK_ALIGN_CENTER</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="tooltip_text" translatable="yes">Set the language of this subtitle.
+ <property name="label" translatable="yes">Source Track</property>
+ <layout>
+ <property name="top_attach">0</property>
+ <property name="left_attach">0</property>
+ </layout>
+ </object>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="SubtitleTrack">
+ <property name="valign">GTK_ALIGN_CENTER</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="tooltip_text" translatable="yes">List of subtitle tracks available from your source.</property>
+ <signal name="changed" handler="subtitle_track_changed_cb" swapped="no"/>
+ <layout>
+ <property name="top_attach">1</property>
+ <property name="left_attach">0</property>
+ </layout>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel" id="subtitle_name_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Track Name:</property>
+ <property name="use_markup">True</property>
+ <property name="halign">center</property>
+ <layout>
+ <property name="top_attach">0</property>
+ <property name="left_attach">1</property>
+ </layout>
+ </object>
+ </child>
+ <child>
+ <object class="GtkEntry" id="SubtitleTrackName">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="tooltip_text" translatable="yes">Set the subtitle track name.
+
+Players may use this in the subtitle selection list.</property>
+ <property name="max_length">80</property>
+ <property name="width-chars">40</property>
+ <property name="activates_default">True</property>
+ <property name="truncate_multiline">True</property>
+ <signal name="changed" handler="subtitle_name_changed_cb" swapped="no"/>
+ <layout>
+ <property name="top_attach">1</property>
+ <property name="left_attach">1</property>
+ </layout>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkGrid" id="subtitle_import_grid">
+ <property name="visible">True</property>
+ <property name="row-spacing">2</property>
+ <property name="can_focus">False</property>
+ <property name="column-spacing">4</property>
+ <child>
+ <object class="GtkLabel" id="import_lang_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Language</property>
+ <layout>
+ <property name="top-attach">0</property>
+ <property name="left-attach">1</property>
+ </layout>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel" id="srt_code_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Character Code</property>
+ <layout>
+ <property name="top-attach">0</property>
+ <property name="left-attach">2</property>
+ </layout>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel" id="import_file_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">File:</property>
+ <property name="halign">end</property>
+ <layout>
+ <property name="top-attach">2</property>
+ <property name="left-attach">0</property>
+ </layout>
+ </object>
+ </child>
+ <child>
+ <object class="GtkLabel" id="import_offset_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Offset (ms)</property>
+ <layout>
+ <property name="top-attach">0</property>
+ <property name="left-attach">4</property>
+ </layout>
+ </object>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="ImportLanguage">
+ <property name="valign">GTK_ALIGN_CENTER</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="tooltip_text" translatable="yes">Set the language of this subtitle.
This value will be used by players in subtitle menus.</property>
- <signal name="changed" handler="import_lang_changed_cb" swapped="no"/>
- <layout>
- <property name="top-attach">1</property>
- <property name="left-attach">1</property>
- </layout>
- </object>
- </child>
- <child>
- <object class="GtkComboBox" id="SrtCodeset">
- <property name="valign">GTK_ALIGN_FILL</property>
- <property name="width_request">150</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="tooltip_text" translatable="yes">Set the character code used by the SRT file you are importing.
+ <signal name="changed" handler="import_lang_changed_cb" swapped="no"/>
+ <layout>
+ <property name="top-attach">1</property>
+ <property name="left-attach">1</property>
+ </layout>
+ </object>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="SrtCodeset">
+ <property name="valign">GTK_ALIGN_FILL</property>
+ <property name="width_request">150</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="tooltip_text" translatable="yes">Set the character code used by the SRT file you are importing.
SRTs come in all flavours of character sets.
We translate the character set to UTF-8.
The source's character code is needed in order to perform this translation.</property>
- <signal name="changed" handler="srt_codeset_changed_cb" swapped="no"/>
- <property name="has_entry">True</property>
- <layout>
- <property name="top-attach">1</property>
- <property name="left-attach">2</property>
- </layout>
- <child internal-child="entry">
- <object class="GtkEntry" id="combobox-entry1">
- <property name="can_focus">True</property>
- </object>
- </child>
- </object>
- </child>
- <child>
- <object class="GtkFileChooserButton" id="ImportFile">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip_text" translatable="yes">Select the SRT file to import.</property>
- <property name="local_only">False</property>
- <property name="hexpand">True</property>
- <property name="title" translatable="yes">Import File</property>
- <signal name="selection-changed" handler="import_file_changed_cb" swapped="no"/>
- <layout>
- <property name="top-attach">2</property>
- <property name="left-attach">1</property>
- <property name="column-span">2</property>
- </layout>
- </object>
- </child>
- <child>
- <object class="GtkSpinButton" id="ImportOffset">
- <property name="valign">GTK_ALIGN_FILL</property>
- <property name="vexpand">False</property>
- <property name="width-chars">8</property>
- <property name="visible">True</property>
+ <signal name="changed" handler="srt_codeset_changed_cb" swapped="no"/>
+ <property name="has_entry">True</property>
+ <layout>
+ <property name="top-attach">1</property>
+ <property name="left-attach">2</property>
+ </layout>
+ <child internal-child="entry">
+ <object class="GtkEntry" id="combobox-entry1">
<property name="can_focus">True</property>
- <property name="tooltip_text" translatable="yes">Adjust the offset in milliseconds between video and SRT timestamps</property>
- <property name="adjustment">adjustment31</property>
- <signal name="value-changed" handler="import_offset_changed_cb" swapped="no"/>
- <layout>
- <property name="top-attach">1</property>
- <property name="left-attach">4</property>
- </layout>
</object>
</child>
</object>
</child>
<child>
- <object class="GtkBox" id="subtitle_track_box">
- <property name="orientation">vertical</property>
+ <object class="GtkFileChooserButton" id="ImportFile">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkLabel" id="subtitle_track_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Track</property>
- </object>
- </child>
- <child>
- <object class="GtkComboBox" id="SubtitleTrack">
- <property name="valign">GTK_ALIGN_CENTER</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="tooltip_text" translatable="yes">List of subtitle tracks available from your source.</property>
- <signal name="changed" handler="subtitle_track_changed_cb" swapped="no"/>
- </object>
- </child>
+ <property name="can_focus">True</property>
+ <property name="tooltip_text" translatable="yes">Select the SRT file to import.</property>
+ <property name="local_only">False</property>
+ <property name="hexpand">True</property>
+ <property name="title" translatable="yes">Import File</property>
+ <signal name="selection-changed" handler="import_file_changed_cb" swapped="no"/>
+ <layout>
+ <property name="top-attach">2</property>
+ <property name="left-attach">1</property>
+ <property name="column-span">2</property>
+ </layout>
</object>
</child>
<child>
- <object class="GtkBox" id="subtitle_options_box">
- <property name="orientation">vertical</property>
+ <object class="GtkSpinButton" id="ImportOffset">
+ <property name="valign">GTK_ALIGN_FILL</property>
+ <property name="vexpand">False</property>
+ <property name="width-chars">8</property>
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkCheckButton" id="SubtitleForced">
- <property name="label" translatable="yes">Forced Subtitles Only</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip_text" translatable="yes">Use only subtitles that have been flagged
+ <property name="can_focus">True</property>
+ <property name="tooltip_text" translatable="yes">Adjust the offset in milliseconds between video and SRT timestamps</property>
+ <property name="adjustment">adjustment31</property>
+ <signal name="value-changed" handler="import_offset_changed_cb" swapped="no"/>
+ <layout>
+ <property name="top-attach">1</property>
+ <property name="left-attach">4</property>
+ </layout>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkBox" id="subtitle_options_box">
+ <property name="orientation">vertical</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_top">12</property>
+ <child>
+ <object class="GtkCheckButton" id="SubtitleForced">
+ <property name="label" translatable="yes">Forced Subtitles Only</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="tooltip_text" translatable="yes">Use only subtitles that have been flagged
as forced in the source subtitle track
"Forced" subtitles are usually used to show
subtitles during scenes where someone is speaking
a foreign language.</property>
- <property name="halign">start</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled" handler="subtitle_forced_toggled_cb" swapped="no"/>
- </object>
- </child>
- <child>
- <object class="GtkCheckButton" id="SubtitleBurned">
- <property name="label" translatable="yes">Burn into video</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip_text" translatable="yes">Render the subtitle over the video.
+ <property name="halign">start</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="subtitle_forced_toggled_cb" swapped="no"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="SubtitleBurned">
+ <property name="label" translatable="yes">Burn into video</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="tooltip_text" translatable="yes">Render the subtitle over the video.
The subtitle will be part of the video and can not be disabled.</property>
- <property name="halign">start</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled" handler="subtitle_burned_toggled_cb" swapped="no"/>
- </object>
- </child>
- <child>
- <object class="GtkCheckButton" id="SubtitleDefaultTrack">
- <property name="label" translatable="yes">Set Default Track</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip_text" translatable="yes">Set the default output subtitle track.
+ <property name="halign">start</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="subtitle_burned_toggled_cb" swapped="no"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="SubtitleDefaultTrack">
+ <property name="label" translatable="yes">Set Default Track</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="tooltip_text" translatable="yes">Set the default output subtitle track.
Most players will automatically display this
subtitle track whenever the video is played.
This is useful for creating a "forced" track
in your output.</property>
- <property name="halign">start</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled" handler="subtitle_default_toggled_cb" swapped="no"/>
- </object>
- </child>
+ <property name="halign">start</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="subtitle_default_toggled_cb" swapped="no"/>
</object>
</child>
</object>
#include "hb.h"
#include "settings.h"
#include "jobdict.h"
+#include "titledict.h"
#include "hb-backend.h"
#include "values.h"
#include "callbacks.h"
static GhbValue* subtitle_add_track(
signal_user_data_t *ud,
GhbValue *settings,
- const hb_title_t *title,
int track,
int mux,
gboolean default_track,
gboolean burn,
gboolean *burned)
{
+ const char * name = NULL;
if (track >= 0 && !import)
{
- hb_subtitle_t *subtitle = hb_list_item(title->list_subtitle, track);
- source = subtitle->source;
+ GhbValue * strack;
+
+ strack = ghb_get_title_subtitle_track(settings, track);
+ source = ghb_dict_get_int(strack, "Source");
+ name = ghb_dict_get_string(strack, "Name");
}
burn |= !hb_subtitle_can_pass(source, mux);
g_free(filename);
}
+ if (name != NULL && name[0] != 0)
+ {
+ ghb_dict_set_string(subsettings, "Name", name);
+ }
ghb_dict_set_int(subsettings, "Track", track);
ghb_dict_set_int(subsettings, "Offset", 0);
ghb_dict_set_bool(subsettings, "Forced", track == -1);
import = ghb_dict_get(subsettings, "Import");
source = get_sub_source(ud->settings, subsettings);
- val = ghb_dict_get(subsettings, "Track");
+ val = ghb_dict_get_value(subsettings, "Name");
+ if (val != NULL)
+ {
+ ghb_ui_update(ud, "SubtitleTrackName", val);
+ }
+ else
+ {
+ ghb_ui_update(ud, "SubtitleTrackName", ghb_string_value(""));
+ }
+
+ val = ghb_dict_get(subsettings, "Track");
if (val != NULL)
{
ghb_ui_update(ud, "SubtitleTrack", val);
// Hide regular subtitle widgets
- widget = GHB_WIDGET(ud->builder, "subtitle_track_box");
+ widget = GHB_WIDGET(ud->builder, "subtitle_track_label");
+ gtk_widget_set_visible(widget, import == NULL);
+ widget = GHB_WIDGET(ud->builder, "SubtitleTrack");
gtk_widget_set_visible(widget, import == NULL);
// Show import subitle widgets
else
{
// Hide widgets not needed for "Foreign audio search"
- widget = GHB_WIDGET(ud->builder, "subtitle_track_box");
+ widget = GHB_WIDGET(ud->builder, "subtitle_track_label");
+ gtk_widget_set_visible(widget, FALSE);
+ widget = GHB_WIDGET(ud->builder, "SubtitleTrack");
gtk_widget_set_visible(widget, FALSE);
widget = GHB_WIDGET(ud->builder, "subtitle_import_grid");
gtk_widget_set_visible(widget, FALSE);
// Show regular subtitle widgets
- widget = GHB_WIDGET(ud->builder, "subtitle_track_box");
+ widget = GHB_WIDGET(ud->builder, "subtitle_track_label");
+ gtk_widget_set_visible(widget, TRUE);
+ widget = GHB_WIDGET(ud->builder, "SubtitleTrack");
gtk_widget_set_visible(widget, TRUE);
}
}
}
}
+G_MODULE_EXPORT void
+subtitle_name_changed_cb(GtkWidget *widget, signal_user_data_t *ud)
+{
+ ghb_widget_to_setting(ud->settings, widget);
+ const char *s = ghb_dict_get_string(ud->settings, "SubtitleTrackName");
+ if (s != NULL && s[0] != 0)
+ {
+ subtitle_update_setting(ghb_widget_value(widget), "Name", ud);
+ }
+ else
+ {
+ subtitle_update_setting(NULL, "Name", ud);
+ }
+}
+
G_MODULE_EXPORT void
subtitle_forced_toggled_cb(GtkWidget *widget, signal_user_data_t *ud)
{
for (subsettings = NULL, track = 0;
subsettings == NULL && track < count; track++)
{
- subsettings = subtitle_add_track(ud, ud->settings, title, track,
+ subsettings = subtitle_add_track(ud, ud->settings, track,
mux->format, FALSE, FALSE, VOBSUB,
FALSE, &one_burned);
}
if (subsettings == NULL)
{
- subsettings = subtitle_add_track(ud, ud->settings, title, 0,
+ subsettings = subtitle_add_track(ud, ud->settings, 0,
mux->format, FALSE, TRUE, IMPORTSRT,
FALSE, &one_burned);
}
int count = hb_list_count(title->list_subtitle);
for (track = 0; track < count; track++)
{
- subtitle_add_track(ud, ud->settings, title, track, mux->format,
+ subtitle_add_track(ud, ud->settings, track, mux->format,
FALSE, FALSE, VOBSUB, FALSE, &one_burned);
}
subtitle_refresh_list_ui(ud);
subtitle->extradata = malloc( src->extradata_size );
memcpy( subtitle->extradata, src->extradata, src->extradata_size );
}
+ if (src->name != NULL)
+ {
+ subtitle->name = strdup(src->name);
+ }
+ if (src->config.name != NULL)
+ {
+ subtitle->config.name = strdup(src->config.name);
+ }
}
return subtitle;
}
{
if ( sub && *sub )
{
+ free ((char*)(*sub)->name);
+ free ((char*)(*sub)->config.name);
free ((*sub)->extradata);
free(*sub);
*sub = NULL;
// "track" in job->list_audio is an index into title->list_audio
subtitle->track = track;
subtitle->config = *subtitlecfg;
+ if (subtitlecfg->name != NULL && subtitlecfg->name[0] != 0)
+ {
+ subtitle->config.name = strdup(subtitlecfg->name);
+ }
subtitle->out_track = hb_list_count(job->list_subtitle) + 1;
hb_list_add(job->list_subtitle, subtitle);
return 1;
strcpy(subtitle->iso639_2, lang->iso639_2);
subtitle->config = *subtitlecfg;
+ if (subtitlecfg->name != NULL && subtitlecfg->name[0] != 0)
+ {
+ subtitle->config.name = strdup(subtitlecfg->name);
+ }
hb_list_add(job->list_subtitle, subtitle);
return 1;
struct hb_subtitle_config_s
{
enum subdest { RENDERSUB, PASSTHRUSUB } dest;
- int force;
- int default_track;
-
+ int force;
+ int default_track;
+ const char * name;
+
/* SRT subtitle tracks only */
- char src_filename[256];
- char src_codeset[40];
- int64_t offset;
+ char src_filename[256];
+ char src_codeset[40];
+ int64_t offset;
};
/*******************************************************************************
enum subsource { VOBSUB, CC608SUB, /*unused*/CC708SUB,
UTF8SUB, TX3GSUB, SSASUB, PGSSUB,
IMPORTSRT, IMPORTSSA, SRTSUB = IMPORTSRT } source;
- char lang[1024];
- char iso639_2[4];
- uint32_t attributes; /* Closed Caption, Childrens, Directors etc */
+ const char * name;
+ char lang[1024];
+ char iso639_2[4];
+ uint32_t attributes; /* Closed Caption, Childrens, Directors etc */
// Color lookup table for VOB subtitle tracks. Each entry is in YCbCr format.
// Must be filled out by the demuxer for VOB subtitle tracks.
hb_error("json pack failure: %s", error.text);
return NULL;
}
+ if (subtitle->name != NULL)
+ {
+ hb_dict_set_string(subtitle_dict, "Name", subtitle->name);
+ }
hb_value_array_append(subtitle_list, subtitle_dict);
}
hb_dict_set(dict, "SubtitleList", subtitle_list);
"Burn", hb_value_bool(subtitle->config.dest == RENDERSUB),
"Offset", hb_value_int(subtitle->config.offset));
}
+ if (subtitle->config.name != NULL)
+ {
+ hb_dict_set_string(subtitle_dict, "Name", subtitle->config.name);
+ }
hb_value_array_append(subtitle_list, subtitle_dict);
}
int burn = 0;
const char *importfile = NULL;
json_int_t offset = 0;
+ const char *name = NULL;
result = json_unpack_ex(subtitle_dict, &error, 0,
- "{s?i, s?{s:s}, s?{s:s}}",
+ "{s?i, s?s, s?{s:s}, s?{s:s}}",
"Track", unpack_i(&track),
+ "Name", unpack_s(&name),
// Support legacy "SRT" import
"SRT",
"Filename", unpack_s(&importfile),
hb_job_close(&job);
return NULL;
}
+
// Embedded subtitle track
if (track >= 0 && importfile == NULL)
{
if (subtitle != NULL)
{
sub_config = subtitle->config;
+ sub_config.name = name;
result = json_unpack_ex(subtitle_dict, &error, 0,
"{s?b, s?b, s?b, s?I}",
"Default", unpack_b(&sub_config.default_track),
hb_job_close(&job);
return NULL;
}
+ sub_config.name = name;
sub_config.offset = offset;
sub_config.dest = burn ? RENDERSUB : PASSTHRUSUB;
strncpy(sub_config.src_codeset, srtcodeset, 39);
{
av_dict_set(&track->st->metadata, "language", lang, 0);
}
+ if (subtitle->config.name != NULL && subtitle->config.name[0] != 0)
+ {
+ // Set subtitle track title
+ av_dict_set(&track->st->metadata, "title",
+ subtitle->config.name, 0);
+ }
}
if (need_fonts)
}
static void add_subtitle(hb_value_array_t *list, int track,
- int make_default, int force, int burn)
+ int make_default, int force, int burn,
+ const char * name)
{
hb_dict_t *subtitle_dict = hb_dict_init();
- hb_dict_set(subtitle_dict, "Track", hb_value_int(track));
- hb_dict_set(subtitle_dict, "Default", hb_value_bool(make_default));
- hb_dict_set(subtitle_dict, "Forced", hb_value_bool(force));
- hb_dict_set(subtitle_dict, "Burn", hb_value_bool(burn));
+ hb_dict_set_int(subtitle_dict, "Track", track);
+ hb_dict_set_bool(subtitle_dict, "Default", make_default);
+ hb_dict_set_bool(subtitle_dict, "Forced", force);
+ hb_dict_set_bool(subtitle_dict, "Burn", burn);
+ hb_dict_set_string(subtitle_dict, "Name", name);
hb_value_array_append(list, subtitle_dict);
}
behavior->burn_first &= !burn;
behavior->one_burned |= burn;
behavior->used[t] = 1;
- add_subtitle(list, t, make_default, 0 /*!force*/, burn);
+ add_subtitle(list, t, make_default, 0 /*!force*/, burn, subtitle->name);
}
}
behavior.burn_first);
behavior.used[track] = 1;
behavior.one_burned |= burn;
- add_subtitle(list, track, 0 /*default*/, 0 /*!force*/, burn);
+ add_subtitle(list, track, 0 /*default*/, 0 /*!force*/, burn,
+ subtitle->name);
break;
}
}
{
AVStream * st = stream->ffmpeg_ic->streams[id];
AVCodecParameters * codecpar = st->codecpar;
+ AVDictionaryEntry * tag_lang = av_dict_get(st->metadata, "language", NULL, 0 );
+ AVDictionaryEntry * tag_name = av_dict_get(st->metadata, "title", NULL, 0);
hb_subtitle_t *subtitle = calloc( 1, sizeof(*subtitle) );
return;
}
- AVDictionaryEntry *tag;
iso639_lang_t *lang;
- tag = av_dict_get( st->metadata, "language", NULL, 0 );
- lang = lang_for_code2( tag ? tag->value : "und" );
+ lang = lang_for_code2(tag_lang ? tag_lang->value : "und");
snprintf(subtitle->lang, sizeof( subtitle->lang ), "%s [%s]",
strlen(lang->native_name) ? lang->native_name : lang->eng_name,
hb_subsource_name(subtitle->source));
strncpy(subtitle->iso639_2, lang->iso639_2, 3);
subtitle->iso639_2[3] = 0;
+ if (tag_name != NULL)
+ {
+ subtitle->name = strdup(tag_name->value);
+ }
// Copy the extradata for the subtitle track
if (codecpar->extradata != NULL)
hb_subtitle_config_t sub_config;
int type = subTrack.type;
+ sub_config.name = NULL;
sub_config.offset = subTrack.offset;
// we need to strncpy file name and codeset