# HG changeset patch # User reimar # Date 1245749720 0 # Node ID 0aa5dc20aee596020091220e319af44e283bac5b # Parent dc46f6bc4610b95874f354fb99ce0ce242c6a838 Move printing of ID_AID_???_LANG to ts_add_stream instead of ts_detect_streams. This makes sure it is printed only once per track and after ID_AUDIO_ID. diff -r dc46f6bc4610 -r 0aa5dc20aee5 libmpdemux/demux_ts.c --- a/libmpdemux/demux_ts.c Tue Jun 23 09:33:42 2009 +0000 +++ b/libmpdemux/demux_ts.c Tue Jun 23 09:35:20 2009 +0000 @@ -286,6 +286,7 @@ } static int parse_avc_sps(uint8_t *buf, int len, int *w, int *h); +static inline uint8_t *pid_lang_from_pmt(ts_priv_t *priv, int pid); static void ts_add_stream(demuxer_t * demuxer, ES_stream_t *es) { @@ -300,6 +301,7 @@ sh_audio_t *sh = new_sh_audio_aid(demuxer, priv->last_aid, es->pid); if(sh) { + const char *lang = pid_lang_from_pmt(priv, es->pid); sh->format = IS_AUDIO(es->type) ? es->type : es->subtype; sh->ds = demuxer->audio; @@ -307,6 +309,8 @@ priv->ts.streams[es->pid].sh = sh; priv->ts.streams[es->pid].type = TYPE_AUDIO; mp_msg(MSGT_DEMUX, MSGL_V, "\r\nADDED AUDIO PID %d, type: %x stream n. %d\r\n", es->pid, sh->format, priv->last_aid); + if (lang && lang[0]) + mp_msg(MSGT_IDENTIFY, MSGL_V, "ID_AID_%d_LANG=%s\n", es->pid, lang); priv->last_aid++; } @@ -706,8 +710,6 @@ } else if(is_audio) { - if (es.lang[0] > 0) - mp_msg(MSGT_IDENTIFY, MSGL_V, "ID_AID_%d_LANG=%s\n", es.pid, es.lang); if(req_apid > 0) { chosen_pid = (req_apid == es.pid);