changeset 29339:0aa5dc20aee5

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.
author reimar
date Tue, 23 Jun 2009 09:35:20 +0000
parents dc46f6bc4610
children 6abc7c14f271
files libmpdemux/demux_ts.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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);