]> git.sesse.net Git - vlc/blobdiff - src/input/es_out.c
* include/vlc_block.h: added a temporary i_rate field to block_t.
[vlc] / src / input / es_out.c
index 2fcea0b4dba23e253de872feea106577f99299db..8ae0dc8e977ac89730bac5b60048b264faf9640a 100644 (file)
@@ -2,7 +2,7 @@
  * es_out.c: Es Out handler for input.
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: es_out.c,v 1.8 2003/12/07 17:17:04 gbazin Exp $
+ * $Id: es_out.c,v 1.11 2003/12/24 09:46:08 gbazin Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -344,7 +344,7 @@ static es_out_id_t *EsOutAdd( es_out_t *out, es_format_t *fmt )
             case AUDIO_ES:
                 if( fmt->psz_description )
                 {
-                    input_AddInfo( p_cat, _("Description"), "%s", 
+                    input_AddInfo( p_cat, _("Description"), "%s",
                                    fmt->psz_description );
                 }
                 input_AddInfo( p_cat, _("Codec"), "%.4s",
@@ -357,29 +357,29 @@ static es_out_id_t *EsOutAdd( es_out_t *out, es_format_t *fmt )
                 }
                 if( fmt->psz_language )
                 {
-                    input_AddInfo( p_cat, _("Language"), "%s", 
+                    input_AddInfo( p_cat, _("Language"), "%s",
                                    fmt->psz_language );
                 }
                 if( fmt->audio.i_rate > 0 )
                 {
-                  input_AddInfo( p_cat, _("Sample Rate"), _("%d Hz"),
+                  input_AddInfo( p_cat, _("Sample rate"), _("%d Hz"),
                                    fmt->audio.i_rate );
                 }
                 if( fmt->i_bitrate > 0 )
                 {
-                  input_AddInfo( p_cat, _("Bitrate"), _("%d bps"), 
+                  input_AddInfo( p_cat, _("Bitrate"), _("%d bps"),
                                    fmt->i_bitrate );
                 }
                 if( fmt->audio.i_bitspersample )
                 {
-                    input_AddInfo( p_cat, _("Bits Per Sample"), "%d",
+                    input_AddInfo( p_cat, _("Bits per sample"), "%d",
                                    fmt->audio.i_bitspersample );
                 }
                 break;
             case VIDEO_ES:
                 if( fmt->psz_description )
                 {
-                    input_AddInfo( p_cat, _("Description"), "%s", 
+                    input_AddInfo( p_cat, _("Description"), "%s",
                                    fmt->psz_description );
                 }
                 input_AddInfo( p_cat, _("Type"), _("Video") );
@@ -393,7 +393,7 @@ static es_out_id_t *EsOutAdd( es_out_t *out, es_format_t *fmt )
                 if( fmt->video.i_visible_width > 0 &&
                     fmt->video.i_visible_height > 0 )
                 {
-                    input_AddInfo( p_cat, _("Display Resolution"), "%dx%d",
+                    input_AddInfo( p_cat, _("Display resolution"), "%dx%d",
                                    fmt->video.i_visible_width,
                                    fmt->video.i_visible_height);
                 }
@@ -465,7 +465,9 @@ static int EsOutSend( es_out_t *out, es_out_id_t *es, block_t *p_block )
     }
 
     vlc_mutex_lock( &out->p_sys->p_input->stream.stream_lock );
-    if( es->p_es->p_dec )
+    p_block->i_rate = out->p_sys->p_input->stream.control.i_rate;
+    if( es->p_es->p_dec &&
+        (es->p_es->i_cat!=AUDIO_ES || !p_sys->p_input->stream.control.b_mute) )
     {
         input_DecodeBlock( es->p_es->p_dec, p_block );
     }
@@ -519,6 +521,10 @@ static void EsOutDel( es_out_t *out, es_out_id_t *es )
     }
     input_DelES( p_sys->p_input, es->p_es );
 
+    if( p_sys->p_es_audio == es ) p_sys->p_es_audio = NULL;
+    if( p_sys->p_es_video == es ) p_sys->p_es_video = NULL;
+    if( p_sys->p_es_sub   == es ) p_sys->p_es_sub   = NULL;
+
     vlc_mutex_unlock( &p_sys->p_input->stream.stream_lock );
 
     free( es );