<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 9pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>Hi, <BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; I met some movies(like *.mkv and *.avi files) which include multi audio tracks and then my application can not switch audio when playback. <BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp; I tried to just unlink the demuxer and the audio decoder and then called gst-element-get-pad() to get another audio pad which will be linked to the audio decoder that is able to decode the audio. But I can not hear anything. The code looks like following <BR>&nbsp;<BR>GstPad *src_pad, *sink_pad, *demux_src;&nbsp;<BR>&nbsp;<BR>FAIL_CHECK (NULL == (demux_src = gst_element_get_pad(demuxer,"audio_01")));//Get anotherdemuxer source pad<BR>FAIL_CHECK (NULL == (sink_pad = gst_element_get_pad(a_decoder, "sink")));//&nbsp;Get audio decoder&nbsp;sink pad<BR>&nbsp; <BR>src_pad = gst_pad_get_peer(sink_pad);//get the audio pad connected to decoder sink pad<BR>gst_element_set_state(player_status-&gt;bin, GST_STATE_PAUSED);&nbsp;<BR><BR>gst_pad_unlink (src_pad, sink_pad);<BR><BR>gst_pad_link(demux_src, sink_pad);<BR><BR>gst_object_unref(src_pad); &nbsp;<BR>gst_object_unref(sink_pad); <BR>gst_object_unref(demux_src);<BR><BR>gst_element_set_state(player_status-&gt;bin, GST_STATE_PLAYING);<BR><BR>//End<BR>
&nbsp;<BR>
It seems that does not work well. Does anyone have the idea about this?<BR>
&nbsp;<BR>
Thanks a lot<BR>
&nbsp;<BR>
&nbsp;<BR><br /><hr />MSN上小游戏,工作休闲两不误! <a href='http://im.live.cn/minigame' target='_new'>马上就开始玩!</a></body>
</html>