]> git.sesse.net Git - vlc/blobdiff - modules/demux/pva.c
Use var_Inherit* instead of var_CreateGet*.
[vlc] / modules / demux / pva.c
index 6b449bd43f9ecaaad08f76d3f0e0e945cde991ee..b02f8ddff17820d5a8e270ce64eef2f9ff9d9505 100644 (file)
@@ -99,9 +99,11 @@ static int Open( vlc_object_t *p_this )
 
     /* Register one audio and one video stream */
     es_format_Init( &fmt, AUDIO_ES, VLC_CODEC_MPGA );
+    fmt.b_packetized = false;
     p_sys->p_audio = es_out_Add( p_demux->out, &fmt );
 
     es_format_Init( &fmt, VIDEO_ES, VLC_CODEC_MPGV );
+    fmt.b_packetized = false;
     p_sys->p_video = es_out_Add( p_demux->out, &fmt );
 
     p_sys->i_vc    = -1;
@@ -207,7 +209,7 @@ static int Demux( demux_t *p_demux )
                 if( ( p_frame = p_sys->p_es ) )
                 {
 
-                    if( p_frame->i_pts > 0 && !p_sys->b_pcr_audio )
+                    if( p_frame->i_pts > VLC_TS_INVALID && !p_sys->b_pcr_audio )
                     {
                         es_out_Control( p_demux->out, ES_OUT_SET_PCR, (int64_t)p_frame->i_pts);
                     }
@@ -221,7 +223,8 @@ static int Demux( demux_t *p_demux )
             {
                 p_frame->p_buffer += i_skip;
                 p_frame->i_buffer -= i_skip;
-                if( i_pts > 0 ) p_frame->i_pts = i_pts * 100 / 9;
+                if( i_pts >= 0 )
+                    p_frame->i_pts = VLC_TS_0 + i_pts * 100 / 9;
                 block_ChainAppend( &p_sys->p_es, p_frame );
             }
             break;
@@ -427,8 +430,10 @@ static void ParsePES( demux_t *p_demux )
     p_pes->i_buffer -= i_skip;
     p_pes->p_buffer += i_skip;
 
-    if( i_dts >= 0 ) p_pes->i_dts = i_dts * 100 / 9;
-    if( i_pts >= 0 ) p_pes->i_pts = i_pts * 100 / 9;
+    if( i_dts >= 0 )
+        p_pes->i_dts = VLC_TS_0 + i_dts * 100 / 9;
+    if( i_pts >= 0 )
+        p_pes->i_pts = VLC_TS_0 + i_pts * 100 / 9;
 
     /* Set PCR */
     if( p_pes->i_pts > 0 )