diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2008-10-18 22:41:21 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2008-10-18 22:41:21 +0000 |
commit | f781f748b91aebf96c3e4b2fdaa998e736554ff4 (patch) | |
tree | 57b6561a7ee0771635b8ebb2d10425023b78818a /libavformat | |
parent | 242a2b7ecafd5c18cb4d48665f124b4fa4d05a54 (diff) | |
download | ffmpeg-f781f748b91aebf96c3e4b2fdaa998e736554ff4.tar.gz |
Move code setting delay and presentation_delayed a little up so
that the variables are available sooner.
Originally committed as revision 15640 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/utils.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 1f1a174a04..f4377fed3d 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -824,6 +824,15 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st, int num, den, presentation_delayed, delay, i; int64_t offset; + /* do we have a video B-frame ? */ + delay= st->codec->has_b_frames; + presentation_delayed = 0; + /* XXX: need has_b_frame, but cannot get it if the codec is + not initialized */ + if (delay && + pc && pc->pict_type != FF_B_TYPE) + presentation_delayed = 1; + if(pkt->pts != AV_NOPTS_VALUE && pkt->dts != AV_NOPTS_VALUE && pkt->dts > pkt->pts && st->pts_wrap_bits<63 /*&& pkt->dts-(1LL<<st->pts_wrap_bits) < pkt->pts*/){ pkt->dts -= 1LL<<st->pts_wrap_bits; @@ -850,14 +859,6 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st, pkt->dts += offset; } - /* do we have a video B-frame ? */ - delay= st->codec->has_b_frames; - presentation_delayed = 0; - /* XXX: need has_b_frame, but cannot get it if the codec is - not initialized */ - if (delay && - pc && pc->pict_type != FF_B_TYPE) - presentation_delayed = 1; /* This may be redundant, but it should not hurt. */ if(pkt->dts != AV_NOPTS_VALUE && pkt->pts != AV_NOPTS_VALUE && pkt->pts > pkt->dts) presentation_delayed = 1; |