int id_number;
int object_number;
uint8_t composition_flag;
+ int64_t pts;
} PGSSubPresentation;
typedef struct PGSSubPicture {
* @todo TODO: Implement forcing of subtitles
*/
static void parse_presentation_segment(AVCodecContext *avctx,
- const uint8_t *buf, int buf_size)
+ const uint8_t *buf, int buf_size,
+ int64_t pts)
{
PGSSubContext *ctx = avctx->priv_data;
int w = bytestream_get_be16(&buf);
int h = bytestream_get_be16(&buf);
+ ctx->presentation.pts = pts;
+
av_dlog(avctx, "Video Dimensions %dx%d\n",
w, h);
if (av_image_check_size(w, h, 0, avctx) >= 0)
*/
memset(sub, 0, sizeof(*sub));
+ sub->pts = ctx->presentation.pts;
+
// Blank if last object_number was 0.
// Note that this may be wrong for more complex subtitles.
if (!ctx->presentation.object_number)
parse_picture_segment(avctx, buf, segment_length);
break;
case PRESENTATION_SEGMENT:
- parse_presentation_segment(avctx, buf, segment_length);
+ parse_presentation_segment(avctx, buf, segment_length, avpkt->pts);
break;
case WINDOW_SEGMENT:
/*