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

Eric Zhang nicolas.m.zhang at gmail.com
Mon Sep 8 03:11:51 CEST 2008


Hi, zhangal:

    Maybe the element `selector' can do some help for you.

Eric Zhang

2008/9/5 zhangal <alzhang03 at hotmail.com>

> 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 pad
> FAIL_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 pad
> gst_element_set_state(player_status->bin, GST_STATE_PAUSED);
>
> gst_pad_unli nk (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/minigame>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20080908/ae40f914/attachment.htm>


More information about the gstreamer-devel mailing list