From aed032c25b08a1056c03bd2646d8482f5c0aba73 Mon Sep 17 00:00:00 2001 From: Nicolas George Date: Wed, 25 Jul 2012 19:45:16 +0200 Subject: dvbsub: fix encoding of termination packets. The old code generates a termination packet with the same regions as the start packet and page_state set to "only what changed"; the result is that the termination packet is decoded as identical to the start packet. The new code does as found in some DVB broadcasts: produce a packet with no regions. This is done by expecting num_rects to be 0 rather than using a flip-flop. ffmpeg.c is updated accordingly. --- ffmpeg.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ffmpeg.c') diff --git a/ffmpeg.c b/ffmpeg.c index ea90ada0ae..b2963bbad0 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -703,6 +703,8 @@ static void do_subtitle_out(AVFormatContext *s, sub->pts += av_rescale_q(sub->start_display_time, (AVRational){ 1, 1000 }, AV_TIME_BASE_Q); sub->end_display_time -= sub->start_display_time; sub->start_display_time = 0; + if (i == 1) + sub->num_rects = 0; subtitle_out_size = avcodec_encode_subtitle(enc, subtitle_out, subtitle_out_max_size, sub); if (subtitle_out_size < 0) { -- cgit v1.2.3