summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2015-10-11 10:50:51 -0700
committerJohn Stebbins <[email protected]>2015-10-15 12:54:06 -0700
commit660aaa6963a07fc2ea632ef55df0f40aacb0971b (patch)
tree0e746f9f2dcadec26bb8a972d7404af7e13a3dab
parent47bef13b425e753f114aaf3fb40c976701946589 (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.c34
1 files changed, 6 insertions, 28 deletions
diff --git a/libhb/decsrtsub.c b/libhb/decsrtsub.c
index 74d153f13..28845677a 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