diff options
author | Chriss | 2005-02-09 03:00:50 +0000 |
---|---|---|
committer | Michael Niedermayer | 2005-02-09 03:00:50 +0000 |
commit | 7be806f31b5c07b33d774a3d96f4ae41ff7b7693 (patch) | |
tree | 87e8229b0be3d8b58bfa2c976f4a39355ae4fe23 | |
parent | cb43c0e10d8feb1d3e0a4f72b18fac120c5bf22d (diff) |
-target dvd minimum vobu length patch by ("Chris" [chris garveycocker com])
Originally committed as revision 3953 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/mpeg.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c index e512752dc2..6399cf3062 100644 --- a/libavformat/mpeg.c +++ b/libavformat/mpeg.c @@ -47,6 +47,7 @@ typedef struct { int lpcm_align; uint8_t *fifo_iframe_ptr; int align_iframe; + int64_t vobu_start_pts; } StreamInfo; typedef struct { @@ -1176,9 +1177,10 @@ static int mpeg_mux_write_packet(AVFormatContext *ctx, AVPacket *pkt) fifo_realloc(&stream->fifo, fifo_size(&stream->fifo, NULL) + size + 1); if (s->is_dvd){ - if (is_iframe) { + if (is_iframe && (s->packet_number == 0 || (pts - stream->vobu_start_pts >= 36000))) { // min VOBU length 0.4 seconds (mpucoder) stream->fifo_iframe_ptr = stream->fifo.wptr; stream->align_iframe = 1; + stream->vobu_start_pts = pts; } else { stream->align_iframe = 0; } |