diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2010-10-16 21:31:31 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2010-10-16 21:31:31 +0000 |
commit | 94bdb1f80ce8d8abc4728ba0c8edc6af4310eaaf (patch) | |
tree | 2e17c38eaba4ad48be5104603131f9ae08868d5b /libavformat/mpegenc.c | |
parent | d721141f544be6e4ec78a8731db8f2e0e1fb5c15 (diff) | |
download | ffmpeg-94bdb1f80ce8d8abc4728ba0c8edc6af4310eaaf.tar.gz |
Avoid negative SCR in mpeg ps muxer.
Fixes a scr issue reported with dvdauthor ([FFmpeg-user] FFMPEG encoded MPEG-2 video causes error in DVDAuthor)
Originally committed as revision 25512 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mpegenc.c')
-rw-r--r-- | libavformat/mpegenc.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c index affc801b4a..5c090f63b0 100644 --- a/libavformat/mpegenc.c +++ b/libavformat/mpegenc.c @@ -1162,11 +1162,13 @@ static int mpeg_mux_write_packet(AVFormatContext *ctx, AVPacket *pkt) pts= pkt->pts; dts= pkt->dts; - if(!s->last_scr) - s->last_scr= dts; - if(pts != AV_NOPTS_VALUE) pts += preload; - if(dts != AV_NOPTS_VALUE) dts += preload; + if(pts != AV_NOPTS_VALUE) pts += 2*preload; + if(dts != AV_NOPTS_VALUE){ + if(!s->last_scr) + s->last_scr= dts + preload; + dts += 2*preload; + } //av_log(ctx, AV_LOG_DEBUG, "dts:%f pts:%f flags:%d stream:%d nopts:%d\n", dts/90000.0, pts/90000.0, pkt->flags, pkt->stream_index, pts != AV_NOPTS_VALUE); if (!stream->premux_packet) |