Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2011-11-28 14:15:06 +0400
committerAnton Khirnov <anton@khirnov.net>2011-11-30 10:47:43 +0400
commit741a05a2936505476ec0ff484d1251276635af73 (patch)
treed29d7aa3164b6cabea02799b1c99d4a7f726d650 /avconv.c
parent2092232581468e3d656805e2b0effd14092dc6f5 (diff)
avconv: compute next_pts from input packet duration when possible.
Diffstat (limited to 'avconv.c')
-rw-r--r--avconv.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/avconv.c b/avconv.c
index 067678d637..ab0d4eca20 100644
--- a/avconv.c
+++ b/avconv.c
@@ -1747,7 +1747,9 @@ static int transcode_video(InputStream *ist, AVPacket *pkt, int *got_output, int
}
ist->next_pts = ist->pts = guess_correct_pts(&ist->pts_ctx, decoded_frame->pkt_pts,
decoded_frame->pkt_dts);
- if (ist->st->codec->time_base.num != 0) {
+ if (pkt->duration)
+ ist->next_pts += av_rescale_q(pkt->duration, ist->st->time_base, AV_TIME_BASE_Q);
+ else if (ist->st->codec->time_base.num != 0) {
int ticks = ist->st->parser ? ist->st->parser->repeat_pict + 1 :
ist->st->codec->ticks_per_frame;
ist->next_pts += ((int64_t)AV_TIME_BASE *