[FFmpeg-cvslog] avformat/sccdec: unbreak previous commits to this file

Paul B Mahol git at videolan.org
Mon Jun 15 20:31:40 EEST 2020


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sun Jun 14 21:16:57 2020 +0200| [6c84f8afaefa55233e24daa62df89b469da2ea21] | committer: Paul B Mahol

avformat/sccdec: unbreak previous commits to this file

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6c84f8afaefa55233e24daa62df89b469da2ea21
---

 libavformat/sccdec.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/libavformat/sccdec.c b/libavformat/sccdec.c
index 72f47f70de..fa2a5c223a 100644
--- a/libavformat/sccdec.c
+++ b/libavformat/sccdec.c
@@ -131,14 +131,11 @@ try_again:
             o2 = convert(c4) | (convert(c3) << 4);
 
             lline = NULL;
-            out[i+0] = 0xfc;
-            out[i+1] = o1;
-            out[i+2] = o2;
 
-            if (o1 == 0x94 && o2 == 0x2f && saveptr && av_strcasecmp(saveptr, "942f")) {
+            if (i > 12 && o1 == 0x94 && o2 == 0x20 && saveptr &&
+                (av_strncasecmp(saveptr, "942f", 4) || !av_strncasecmp(saveptr, "942c", 4))) {
                 int64_t duration;
 
-                i += 3;
                 out[i] = 0;
                 duration = i * 11;
 
@@ -146,13 +143,17 @@ try_again:
                 if (!sub)
                     goto fail;
 
-                current_pos += i;
                 sub->pos = current_pos;
+                current_pos += i;
                 sub->pts = ts_start;
                 sub->duration = duration;
                 ts_start += duration;
                 i = 0;
             }
+
+            out[i+0] = 0xfc;
+            out[i+1] = o1;
+            out[i+2] = o2;
         }
 
         out[i] = 0;



More information about the ffmpeg-cvslog mailing list