Commit 85cb8ff3 authored by michael's avatar michael

Disable MPEG1/2 style timestamp calculation for H264 it still randomizes

the timestamps because delay is not known for the first few frames.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@17674 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 0621f664
...@@ -859,7 +859,8 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st, ...@@ -859,7 +859,8 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
// av_log(NULL, AV_LOG_DEBUG, "IN delayed:%d pts:%"PRId64", dts:%"PRId64" cur_dts:%"PRId64" st:%d pc:%p\n", presentation_delayed, pkt->pts, pkt->dts, st->cur_dts, pkt->stream_index, pc); // av_log(NULL, AV_LOG_DEBUG, "IN delayed:%d pts:%"PRId64", dts:%"PRId64" cur_dts:%"PRId64" st:%d pc:%p\n", presentation_delayed, pkt->pts, pkt->dts, st->cur_dts, pkt->stream_index, pc);
/* interpolate PTS and DTS if they are not present */ /* interpolate PTS and DTS if they are not present */
if(delay==0 || (delay==1 && pc)){ //We skip H264 currently because delay and has_b_frames are not reliably set
if((delay==0 || (delay==1 && pc)) && st->codec->codec_id != CODEC_ID_H264){
if (presentation_delayed) { if (presentation_delayed) {
/* DTS = decompression timestamp */ /* DTS = decompression timestamp */
/* PTS = presentation timestamp */ /* PTS = presentation timestamp */
...@@ -907,7 +908,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st, ...@@ -907,7 +908,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
FFSWAP(int64_t, st->pts_buffer[i], st->pts_buffer[i+1]); FFSWAP(int64_t, st->pts_buffer[i], st->pts_buffer[i+1]);
if(pkt->dts == AV_NOPTS_VALUE) if(pkt->dts == AV_NOPTS_VALUE)
pkt->dts= st->pts_buffer[0]; pkt->dts= st->pts_buffer[0];
if(delay>1){ if(st->codec->codec_id == CODEC_ID_H264){ //we skiped it above so we try here
update_initial_timestamps(s, pkt->stream_index, pkt->dts, pkt->pts); // this should happen on the first packet update_initial_timestamps(s, pkt->stream_index, pkt->dts, pkt->pts); // this should happen on the first packet
} }
if(pkt->dts > st->cur_dts) if(pkt->dts > st->cur_dts)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment