]> git.sesse.net Git - vlc/blobdiff - modules/demux/nuv.c
Add dummy, probably-not-even-compiling sdi.c.
[vlc] / modules / demux / nuv.c
index 257efd6e7d95160b0e5bb943f134da70c6fc29bc..3fbcfa5cf381fb3439414f83233587a613895ad3 100644 (file)
@@ -283,8 +283,10 @@ static int Open( vlc_object_t * p_this )
         if( !p_sys->b_seekable )
             msg_Warn( p_demux, "stream is not seekable, skipping seektable" );
         else if( SeekTableLoad( p_demux, p_sys ) )
-            goto error;
-
+        {
+            p_sys->b_index = false;
+            msg_Warn( p_demux, "Seektable is broken, seek won't be accurate" );
+        }
     }
     else
     {
@@ -306,7 +308,8 @@ static int Open( vlc_object_t * p_this )
         fmt.video.i_height = p_sys->hdr.i_height;
         fmt.i_extra = p_sys->i_extra_f;
         fmt.p_extra = p_sys->p_extra_f;
-        fmt.video.i_aspect = VOUT_ASPECT_FACTOR * p_sys->hdr.d_aspect;
+        fmt.video.i_sar_num = p_sys->hdr.d_aspect * fmt.video.i_height;
+        fmt.video.i_sar_den = fmt.video.i_width;
 
         p_sys->p_es_video = es_out_Add( p_demux->out, &fmt );
     }
@@ -388,18 +391,20 @@ static int Demux( demux_t *p_demux )
     if( ( p_data = stream_Block( p_demux->s, fh.i_length ) ) == NULL )
         return 0;
 
-    p_data->i_dts = (int64_t)fh.i_timecode * 1000;
-    p_data->i_pts = (fh.i_type == 'V') ? 0 : p_data->i_dts;
+    p_data->i_dts = VLC_TS_0 + (int64_t)fh.i_timecode * 1000;
+    p_data->i_pts = (fh.i_type == 'V') ? VLC_TS_INVALID : p_data->i_dts;
 
     /* only add keyframes to index */
     if( !fh.i_keyframe && !p_sys->b_index )
-        demux_IndexAppend( &p_sys->idx, p_data->i_dts, stream_Tell(p_demux->s) - NUV_FH_SIZE );
+        demux_IndexAppend( &p_sys->idx,
+                           p_data->i_dts - VLC_TS_0,
+                           stream_Tell(p_demux->s) - NUV_FH_SIZE );
 
     /* */
-    if( p_data->i_dts > p_sys->i_pcr )
+    if( p_sys->i_pcr < 0 || p_sys->i_pcr < p_data->i_dts - VLC_TS_0 )
     {
-        p_sys->i_pcr = p_data->i_dts;
-        es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_sys->i_pcr );
+        p_sys->i_pcr = p_data->i_dts - VLC_TS_0;
+        es_out_Control( p_demux->out, ES_OUT_SET_PCR, VLC_TS_0 + p_sys->i_pcr );
     }
 
     if( fh.i_type == 'A' && p_sys->p_es_audio )