Browse code

avcodec/ass: assume raw=0 in ff_ass_add_rect_bprint

Clément Bœsch authored on 2014/10/20 04:03:57
Showing 12 changed files
... ...
@@ -175,11 +175,11 @@ err:
175 175
 }
176 176
 
177 177
 int ff_ass_add_rect_bprint(AVSubtitle *sub, const AVBPrint *buf,
178
-                           int ts_start, int duration, int raw)
178
+                           int ts_start, int duration)
179 179
 {
180 180
     if (!av_bprint_is_complete(buf))
181 181
         return AVERROR(ENOMEM);
182
-    return ff_ass_add_rect(sub, buf->str, ts_start, duration, raw);
182
+    return ff_ass_add_rect(sub, buf->str, ts_start, duration, 0);
183 183
 }
184 184
 
185 185
 void ff_ass_bprint_text_event(AVBPrint *buf, const char *p, int size,
... ...
@@ -93,10 +93,10 @@ int ff_ass_add_rect(AVSubtitle *sub, const char *dialog,
93 93
 
94 94
 /**
95 95
  * Same as ff_ass_add_rect_bprint, but taking an AVBPrint buffer instead of a
96
- * string.
96
+ * string, and assuming raw=0.
97 97
  */
98 98
 int ff_ass_add_rect_bprint(AVSubtitle *sub, const AVBPrint *buf,
99
-                           int ts_start, int duration, int raw);
99
+                           int ts_start, int duration);
100 100
 
101 101
 /**
102 102
  * Add an ASS dialog line to an AVBPrint buffer.
... ...
@@ -185,7 +185,7 @@ static int jacosub_decode_frame(AVCodecContext *avctx,
185 185
 
186 186
         av_bprint_init(&buffer, JSS_MAX_LINESIZE, JSS_MAX_LINESIZE);
187 187
         jacosub_to_ass(avctx, &buffer, ptr);
188
-        ret = ff_ass_add_rect_bprint(sub, &buffer, avpkt->pts, avpkt->duration, 0);
188
+        ret = ff_ass_add_rect_bprint(sub, &buffer, avpkt->pts, avpkt->duration);
189 189
         av_bprint_finalize(&buffer, NULL);
190 190
         if (ret < 0)
191 191
             return ret;
... ...
@@ -298,7 +298,7 @@ static int microdvd_decode_frame(AVCodecContext *avctx,
298 298
                 av_rescale_q(duration, avctx->time_base, (AVRational){1,100}) : -1;
299 299
 
300 300
         av_bprintf(&new_line, "\r\n");
301
-        ret = ff_ass_add_rect_bprint(sub, &new_line, ts_start, ts_duration, 0);
301
+        ret = ff_ass_add_rect_bprint(sub, &new_line, ts_start, ts_duration);
302 302
         av_bprint_finalize(&new_line, NULL);
303 303
         if (ret < 0)
304 304
             return ret;
... ...
@@ -96,7 +96,7 @@ static int mov_text_decode_frame(AVCodecContext *avctx,
96 96
     // Note that the spec recommends lines be no longer than 2048 characters.
97 97
     av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED);
98 98
     text_to_ass(&buf, ptr, end);
99
-    ret = ff_ass_add_rect_bprint(sub, &buf, ts_start, ts_end-ts_start, 0);
99
+    ret = ff_ass_add_rect_bprint(sub, &buf, ts_start, ts_end-ts_start);
100 100
     av_bprint_finalize(&buf, NULL);
101 101
     if (ret < 0)
102 102
         return ret;
... ...
@@ -76,7 +76,7 @@ static int mpl2_decode_frame(AVCodecContext *avctx, void *data,
76 76
 
77 77
     av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED);
78 78
     if (ptr && avpkt->size > 0 && *ptr && !mpl2_event_to_ass(&buf, ptr))
79
-        ret = ff_ass_add_rect_bprint(sub, &buf, ts_start, ts_duration, 0);
79
+        ret = ff_ass_add_rect_bprint(sub, &buf, ts_start, ts_duration);
80 80
     av_bprint_finalize(&buf, NULL);
81 81
     if (ret < 0)
82 82
         return ret;
... ...
@@ -68,7 +68,7 @@ static int realtext_decode_frame(AVCodecContext *avctx,
68 68
     // note: no need to rescale pts & duration since they are in the same
69 69
     // timebase as ASS (1/100)
70 70
     if (ptr && avpkt->size > 0 && !rt_event_to_ass(&buf, ptr))
71
-        ret = ff_ass_add_rect_bprint(sub, &buf, avpkt->pts, avpkt->duration, 0);
71
+        ret = ff_ass_add_rect_bprint(sub, &buf, avpkt->pts, avpkt->duration);
72 72
     av_bprint_finalize(&buf, NULL);
73 73
     if (ret < 0)
74 74
         return ret;
... ...
@@ -122,7 +122,7 @@ static int sami_decode_frame(AVCodecContext *avctx,
122 122
         int ts_start     = av_rescale_q(avpkt->pts, avctx->time_base, (AVRational){1,100});
123 123
         int ts_duration  = avpkt->duration != -1 ?
124 124
                            av_rescale_q(avpkt->duration, avctx->time_base, (AVRational){1,100}) : -1;
125
-        int ret = ff_ass_add_rect_bprint(sub, &sami->full, ts_start, ts_duration, 0);
125
+        int ret = ff_ass_add_rect_bprint(sub, &sami->full, ts_start, ts_duration);
126 126
         if (ret < 0)
127 127
             return ret;
128 128
     }
... ...
@@ -217,7 +217,7 @@ static int srt_decode_frame(AVCodecContext *avctx,
217 217
                                     (AVRational){1,100});
218 218
 
219 219
     srt_to_ass(avctx, &buffer, avpkt->data, x1, y1, x2, y2);
220
-    ret = ff_ass_add_rect_bprint(sub, &buffer, ts_start, ts_end-ts_start, 0);
220
+    ret = ff_ass_add_rect_bprint(sub, &buffer, ts_start, ts_end-ts_start);
221 221
     av_bprint_finalize(&buffer, NULL);
222 222
     if (ret < 0)
223 223
         return ret;
... ...
@@ -59,7 +59,7 @@ static int subviewer_decode_frame(AVCodecContext *avctx,
59 59
     // note: no need to rescale pts & duration since they are in the same
60 60
     // timebase as ASS (1/100)
61 61
     if (ptr && avpkt->size > 0 && !subviewer_event_to_ass(&buf, ptr))
62
-        ret = ff_ass_add_rect_bprint(sub, &buf, avpkt->pts, avpkt->duration, 0);
62
+        ret = ff_ass_add_rect_bprint(sub, &buf, avpkt->pts, avpkt->duration);
63 63
     av_bprint_finalize(&buf, NULL);
64 64
     if (ret < 0)
65 65
         return ret;
... ...
@@ -56,7 +56,7 @@ static int text_decode_frame(AVCodecContext *avctx, void *data,
56 56
     av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED);
57 57
     if (ptr && avpkt->size > 0 && *ptr) {
58 58
         ff_ass_bprint_text_event(&buf, ptr, avpkt->size, text->linebreaks, text->keep_ass_markup);
59
-        ret = ff_ass_add_rect_bprint(sub, &buf, ts_start, ts_duration, 0);
59
+        ret = ff_ass_add_rect_bprint(sub, &buf, ts_start, ts_duration);
60 60
     }
61 61
     av_bprint_finalize(&buf, NULL);
62 62
     if (ret < 0)
... ...
@@ -84,7 +84,7 @@ static int webvtt_decode_frame(AVCodecContext *avctx,
84 84
         int ts_start     = av_rescale_q(avpkt->pts, avctx->time_base, (AVRational){1,100});
85 85
         int ts_duration  = avpkt->duration != -1 ?
86 86
                            av_rescale_q(avpkt->duration, avctx->time_base, (AVRational){1,100}) : -1;
87
-        ret = ff_ass_add_rect_bprint(sub, &buf, ts_start, ts_duration, 0);
87
+        ret = ff_ass_add_rect_bprint(sub, &buf, ts_start, ts_duration);
88 88
     }
89 89
     av_bprint_finalize(&buf, NULL);
90 90
     if (ret < 0)