]> git.sesse.net Git - vlc/commitdiff
* all: added a i_id field in es_format_t.
authorLaurent Aimar <fenrir@videolan.org>
Mon, 19 Jan 2004 18:15:29 +0000 (18:15 +0000)
committerLaurent Aimar <fenrir@videolan.org>
Mon, 19 Jan 2004 18:15:29 +0000 (18:15 +0000)
include/vlc_es.h
src/input/es_out.c
src/input/input_dec.c

index 740fa250757b5cb81d49e6fe1dda36f7121c8c2d..60ff56bcb7e122e10669630dd08958e8a00d85e9 100644 (file)
@@ -2,7 +2,7 @@
  * vlc_es.h
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: vlc_es.h,v 1.5 2003/11/24 02:35:50 fenrir Exp $
+ * $Id: vlc_es.h,v 1.6 2004/01/19 18:15:29 fenrir Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -107,6 +107,8 @@ struct es_format_t
     int             i_cat;
     vlc_fourcc_t    i_codec;
 
+    int             i_id;       /* -1: let the core mark the right id
+                                   >=0: valid id */
     int             i_group;    /* -1 : standalone
                                    >= 0 then a "group" (program) is created
                                         for each value */
@@ -140,6 +142,7 @@ static inline void es_format_Init( es_format_t *fmt,
 {
     fmt->i_cat                  = i_cat;
     fmt->i_codec                = i_codec;
+    fmt->i_id                   = -1;
     fmt->i_group                = 0;
     fmt->i_priority             = 0;
     fmt->psz_language           = NULL;
index a0f17a3091b9c4e646f02f2d986d7ee991ad624d..2520de9693026bbae440b8c90e6df8bf8af3d39c 100644 (file)
@@ -2,7 +2,7 @@
  * es_out.c: Es Out handler for input.
  *****************************************************************************
  * Copyright (C) 2003-2004 VideoLAN
- * $Id: es_out.c,v 1.18 2004/01/18 19:35:48 fenrir Exp $
+ * $Id: es_out.c,v 1.19 2004/01/19 18:15:29 fenrir Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -274,13 +274,17 @@ static es_out_id_t *EsOutAdd( es_out_t *out, es_format_t *fmt )
             }
         }
     }
+    if( fmt->i_id < 0 )
+    {
+        fmt->i_id = out->p_sys->i_id - 1;
+    }
 
     es->p_es = input_AddES( p_input,
                             p_prgm,
-                            out->p_sys->i_id,
+                            fmt->i_id + 1,
                             fmt->i_cat,
                             fmt->psz_language, 0 );
-    es->p_es->i_stream_id = out->p_sys->i_id;
+    es->p_es->i_stream_id = fmt->i_id;
     es->p_es->i_fourcc = fmt->i_codec;
 
     switch( fmt->i_cat )
index 14fce9f5c45e3ba15ce7b4c72ca15f062e43e376..0890b003be6dbad37b87421f87e479743f7a9aeb 100644 (file)
@@ -2,7 +2,7 @@
  * input_dec.c: Functions for the management of decoders
  *****************************************************************************
  * Copyright (C) 1999-2004 VideoLAN
- * $Id: input_dec.c,v 1.86 2004/01/18 23:52:02 gbazin Exp $
+ * $Id: input_dec.c,v 1.87 2004/01/19 18:15:29 fenrir Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Gildas Bazin <gbazin@netcourrier.com>
@@ -548,6 +548,7 @@ static int DecoderDecode( decoder_t *p_dec, block_t *p_block )
                     p_dec->p_owner->sout.i_group =
                         p_dec->p_owner->p_es_descriptor->p_pgrm->i_number;
                 }
+                p_dec->p_owner->sout.i_id = p_dec->p_owner->p_es_descriptor->i_id - 1;
 
                 p_dec->p_owner->p_sout =
                     sout_InputNew( p_dec, &p_dec->p_owner->sout );