changeset 674:b2ee9f2492d7 libavformat

-target dvd minimum vobu length patch by ("Chris" [chris garveycocker com])
author michael
date Wed, 09 Feb 2005 03:00:50 +0000
parents 8e67ff57ac9c
children 29a19aec26b2
files mpeg.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mpeg.c	Tue Feb 08 00:38:24 2005 +0000
+++ b/mpeg.c	Wed Feb 09 03:00:50 2005 +0000
@@ -47,6 +47,7 @@
     int lpcm_align;
     uint8_t *fifo_iframe_ptr;
     int align_iframe;
+    int64_t vobu_start_pts;
 } StreamInfo;
 
 typedef struct {
@@ -1176,9 +1177,10 @@
     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;
         }