mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
ffmpeg: use PTS from the AVSubtitle structure for sub2video.
This commit is contained in:
parent
2939e258f9
commit
a9e4817716
5
ffmpeg.c
5
ffmpeg.c
@ -202,13 +202,14 @@ static void sub2video_push_ref(InputStream *ist, int64_t pts)
|
|||||||
AV_BUFFERSRC_FLAG_PUSH);
|
AV_BUFFERSRC_FLAG_PUSH);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sub2video_update(InputStream *ist, AVSubtitle *sub, int64_t pts)
|
static void sub2video_update(InputStream *ist, AVSubtitle *sub)
|
||||||
{
|
{
|
||||||
int w = ist->sub2video.w, h = ist->sub2video.h;
|
int w = ist->sub2video.w, h = ist->sub2video.h;
|
||||||
AVFilterBufferRef *ref = ist->sub2video.ref;
|
AVFilterBufferRef *ref = ist->sub2video.ref;
|
||||||
int8_t *dst;
|
int8_t *dst;
|
||||||
int dst_linesize;
|
int dst_linesize;
|
||||||
int i;
|
int i;
|
||||||
|
int64_t pts = av_rescale_q(sub->pts, AV_TIME_BASE_Q, ist->st->time_base);
|
||||||
|
|
||||||
if (!ref)
|
if (!ref)
|
||||||
return;
|
return;
|
||||||
@ -1680,7 +1681,7 @@ 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);
|
sub2video_update(ist, &subtitle);
|
||||||
|
|
||||||
if (!*got_output || !subtitle.num_rects)
|
if (!*got_output || !subtitle.num_rects)
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user