diff options
author | John Stebbins <[email protected]> | 2017-11-06 10:48:26 -0800 |
---|---|---|
committer | GitHub <[email protected]> | 2017-11-06 10:48:26 -0800 |
commit | 8a68af4675fd90f58ab0b8a191345847bff94cea (patch) | |
tree | 5f473c29873fe702e9d2177903557cbd6acb79c3 /libhb/dvd.c | |
parent | d438e35c7edf9a94cddb7853fe68a50207d1027d (diff) |
CLI: add option to log version, title, and progress in json
This is useful for scripts and other frontends that need to parse CLI output.
Diffstat (limited to 'libhb/dvd.c')
-rw-r--r-- | libhb/dvd.c | 42 |
1 files changed, 38 insertions, 4 deletions
diff --git a/libhb/dvd.c b/libhb/dvd.c index 078806d89..4dfd81661 100644 --- a/libhb/dvd.c +++ b/libhb/dvd.c @@ -205,55 +205,72 @@ static void add_subtitle( hb_list_t * list_subtitle, int position, subtitle->substream_type = 0x20 + position; subtitle->codec = WORK_DECVOBSUB; - subtitle->type = lang_extension; - memcpy(subtitle->palette, palette, 16 * sizeof(uint32_t)); subtitle->palette_set = 1; switch (lang_extension) { + case 1: + subtitle->attributes = HB_SUBTITLE_ATTR_NORMAL; + break; case 2: + subtitle->attributes = HB_SUBTITLE_ATTR_LARGE; strcat(subtitle->lang, " Large Type"); break; case 3: + subtitle->attributes = HB_SUBTITLE_ATTR_CHILDREN; strcat(subtitle->lang, " Children"); break; case 5: + subtitle->attributes = HB_SUBTITLE_ATTR_CC; strcat(subtitle->lang, " Closed Caption"); break; case 6: + subtitle->attributes = HB_SUBTITLE_ATTR_CC | HB_SUBTITLE_ATTR_LARGE; strcat(subtitle->lang, " Closed Caption, Large Type"); break; case 7: + subtitle->attributes = HB_SUBTITLE_ATTR_CC | + HB_SUBTITLE_ATTR_CHILDREN; strcat(subtitle->lang, " Closed Caption, Children"); break; case 9: + subtitle->attributes = HB_SUBTITLE_ATTR_FORCED; strcat(subtitle->lang, " Forced"); break; case 13: + subtitle->attributes = HB_SUBTITLE_ATTR_COMMENTARY; strcat(subtitle->lang, " Director's Commentary"); break; case 14: + subtitle->attributes = HB_SUBTITLE_ATTR_COMMENTARY | + HB_SUBTITLE_ATTR_LARGE; strcat(subtitle->lang, " Director's Commentary, Large Type"); break; case 15: + subtitle->attributes = HB_SUBTITLE_ATTR_COMMENTARY | + HB_SUBTITLE_ATTR_CHILDREN; strcat(subtitle->lang, " Director's Commentary, Children"); default: + subtitle->attributes = HB_SUBTITLE_ATTR_UNKNOWN; break; } - switch (style) { case HB_VOBSUB_STYLE_4_3: + subtitle->attributes |= HB_SUBTITLE_ATTR_4_3; strcat(subtitle->lang, " (4:3)"); break; case HB_VOBSUB_STYLE_WIDE: + subtitle->attributes |= HB_SUBTITLE_ATTR_WIDE; strcat(subtitle->lang, " (Wide Screen)"); break; case HB_VOBSUB_STYLE_LETTERBOX: + subtitle->attributes |= HB_SUBTITLE_ATTR_LETTERBOX; strcat(subtitle->lang, " (Letterbox)"); break; case HB_VOBSUB_STYLE_PANSCAN: + subtitle->attributes |= HB_SUBTITLE_ATTR_PANSCAN; strcat(subtitle->lang, " (Pan & Scan)"); break; } @@ -526,7 +543,24 @@ static hb_title_t * hb_dvdread_title_scan( hb_dvd_t * e, int t, uint64_t min_dur lang = lang_for_code( lang_code ); - audio->config.lang.type = lang_extension; + switch ( lang_extension ) + { + case 1: + audio->config.lang.attributes = HB_AUDIO_ATTR_NORMAL; + break; + case 2: + audio->config.lang.attributes = HB_AUDIO_ATTR_VISUALLY_IMPAIRED; + break; + case 3: + audio->config.lang.attributes = HB_AUDIO_ATTR_COMMENTARY; + break; + case 4: + audio->config.lang.attributes = HB_AUDIO_ATTR_ALT_COMMENTARY; + break; + default: + audio->config.lang.attributes = HB_AUDIO_ATTR_NONE; + break; + } snprintf( audio->config.lang.simple, sizeof( audio->config.lang.simple ), "%s", |