Mercurial > mplayer.hg
diff libmpdemux/demuxer.c @ 20872:a8b42366e68a
Make subtitle stream handling more similar to audio and video streams.
author | reimar |
---|---|
date | Mon, 13 Nov 2006 16:15:23 +0000 |
parents | 6602a90a06ec |
children | 7c91b80cabc1 |
line wrap: on
line diff
--- a/libmpdemux/demuxer.c Mon Nov 13 16:03:11 2006 +0000 +++ b/libmpdemux/demuxer.c Mon Nov 13 16:15:23 2006 +0000 @@ -201,6 +201,23 @@ return d; } +sh_sub_t *new_sh_sub_sid(demuxer_t *demuxer, int id, int sid) { + if (id > MAX_S_STREAMS - 1 || id < 0) { + mp_msg(MSGT_DEMUXER,MSGL_WARN,"Requested sub stream id overflow (%d > %d)\n", + id, MAX_S_STREAMS); + return NULL; + } + if (demuxer->s_streams[id]) + mp_msg(MSGT_DEMUXER, MSGL_WARN, "Sub stream %i redefined\n", id); + else { + sh_sub_t *sh = calloc(1, sizeof(sh_sub_t)); + demuxer->s_streams[id] = sh; + sh->sid = sid; + mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_SUBTITLE_ID=%d\n", sid); + } + return demuxer->s_streams[id]; +} + sh_audio_t* new_sh_audio_aid(demuxer_t *demuxer,int id,int aid){ if(id > MAX_A_STREAMS-1 || id < 0) {