summaryrefslogtreecommitdiffstats
path: root/libhb/common.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2009-06-03 22:07:49 +0000
committerjstebbins <[email protected]>2009-06-03 22:07:49 +0000
commit705ea262b0f53fd19df594dfc8026798cf001155 (patch)
tree30c8fa07c6bc3808f9081356eb7850e33519e9c9 /libhb/common.c
parentfa937f5aab19995d36ffbb59eb017d9428a5037f (diff)
softsubs:
- add ability to have 1 source subtitle feed many output subtitles use hb_subtitle_add() to add output tracks. example use case: you want forced subtitles from a source track on one output track and the entire subtitle stream from the same source track on a second output track - LinGui: make subtitle tab resemble functionality of the audio tab any track can be added multiple times with different settings. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2476 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/common.c')
-rw-r--r--libhb/common.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/libhb/common.c b/libhb/common.c
index c8e4e07b0..350132bae 100644
--- a/libhb/common.c
+++ b/libhb/common.c
@@ -816,3 +816,42 @@ hb_audio_config_t * hb_list_audio_config_item(hb_list_t * list, int i)
return NULL;
}
+
+/**********************************************************************
+ * hb_subtitle_copy
+ **********************************************************************
+ *
+ *********************************************************************/
+hb_subtitle_t *hb_subtitle_copy(const hb_subtitle_t *src)
+{
+ hb_subtitle_t *subtitle = NULL;
+
+ if( src )
+ {
+ subtitle = calloc(1, sizeof(*subtitle));
+ memcpy(subtitle, src, sizeof(*subtitle));
+ }
+ return subtitle;
+}
+
+/**********************************************************************
+ * hb_subtitle_add
+ **********************************************************************
+ *
+ *********************************************************************/
+int hb_subtitle_add(const hb_job_t * job, const hb_subtitle_config_t * subtitlecfg, int track)
+{
+ hb_title_t *title = job->title;
+ hb_subtitle_t *subtitle;
+
+ subtitle = hb_subtitle_copy( hb_list_item( title->list_subtitle, track ) );
+ if( subtitle == NULL )
+ {
+ /* We fail! */
+ return 0;
+ }
+ subtitle->config = *subtitlecfg;
+ hb_list_add(job->list_subtitle, subtitle);
+ return 1;
+}
+