Unified · Split
| @@ -27,7 +27,7 @@ · 26 unmodified lines | |||
| 27 | #include "ass.h" | 27 | #include "ass.h" |
| 28 | #include "htmlsubtitles.h" | 28 | #include "htmlsubtitles.h" |
| 29 | 29 | ||
| 30 | static void srt_to_ass(AVCodecContext *avctx, AVBPrint *dst, | 30 | static int srt_to_ass(AVCodecContext *avctx, AVBPrint *dst, |
| 31 | const char *in, int x1, int y1, int x2, int y2) | 31 | const char *in, int x1, int y1, int x2, int y2) |
| 32 | { | 32 | { |
| 33 | if (x1 >= 0 && y1 >= 0) { | 33 | if (x1 >= 0 && y1 >= 0) { |
| @@ -49,7 +49,7 @@ static void srt_to_ass(AVCodecContext *avctx, AVBPrint *dst, · 15 unmodified lines | |||
| 49 | } | 49 | } |
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | ff_htmlmarkup_to_ass(avctx, dst, in); | 52 | return ff_htmlmarkup_to_ass(avctx, dst, in); |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | static int srt_decode_frame(AVCodecContext *avctx, | 55 | static int srt_decode_frame(AVCodecContext *avctx, |
| @@ -74,8 +74,9 @@ static int srt_decode_frame(AVCodecContext *avctx, · 18 unmodified lines | |||
| 74 | 74 | ||
| 75 | av_bprint_init(&buffer, 0, AV_BPRINT_SIZE_UNLIMITED); | 75 | av_bprint_init(&buffer, 0, AV_BPRINT_SIZE_UNLIMITED); |
| 76 | 76 | ||
| 77 | srt_to_ass(avctx, &buffer, avpkt->data, x1, y1, x2, y2); | 77 | ret = srt_to_ass(avctx, &buffer, avpkt->data, x1, y1, x2, y2); |
| 78 | ret = ff_ass_add_rect(sub, buffer.str, s->readorder++, 0, NULL, NULL); | 78 | if (ret >= 0) |
| 79 | ret = ff_ass_add_rect(sub, buffer.str, s->readorder++, 0, NULL, NULL); | ||
| 79 | av_bprint_finalize(&buffer, NULL); | 80 | av_bprint_finalize(&buffer, NULL); |
| 80 | if (ret < 0) | 81 | if (ret < 0) |
| 81 | return ret; | 82 | return ret; |