aboutsummaryrefslogtreecommitdiffstats
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorNicolas George <nicolas.george@normalesup.org>2012-07-25 19:45:16 +0200
committerNicolas George <nicolas.george@normalesup.org>2012-08-09 11:03:22 +0200
commitaed032c25b08a1056c03bd2646d8482f5c0aba73 (patch)
tree6a9ab92d7b94b207d54d816c0635a3eaff412e1b /ffmpeg.c
parentcc650cf029d8a2aa3c245b014363db673fd2d722 (diff)
downloadffmpeg-aed032c25b08a1056c03bd2646d8482f5c0aba73.tar.gz
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.
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c2
1 files changed, 2 insertions, 0 deletions
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) {