diff options
author | John Stebbins <[email protected]> | 2015-10-11 10:50:51 -0700 |
---|---|---|
committer | John Stebbins <[email protected]> | 2015-10-12 09:05:56 -0700 |
commit | 87fdf319e91a84113e738282a11c56f4c4bb738d (patch) | |
tree | 64cc889e4eedde1e311a3860bf3cf1ecf56586f7 | |
parent | 1a04b051b3242bdca6000c597c831d40886d67ae (diff) |
decsrt: don't combine > 2 lines into 2
This was originally done because > 2 lines is not supported in mp4 timed
text. But this line combining is now performed only when necessary in
muxavformat.
-rw-r--r-- | libhb/decsrtsub.c | 34 |
1 files changed, 6 insertions, 28 deletions
diff --git a/libhb/decsrtsub.c b/libhb/decsrtsub.c index 0712a03ce..164f7c09f 100644 --- a/libhb/decsrtsub.c +++ b/libhb/decsrtsub.c @@ -475,7 +475,6 @@ static hb_buffer_t *srt_read( hb_work_private_t *pv ) { long length; char *p, *q; - int line = 1; uint64_t start_time = ( pv->current_entry.start + pv->subtitle->config.offset ) * 90; uint64_t stop_time = ( pv->current_entry.stop + @@ -494,7 +493,7 @@ static hb_buffer_t *srt_read( hb_work_private_t *pv ) for (q = p = pv->current_entry.text; *p != '\0'; p++) { - if (*p == '\n' || *p == '\r') + if (*p == '\r') { if (*(p + 1) == '\n' || *(p + 1) == '\r' || *(p + 1) == '\0') @@ -503,18 +502,8 @@ static hb_buffer_t *srt_read( hb_work_private_t *pv ) length--; continue; } - else if (line == 1) - { - // replace '\r' with '\n' - *q = '\n'; - line = 2; - } - else - { - // all subtitles on two lines tops - // replace line breaks with spaces - *q = ' '; - } + // replace '\r' with '\n' + *q = '\n'; q++; } else @@ -552,7 +541,6 @@ static hb_buffer_t *srt_read( hb_work_private_t *pv ) { long length; char *p, *q; - int line = 1; uint64_t start_time = ( pv->current_entry.start + pv->subtitle->config.offset ) * 90; uint64_t stop_time = ( pv->current_entry.stop + @@ -569,7 +557,7 @@ static hb_buffer_t *srt_read( hb_work_private_t *pv ) for (q = p = pv->current_entry.text; *p != '\0'; p++) { - if (*p == '\n' || *p == '\r') + if (*p == '\r') { if (*(p + 1) == '\n' || *(p + 1) == '\r' || *(p + 1) == '\0') { @@ -577,18 +565,8 @@ static hb_buffer_t *srt_read( hb_work_private_t *pv ) length--; continue; } - else if (line == 1) - { - // replace '\r' with '\n' - *q = '\n'; - line = 2; - } - else - { - // all subtitles on two lines tops - // replace line breaks with spaces - *q = ' '; - } + // replace '\r' with '\n' + *q = '\n'; q++; } else |