[FFmpeg-cvslog] mpegpsenc: Fix SCR handling for DVD

Michael Niedermayer git at videolan.org
Fri Jan 4 21:04:40 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Jan  4 19:50:48 2013 +0100| [2a23f6035ec4234bd2ea1143e9d5af90469ed669] | committer: Michael Niedermayer

mpegpsenc: Fix SCR handling for DVD

This makes the initial SCR equal 0

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2a23f6035ec4234bd2ea1143e9d5af90469ed669
---

 ffmpeg_opt.c          |    2 --
 libavformat/mpegenc.c |    4 +++-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index c01ef42..63e3de9 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -1922,8 +1922,6 @@ static int opt_target(void *optctx, const char *opt, const char *arg)
         av_dict_set(&o->g->codec_opts, "b:a", "448000", 0);
         parse_option(o, "ar", "48000", options);
 
-        av_dict_set(&o->g->format_opts, "avoid_negative_ts", "1", 0);
-
     } else if (!strncmp(arg, "dv", 2)) {
 
         parse_option(o, "f", "dv", options);
diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c
index 5d2757a..ef8d762 100644
--- a/libavformat/mpegenc.c
+++ b/libavformat/mpegenc.c
@@ -1062,7 +1062,9 @@ static int mpeg_mux_write_packet(AVFormatContext *ctx, AVPacket *pkt)
     dts= pkt->dts;
 
     if (s->last_scr == AV_NOPTS_VALUE) {
-        if (dts == AV_NOPTS_VALUE ) {
+        if (dts == AV_NOPTS_VALUE || s->is_dvd) {
+            if (dts != AV_NOPTS_VALUE)
+                s->preload += av_rescale(-dts, AV_TIME_BASE, 90000);
             s->last_scr = 0;
         } else {
             s->last_scr = dts + preload;



More information about the ffmpeg-cvslog mailing list