Browse Source

mpegpsenc: Fix SCR handling for DVD

This makes the initial SCR equal 0

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n1.1
Michael Niedermayer 12 years ago
parent
commit
2a23f6035e
2 changed files with 3 additions and 3 deletions
  1. +0
    -2
      ffmpeg_opt.c
  2. +3
    -1
      libavformat/mpegenc.c

+ 0
- 2
ffmpeg_opt.c View File

@@ -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);


+ 3
- 1
libavformat/mpegenc.c View File

@@ -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;


Loading…
Cancel
Save