]> git.sesse.net Git - vlc/blobdiff - src/input/es_out.c
i've modified the following functions to properly skip data (read buffer is nil)...
[vlc] / src / input / es_out.c
index c09cfea441f4106e0052b7bd18b2f031b3906ff7..a5f60ab55f44455fad56efb67b939abbf4e33ed2 100644 (file)
@@ -756,8 +756,8 @@ static void EsOutDel( es_out_t *out, es_out_id_t *es )
     es->p_pgrm->i_es--;
     if( es->p_pgrm->i_es == 0 )
     {
-        msg_Err( p_sys->p_input, "Program doesn't contain anymore ES, "
-                 "TODO cleaning ?" );
+        msg_Warn( p_sys->p_input, "Program doesn't contain anymore ES, "
+                  "TODO cleaning ?" );
     }
 
     if( p_sys->p_es_audio == es ) p_sys->p_es_audio = NULL;
@@ -995,9 +995,9 @@ static int EsOutControl( es_out_t *out, int i_query, va_list args )
         {
             /* This ain't pretty but is need by some demuxers (eg. Ogg )
              * to update the p_extra data */
-            es_format_t *p_fmt = (es_format_t*) va_arg( args, es_format_t * );
             es = (es_out_id_t*) va_arg( args, es_out_id_t * );
-            if( es == NULL || !es->p_dec ) return VLC_EGENERIC;
+            es_format_t *p_fmt = (es_format_t*) va_arg( args, es_format_t * );
+            if( es == NULL ) return VLC_EGENERIC;
 
             if( p_fmt->i_extra )
             {
@@ -1005,6 +1005,8 @@ static int EsOutControl( es_out_t *out, int i_query, va_list args )
                 es->fmt.p_extra = realloc( es->fmt.p_extra, p_fmt->i_extra );
                 memcpy( es->fmt.p_extra, p_fmt->p_extra, p_fmt->i_extra );
 
+                if( !es->p_dec ) return VLC_SUCCESS;
+
                 es->p_dec->fmt_in.i_extra = p_fmt->i_extra;
                 es->p_dec->fmt_in.p_extra =
                     realloc( es->p_dec->fmt_in.p_extra, p_fmt->i_extra );