| OLD | NEW |
| 1 /* | 1 /* |
| 2 * XSUB subtitle decoder | 2 * XSUB subtitle decoder |
| 3 * Copyright (c) 2007 Reimar Döffinger | 3 * Copyright (c) 2007 Reimar Döffinger |
| 4 * | 4 * |
| 5 * This file is part of FFmpeg. | 5 * This file is part of FFmpeg. |
| 6 * | 6 * |
| 7 * FFmpeg is free software; you can redistribute it and/or | 7 * FFmpeg is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Lesser General Public | 8 * modify it under the terms of the GNU Lesser General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2.1 of the License, or (at your option) any later version. | 10 * version 2.1 of the License, or (at your option) any later version. |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 } | 70 } |
| 71 if (avpkt->pts != AV_NOPTS_VALUE) | 71 if (avpkt->pts != AV_NOPTS_VALUE) |
| 72 packet_time = av_rescale_q(avpkt->pts, AV_TIME_BASE_Q, (AVRational){1, 1
000}); | 72 packet_time = av_rescale_q(avpkt->pts, AV_TIME_BASE_Q, (AVRational){1, 1
000}); |
| 73 sub->start_display_time = parse_timecode(buf + 1, packet_time); | 73 sub->start_display_time = parse_timecode(buf + 1, packet_time); |
| 74 sub->end_display_time = parse_timecode(buf + 14, packet_time); | 74 sub->end_display_time = parse_timecode(buf + 14, packet_time); |
| 75 buf += 27; | 75 buf += 27; |
| 76 | 76 |
| 77 // read header | 77 // read header |
| 78 w = bytestream_get_le16(&buf); | 78 w = bytestream_get_le16(&buf); |
| 79 h = bytestream_get_le16(&buf); | 79 h = bytestream_get_le16(&buf); |
| 80 if (av_check_image_size(w, h, 0, avctx) < 0) | 80 if (av_image_check_size(w, h, 0, avctx) < 0) |
| 81 return -1; | 81 return -1; |
| 82 x = bytestream_get_le16(&buf); | 82 x = bytestream_get_le16(&buf); |
| 83 y = bytestream_get_le16(&buf); | 83 y = bytestream_get_le16(&buf); |
| 84 // skip bottom right position, it gives no new information | 84 // skip bottom right position, it gives no new information |
| 85 bytestream_get_le16(&buf); | 85 bytestream_get_le16(&buf); |
| 86 bytestream_get_le16(&buf); | 86 bytestream_get_le16(&buf); |
| 87 rlelen = bytestream_get_le16(&buf); | 87 rlelen = bytestream_get_le16(&buf); |
| 88 | 88 |
| 89 // allocate sub and set values | 89 // allocate sub and set values |
| 90 sub->rects = av_mallocz(sizeof(*sub->rects)); | 90 sub->rects = av_mallocz(sizeof(*sub->rects)); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 "xsub", | 135 "xsub", |
| 136 AVMEDIA_TYPE_SUBTITLE, | 136 AVMEDIA_TYPE_SUBTITLE, |
| 137 CODEC_ID_XSUB, | 137 CODEC_ID_XSUB, |
| 138 0, | 138 0, |
| 139 decode_init, | 139 decode_init, |
| 140 NULL, | 140 NULL, |
| 141 NULL, | 141 NULL, |
| 142 decode_frame, | 142 decode_frame, |
| 143 .long_name = NULL_IF_CONFIG_SMALL("XSUB"), | 143 .long_name = NULL_IF_CONFIG_SMALL("XSUB"), |
| 144 }; | 144 }; |
| OLD | NEW |