[vlc-devel] [PATCH 2/2] TS Mux: error out if PTS is invalid

Rafaël Carré funman at videolan.org
Sun Nov 13 06:27:08 CET 2011


---
 modules/mux/mpeg/ts.c |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/modules/mux/mpeg/ts.c b/modules/mux/mpeg/ts.c
index 0ba3a21..4e3c372 100644
--- a/modules/mux/mpeg/ts.c
+++ b/modules/mux/mpeg/ts.c
@@ -1595,13 +1595,19 @@ static int Mux( sout_mux_t *p_mux )
                             p_stream->i_pes_dts = p_data->i_dts;
                         }
 
-                        /* Convert to pes */
-                        if( p_stream->i_stream_id == 0xa0 &&
-                            p_data->i_pts <= 0 )
+                        if( p_data->i_pts <= 0 )
                         {
-                            /* XXX yes I know, it's awful, but it's needed,
-                             * so don't remove it ... */
-                            p_data->i_pts = p_data->i_dts;
+                            /* Convert to pes */
+                            if( p_stream->i_stream_id == 0xa0 )
+                            {
+                                /* XXX yes I know, it's awful, but it's needed,
+                                 * so don't remove it ... */
+                                p_data->i_pts = p_data->i_dts;
+                            }
+                            else
+                            {
+                                msg_Err( p_mux, "PTS not set" );
+                            }
                         }
 
                         if( p_input->p_fmt->i_codec ==
-- 
1.7.5.4



More information about the vlc-devel mailing list