ffmpeg: call sub2video_update for end packets.
authorNicolas George <nicolas.george@normalesup.org>
Sun, 9 Sep 2012 13:53:21 +0000 (15:53 +0200)
committerNicolas George <nicolas.george@normalesup.org>
Sat, 15 Sep 2012 13:58:42 +0000 (15:58 +0200)
Without that change, all subtitles will stay until the next one.

ffmpeg.c

index 4d12f80..45b109b 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1683,13 +1683,13 @@ static int transcode_subtitles(InputStream *ist, AVPacket *pkt, int *got_output)
         FFSWAP(AVSubtitle, subtitle,    ist->prev_sub.subtitle);
     }
 
         FFSWAP(AVSubtitle, subtitle,    ist->prev_sub.subtitle);
     }
 
+    sub2video_update(ist, &subtitle, pkt->pts);
+
     if (!*got_output || !subtitle.num_rects)
         return ret;
 
     rate_emu_sleep(ist);
 
     if (!*got_output || !subtitle.num_rects)
         return ret;
 
     rate_emu_sleep(ist);
 
-    sub2video_update(ist, &subtitle, pkt->pts);
-
     for (i = 0; i < nb_output_streams; i++) {
         OutputStream *ost = output_streams[i];
 
     for (i = 0; i < nb_output_streams; i++) {
         OutputStream *ost = output_streams[i];