[vlc-devel] [RFC PATCHv2 15/18] demux: avformat: use stable ids

Thomas Guillem thomas at gllm.fr
Tue Feb 18 17:11:28 CET 2020


Use the track addition order as a track id. It's expected to be always the same
order since tracks are added from the open callback().
---
 modules/demux/avformat/demux.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c
index 744a4e36802..ad8be314031 100644
--- a/modules/demux/avformat/demux.c
+++ b/modules/demux/avformat/demux.c
@@ -712,6 +712,7 @@ int avformat_OpenDemux( vlc_object_t *p_this )
                 }
             }
 
+            es_fmt.i_id = i;
             p_track->p_es = es_out_Add( p_demux->out, &es_fmt );
             if( p_track->p_es && (s->disposition & AV_DISPOSITION_DEFAULT) )
                 es_out_Control( p_demux->out, ES_OUT_SET_ES_DEFAULT, p_track->p_es );
-- 
2.20.1



More information about the vlc-devel mailing list