]> git.sesse.net Git - vlc/blobdiff - modules/demux/mpeg/m4v.c
Improvements to preferences
[vlc] / modules / demux / mpeg / m4v.c
index e0e4c9d4927f9806458d358b54f90d6e9f542b9d..584b2c5a9423a03fe43c297e2d3699bc5fbff525 100644 (file)
@@ -37,6 +37,8 @@ static int  Open ( vlc_object_t * );
 static void Close( vlc_object_t * );
 
 vlc_module_begin();
+    set_category( CAT_INPUT );
+    set_subcategory( SUBCAT_INPUT_DEMUX );
     set_description( _("MPEG-4 video demuxer" ) );
     set_capability( "demux2", 0 );
     set_callbacks( Open, Close );
@@ -172,12 +174,25 @@ static int Demux( demux_t *p_demux)
         {
             block_t *p_next = p_block_out->p_next;
 
+            if( p_sys->p_es == NULL )
+            {
+                p_sys->p_packetizer->fmt_out.b_packetized = VLC_TRUE;
+                p_sys->p_es = es_out_Add( p_demux->out, &p_sys->p_packetizer->fmt_out);
+            }
+
             es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_sys->i_dts );
 
+            p_block_out->p_next = NULL;
+            if( p_block_out->i_pts == p_block_out->i_dts )
+            {
+                p_block_out->i_pts = p_sys->i_dts;
+            }
+            else
+            {
+                p_block_out->i_pts = 0;
+            }
             p_block_out->i_dts = p_sys->i_dts;
-            p_block_out->i_pts = 0;
 
-            p_block_out->p_next = NULL;
             es_out_Send( p_demux->out, p_sys->p_es, p_block_out );
 
             p_block_out = p_next;