]> git.sesse.net Git - vlc/blobdiff - modules/demux/ps.h
avformat: fix non-file usage after [1644d683e9df]
[vlc] / modules / demux / ps.h
index 3edca03e4003e0a86581d452ee7b19b96a43cfdd..c432faa3eb35f656c9920d68fa57861a70712c5d 100644 (file)
@@ -112,11 +112,11 @@ static inline int ps_track_fill( ps_track_t *tk, ps_psm_t *p_psm, int i_id )
         }
         else if( ( i_id&0xff ) == 0x70 )
         {
-            es_format_Init( &tk->fmt, SPU_ES, VLC_FOURCC('o','g','t',' ') );
+            es_format_Init( &tk->fmt, SPU_ES, VLC_CODEC_OGT );
         }
         else if( ( i_id&0xfc ) == 0x00 )
         {
-            es_format_Init( &tk->fmt, SPU_ES, VLC_FOURCC('c','v','d',' ') );
+            es_format_Init( &tk->fmt, SPU_ES, VLC_CODEC_CVD );
         }
         else if( ( i_id&0xff ) == 0x10 )
         {
@@ -460,19 +460,19 @@ static inline int ps_pkt_parse_pes( block_t *p_pes, int i_skip_extra )
 
                 if(  header[i_skip]&0x20 )
                 {
-                     p_pes->i_pts = ((mtime_t)(header[i_skip]&0x0e ) << 29)|
-                                     (mtime_t)(header[i_skip+1] << 22)|
-                                    ((mtime_t)(header[i_skip+2]&0xfe) << 14)|
-                                     (mtime_t)(header[i_skip+3] << 7)|
-                                     (mtime_t)(header[i_skip+4] >> 1);
+                     i_pts = ((mtime_t)(header[i_skip]&0x0e ) << 29)|
+                              (mtime_t)(header[i_skip+1] << 22)|
+                             ((mtime_t)(header[i_skip+2]&0xfe) << 14)|
+                              (mtime_t)(header[i_skip+3] << 7)|
+                              (mtime_t)(header[i_skip+4] >> 1);
 
                     if( header[i_skip]&0x10 )    /* has dts */
                     {
-                         p_pes->i_dts = ((mtime_t)(header[i_skip+5]&0x0e ) << 29)|
-                                         (mtime_t)(header[i_skip+6] << 22)|
-                                        ((mtime_t)(header[i_skip+7]&0xfe) << 14)|
-                                         (mtime_t)(header[i_skip+8] << 7)|
-                                         (mtime_t)(header[i_skip+9] >> 1);
+                         i_dts = ((mtime_t)(header[i_skip+5]&0x0e ) << 29)|
+                                  (mtime_t)(header[i_skip+6] << 22)|
+                                 ((mtime_t)(header[i_skip+7]&0xfe) << 14)|
+                                  (mtime_t)(header[i_skip+8] << 7)|
+                                  (mtime_t)(header[i_skip+9] >> 1);
                          i_skip += 10;
                     }
                     else
@@ -674,9 +674,15 @@ static inline int ps_psm_fill( ps_psm_t *p_psm, block_t *p_pkt,
         if( ps_track_fill( &tk_tmp, p_psm, tk[i].i_id ) != VLC_SUCCESS )
             continue;
 
-        if( tk_tmp.fmt.i_codec == tk[i].fmt.i_codec ) continue;
+        if( tk_tmp.fmt.i_codec == tk[i].fmt.i_codec )
+        {
+            es_format_Clean( &tk_tmp.fmt );
+            continue;
+        }
 
         es_out_Del( out, tk[i].es );
+        es_format_Clean( &tk[i].fmt );
+
         tk[i] = tk_tmp;
         tk[i].b_seen = true;
         tk[i].es = es_out_Add( out, &tk[i].fmt );