1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/ass: assume raw=0 in ff_ass_add_rect_bprint

This commit is contained in:
Clément Bœsch 2014-10-19 21:03:57 +02:00
parent 65639e6bef
commit 3d25869605
12 changed files with 14 additions and 14 deletions

View File

@ -175,11 +175,11 @@ err:
} }
int ff_ass_add_rect_bprint(AVSubtitle *sub, const AVBPrint *buf, int ff_ass_add_rect_bprint(AVSubtitle *sub, const AVBPrint *buf,
int ts_start, int duration, int raw) int ts_start, int duration)
{ {
if (!av_bprint_is_complete(buf)) if (!av_bprint_is_complete(buf))
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
return ff_ass_add_rect(sub, buf->str, ts_start, duration, raw); return ff_ass_add_rect(sub, buf->str, ts_start, duration, 0);
} }
void ff_ass_bprint_text_event(AVBPrint *buf, const char *p, int size, void ff_ass_bprint_text_event(AVBPrint *buf, const char *p, int size,

View File

@ -93,10 +93,10 @@ int ff_ass_add_rect(AVSubtitle *sub, const char *dialog,
/** /**
* Same as ff_ass_add_rect_bprint, but taking an AVBPrint buffer instead of a * Same as ff_ass_add_rect_bprint, but taking an AVBPrint buffer instead of a
* string. * string, and assuming raw=0.
*/ */
int ff_ass_add_rect_bprint(AVSubtitle *sub, const AVBPrint *buf, int ff_ass_add_rect_bprint(AVSubtitle *sub, const AVBPrint *buf,
int ts_start, int duration, int raw); int ts_start, int duration);
/** /**
* Add an ASS dialog line to an AVBPrint buffer. * Add an ASS dialog line to an AVBPrint buffer.

View File

@ -185,7 +185,7 @@ static int jacosub_decode_frame(AVCodecContext *avctx,
av_bprint_init(&buffer, JSS_MAX_LINESIZE, JSS_MAX_LINESIZE); av_bprint_init(&buffer, JSS_MAX_LINESIZE, JSS_MAX_LINESIZE);
jacosub_to_ass(avctx, &buffer, ptr); jacosub_to_ass(avctx, &buffer, ptr);
ret = ff_ass_add_rect_bprint(sub, &buffer, avpkt->pts, avpkt->duration, 0); ret = ff_ass_add_rect_bprint(sub, &buffer, avpkt->pts, avpkt->duration);
av_bprint_finalize(&buffer, NULL); av_bprint_finalize(&buffer, NULL);
if (ret < 0) if (ret < 0)
return ret; return ret;

View File

@ -298,7 +298,7 @@ static int microdvd_decode_frame(AVCodecContext *avctx,
av_rescale_q(duration, avctx->time_base, (AVRational){1,100}) : -1; av_rescale_q(duration, avctx->time_base, (AVRational){1,100}) : -1;
av_bprintf(&new_line, "\r\n"); av_bprintf(&new_line, "\r\n");
ret = ff_ass_add_rect_bprint(sub, &new_line, ts_start, ts_duration, 0); ret = ff_ass_add_rect_bprint(sub, &new_line, ts_start, ts_duration);
av_bprint_finalize(&new_line, NULL); av_bprint_finalize(&new_line, NULL);
if (ret < 0) if (ret < 0)
return ret; return ret;

View File

@ -96,7 +96,7 @@ static int mov_text_decode_frame(AVCodecContext *avctx,
// Note that the spec recommends lines be no longer than 2048 characters. // Note that the spec recommends lines be no longer than 2048 characters.
av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED); av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED);
text_to_ass(&buf, ptr, end); text_to_ass(&buf, ptr, end);
ret = ff_ass_add_rect_bprint(sub, &buf, ts_start, ts_end-ts_start, 0); ret = ff_ass_add_rect_bprint(sub, &buf, ts_start, ts_end-ts_start);
av_bprint_finalize(&buf, NULL); av_bprint_finalize(&buf, NULL);
if (ret < 0) if (ret < 0)
return ret; return ret;

View File

@ -76,7 +76,7 @@ static int mpl2_decode_frame(AVCodecContext *avctx, void *data,
av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED); av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED);
if (ptr && avpkt->size > 0 && *ptr && !mpl2_event_to_ass(&buf, ptr)) if (ptr && avpkt->size > 0 && *ptr && !mpl2_event_to_ass(&buf, ptr))
ret = ff_ass_add_rect_bprint(sub, &buf, ts_start, ts_duration, 0); ret = ff_ass_add_rect_bprint(sub, &buf, ts_start, ts_duration);
av_bprint_finalize(&buf, NULL); av_bprint_finalize(&buf, NULL);
if (ret < 0) if (ret < 0)
return ret; return ret;

View File

@ -68,7 +68,7 @@ static int realtext_decode_frame(AVCodecContext *avctx,
// note: no need to rescale pts & duration since they are in the same // note: no need to rescale pts & duration since they are in the same
// timebase as ASS (1/100) // timebase as ASS (1/100)
if (ptr && avpkt->size > 0 && !rt_event_to_ass(&buf, ptr)) if (ptr && avpkt->size > 0 && !rt_event_to_ass(&buf, ptr))
ret = ff_ass_add_rect_bprint(sub, &buf, avpkt->pts, avpkt->duration, 0); ret = ff_ass_add_rect_bprint(sub, &buf, avpkt->pts, avpkt->duration);
av_bprint_finalize(&buf, NULL); av_bprint_finalize(&buf, NULL);
if (ret < 0) if (ret < 0)
return ret; return ret;

View File

@ -122,7 +122,7 @@ static int sami_decode_frame(AVCodecContext *avctx,
int ts_start = av_rescale_q(avpkt->pts, avctx->time_base, (AVRational){1,100}); int ts_start = av_rescale_q(avpkt->pts, avctx->time_base, (AVRational){1,100});
int ts_duration = avpkt->duration != -1 ? int ts_duration = avpkt->duration != -1 ?
av_rescale_q(avpkt->duration, avctx->time_base, (AVRational){1,100}) : -1; av_rescale_q(avpkt->duration, avctx->time_base, (AVRational){1,100}) : -1;
int ret = ff_ass_add_rect_bprint(sub, &sami->full, ts_start, ts_duration, 0); int ret = ff_ass_add_rect_bprint(sub, &sami->full, ts_start, ts_duration);
if (ret < 0) if (ret < 0)
return ret; return ret;
} }

View File

@ -217,7 +217,7 @@ static int srt_decode_frame(AVCodecContext *avctx,
(AVRational){1,100}); (AVRational){1,100});
srt_to_ass(avctx, &buffer, avpkt->data, x1, y1, x2, y2); srt_to_ass(avctx, &buffer, avpkt->data, x1, y1, x2, y2);
ret = ff_ass_add_rect_bprint(sub, &buffer, ts_start, ts_end-ts_start, 0); ret = ff_ass_add_rect_bprint(sub, &buffer, ts_start, ts_end-ts_start);
av_bprint_finalize(&buffer, NULL); av_bprint_finalize(&buffer, NULL);
if (ret < 0) if (ret < 0)
return ret; return ret;

View File

@ -59,7 +59,7 @@ static int subviewer_decode_frame(AVCodecContext *avctx,
// note: no need to rescale pts & duration since they are in the same // note: no need to rescale pts & duration since they are in the same
// timebase as ASS (1/100) // timebase as ASS (1/100)
if (ptr && avpkt->size > 0 && !subviewer_event_to_ass(&buf, ptr)) if (ptr && avpkt->size > 0 && !subviewer_event_to_ass(&buf, ptr))
ret = ff_ass_add_rect_bprint(sub, &buf, avpkt->pts, avpkt->duration, 0); ret = ff_ass_add_rect_bprint(sub, &buf, avpkt->pts, avpkt->duration);
av_bprint_finalize(&buf, NULL); av_bprint_finalize(&buf, NULL);
if (ret < 0) if (ret < 0)
return ret; return ret;

View File

@ -56,7 +56,7 @@ static int text_decode_frame(AVCodecContext *avctx, void *data,
av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED); av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED);
if (ptr && avpkt->size > 0 && *ptr) { if (ptr && avpkt->size > 0 && *ptr) {
ff_ass_bprint_text_event(&buf, ptr, avpkt->size, text->linebreaks, text->keep_ass_markup); ff_ass_bprint_text_event(&buf, ptr, avpkt->size, text->linebreaks, text->keep_ass_markup);
ret = ff_ass_add_rect_bprint(sub, &buf, ts_start, ts_duration, 0); ret = ff_ass_add_rect_bprint(sub, &buf, ts_start, ts_duration);
} }
av_bprint_finalize(&buf, NULL); av_bprint_finalize(&buf, NULL);
if (ret < 0) if (ret < 0)

View File

@ -84,7 +84,7 @@ static int webvtt_decode_frame(AVCodecContext *avctx,
int ts_start = av_rescale_q(avpkt->pts, avctx->time_base, (AVRational){1,100}); int ts_start = av_rescale_q(avpkt->pts, avctx->time_base, (AVRational){1,100});
int ts_duration = avpkt->duration != -1 ? int ts_duration = avpkt->duration != -1 ?
av_rescale_q(avpkt->duration, avctx->time_base, (AVRational){1,100}) : -1; av_rescale_q(avpkt->duration, avctx->time_base, (AVRational){1,100}) : -1;
ret = ff_ass_add_rect_bprint(sub, &buf, ts_start, ts_duration, 0); ret = ff_ass_add_rect_bprint(sub, &buf, ts_start, ts_duration);
} }
av_bprint_finalize(&buf, NULL); av_bprint_finalize(&buf, NULL);
if (ret < 0) if (ret < 0)