[gst-devel] How can I switch audio track when play back a multi-audio-track movie?

zhangal alzhang03 at hotmail.com
Fri Sep 5 14:50:53 CEST 2008


Hi,         I met some movies(like *.mkv and *.avi files) which include multi audio tracks and then my application can not switch audio when playback.      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  GstPad *src_pad, *sink_pad, *demux_src;  FAIL_CHECK (NULL == (demux_src = gst_element_get_pad(demuxer,"audio_01")));//Get anotherdemuxer source padFAIL_CHECK (NULL == (sink_pad = gst_element_get_pad(a_decoder, "sink")));// Get audio decoder sink pad  src_pad = gst_pad_get_peer(sink_pad);//get the audio pad connected to decoder sink padgst_element_set_state(player_status->bin, GST_STATE_PAUSED); gst_pad_unlink (src_pad, sink_pad);gst_pad_link(demux_src, sink_pad);gst_object_unref(src_pad);  gst_object_unref(sink_pad); gst_object_unref(demux_src);gst_element_set_state(player_status->bin, GST_STATE_PLAYING);//End
 
It seems that does not work well. Does anyone have the idea about this?
 
Thanks a lot
 
 
_________________________________________________________________
一点即聊,MSN推出新功能“点我!”
http://im.live.cn/click/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20080905/a4071e20/attachment.htm>


More information about the gstreamer-devel mailing list