int in_packet;
} DVBSubParseContext;
-static int dvbsub_parse_init(AVCodecParserContext *s)
+static av_cold int dvbsub_parse_init(AVCodecParserContext *s)
{
DVBSubParseContext *pc = s->priv_data;
pc->packet_buf = av_malloc(PARSE_BUF_SIZE);
s->fetch_timestamp = 1;
- if (s->last_pts != s->pts && s->last_pts != AV_NOPTS_VALUE) /* Start of a new packet */
+ if (s->last_pts != s->pts && s->pts != AV_NOPTS_VALUE) /* Start of a new packet */
{
if (pc->packet_index != pc->packet_start)
{
pc->packet_start = *poutbuf_size;
}
- if (s->last_pts == AV_NOPTS_VALUE)
- s->last_pts = s->pts;
+ if (s->pts == AV_NOPTS_VALUE)
+ s->pts = s->last_pts;
return buf_size;
}
-static void dvbsub_parse_close(AVCodecParserContext *s)
+static av_cold void dvbsub_parse_close(AVCodecParserContext *s)
{
DVBSubParseContext *pc = s->priv_data;
av_freep(&pc->packet_buf);