mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-13 21:28:01 +02:00
fftools/ffmpeg_sched: track dts+duration as last_dts
This should be slightly (probably negligibly) more accurate for scheduling, but mainly it improves the final reported time. Reported-by: Paul B Mahol
This commit is contained in:
parent
2305091a3a
commit
5c5140ded2
@ -192,7 +192,7 @@ typedef struct SchMuxStream {
|
||||
////////////////////////////////////////////////////////////
|
||||
// The following are protected by Scheduler.schedule_lock //
|
||||
|
||||
/* dts of the last packet sent to this stream
|
||||
/* dts+duration of the last packet sent to this stream
|
||||
in AV_TIME_BASE_Q */
|
||||
int64_t last_dts;
|
||||
// this stream no longer accepts input
|
||||
@ -1625,8 +1625,8 @@ static int send_to_mux(Scheduler *sch, SchMux *mux, unsigned stream_idx,
|
||||
AVPacket *pkt)
|
||||
{
|
||||
SchMuxStream *ms = &mux->streams[stream_idx];
|
||||
int64_t dts = (pkt && pkt->dts != AV_NOPTS_VALUE) ?
|
||||
av_rescale_q(pkt->dts, pkt->time_base, AV_TIME_BASE_Q) :
|
||||
int64_t dts = (pkt && pkt->dts != AV_NOPTS_VALUE) ?
|
||||
av_rescale_q(pkt->dts + pkt->duration, pkt->time_base, AV_TIME_BASE_Q) :
|
||||
AV_NOPTS_VALUE;
|
||||
|
||||
// queue the packet if the muxer cannot be started yet
|
||||
|
Loading…
Reference in New Issue
Block a user