<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"><head><!--[if gte mso 9]><xml><o:OfficeDocumentSettings><o:AllowPNG/><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml><![endif]--></head><body><div class="ydp238d93b8yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div></div>
        <div dir="ltr" data-setdir="false">Another weird thing happened when I switched the audio devices too quickly. The ref count of the sink was 6 once. This is very strange.</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">   Joe<br></div><div><br></div>
        
        </div><div id="yahoo_quoted_6687150634" class="yahoo_quoted">
            <div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
                
                <div>
                    On Friday, October 6, 2023, 12:00:42 p.m. EDT, cfd new via gstreamer-devel <gstreamer-devel@lists.freedesktop.org> wrote:
                </div>
                <div><br></div>
                <div><br></div>
                <div><div id="yiv5284857886"><div><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;" class="yiv5284857886ydpeddc338eyahoo-style-wrap"><div></div>
        <div><br clear="none"></div><div dir="ltr">Wait, Nicolas. I have a few other elements. After the pipeline is unlinked and a new sink is created, I link all elements again.</div><div dir="ltr">Basically, only the sink is replaced. Why can other elements still be used if their ref counts are 0 as well?</div><div dir="ltr"><br clear="none"></div><div dir="ltr">   Joe<br clear="none"></div>
        
        </div><div id="yiv5284857886yqt17975" class="yiv5284857886yqt4445788026"><div id="yiv5284857886yahoo_quoted_6730797259" class="yiv5284857886yahoo_quoted">
            <div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
                
                <div>
                    On Friday, October 6, 2023, 10:22:58 a.m. EDT, cfd new <newcfd@yahoo.com> wrote:
                </div>
                <div><br clear="none"></div>
                <div><br clear="none"></div>
                <div><div id="yiv5284857886"><div><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;" class="yiv5284857886ydpb9507dbayahoo-style-wrap"><div></div>
        <div dir="ltr">Thanks a lot, Nicolas. Good to know. Will move to <span><a shape="rect" href="http://discourse.gstreamer.org" class="yiv5284857886enhancr_card_6833728805" target="_blank" rel="noreferrer noopener">discourse.gstreamer.org</a></span><div id="yiv5284857886ydp50e23b69enhancr_card_6833728805" style="max-width:400px;font-family:YahooSans VF, YahooSans, Helvetica Neue, Segoe UI, Helvetica, Arial, sans-serif;" data-url="http://discourse.gstreamer.org" data-type="YENHANCER" data-size="MEDIUM" class="yiv5284857886ydp50e23b69yahoo-link-enhancr-card yiv5284857886ydp50e23b69ymail-preserve-class yiv5284857886ydp50e23b69ymail-preserve-style"><a shape="rect" href="http://discourse.gstreamer.org" style="text-decoration-line:none !important;text-decoration-style:solid !important;text-decoration-color:currentcolor !important;color:rgb(0, 0, 0) !important;" class="yiv5284857886ydp50e23b69yahoo-enhancr-cardlink" target="_blank" rel="noreferrer noopener"><table style="max-width:400px;" class="yiv5284857886ydp50e23b69card-wrapper yiv5284857886ydp50e23b69yahoo-ignore-table" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td colspan="1" rowspan="1" width="400"><table style="max-width:400px;border-width:1px;border-style:solid;border-color:rgb(224, 228, 233);border-radius:2px;" class="yiv5284857886ydp50e23b69card yiv5284857886ydp50e23b69yahoo-ignore-table" width="100%" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td colspan="1" rowspan="1" style="background-color:rgb(0, 0, 0);background-repeat:no-repeat;background-size:cover;position:relative;border-radius:2px 2px 0px 0px;min-height:175px;" class="yiv5284857886ydp50e23b69card-primary-image-cell" valign="top" height="175" bgcolor="#000000" background="https://s.yimg.com/lo/api/res/1.2/a7cX0hnQPOATvIhpO.fr9Q--~A/Zmk9ZmlsbDt3PTQwMDtoPTIwMDthcHBpZD1pZXh0cmFjdA--/https://discourse.gstreamer.org/uploads/default/original/1X/b39794bde7833cc5510435c45db50a001b109713.png.cf.jpg"><table style="width:100%;" class="yiv5284857886ydp50e23b69card-overlay-container-table yiv5284857886ydp50e23b69yahoo-ignore-table" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td colspan="1" rowspan="1" style="background-color:transparent;border-radius:2px 2px 0px 0px;min-height:175px;" class="yiv5284857886ydp50e23b69card-overlay-cell" valign="top" bgcolor="transparent" background="https://s.yimg.com/cv/ae/nq/storm/assets/enhancrV21/1/enhancr_gradient-400x175.png"><table style="width:100%;min-height:175px;" class="yiv5284857886ydp50e23b69yahoo-ignore-table" height="175" border="0"><tbody><tr><td colspan="1" rowspan="1" style="text-align:left;padding:15px 0 0 15px;vertical-align:top;" class="yiv5284857886ydp50e23b69card-richInfo2"></td><td colspan="1" rowspan="1" style="text-align:right;padding:15px 15px 0 0;vertical-align:top;" class="yiv5284857886ydp50e23b69card-actions"><div class="yiv5284857886ydp50e23b69card-share-container"></div></td></tr></tbody></table></td></tr></tbody></table></td></tr><tr><td colspan="1" rowspan="1"><table style="background-color:rgb(255, 255, 255);background-repeat:repeat;background-attachment:scroll;background-image:none;background-size:auto;position:relative;z-index:2;width:100%;max-width:400px;border-radius:0px 0px 2px 2px;border-top:1px solid rgb(224, 228, 233);" class="yiv5284857886ydp50e23b69card-info yiv5284857886ydp50e23b69yahoo-ignore-table" cellspacing="0" cellpadding="0" border="0" align="center"><tbody><tr><td colspan="1" rowspan="1" style="background-color:#ffffff;padding:16px 0 16px 12px;vertical-align:top;border-radius:0 0 0 2px;"></td><td colspan="1" rowspan="1" style="vertical-align:middle;padding:12px 24px 16px 12px;width:99%;font-family:YahooSans VF, YahooSans, Helvetica Neue, Segoe UI, Helvetica, Arial, sans-serif;border-radius:0 0 2px 0;"><h2 style="font-size:14px;line-height:19px;margin:0px 0px 6px;font-family:YahooSans VF, YahooSans, Helvetica Neue, Segoe UI, Helvetica, Arial, sans-serif;color:rgb(29, 34, 40);max-width:314px;" class="yiv5284857886ydp50e23b69card-title">GStreamer Discourse</h2><p style="font-size:12px;line-height:16px;margin:0px;color:rgb(151, 158, 168);" class="yiv5284857886ydp50e23b69card-description">GStreamer Project and Community related discussions</p></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></a></div><div><br clear="none"></div></div><div dir="ltr"><br clear="none"></div><div dir="ltr">    Joe<br clear="none"></div><div><br clear="none"></div>
        
        </div><div id="yiv5284857886yqt69054" class="yiv5284857886yqt2005361299"><div id="yiv5284857886yahoo_quoted_6938548446" class="yiv5284857886yahoo_quoted">
            <div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
                
                <div>
                    On Friday, October 6, 2023, 07:45:39 a.m. EDT, Nicolas Dufresne via gstreamer-devel <gstreamer-devel@lists.freedesktop.org> wrote:
                </div>
                <div><br clear="none"></div>
                <div><br clear="none"></div>
                <div><div id="yiv5284857886"><div><div><div>Hi,<div><br clear="none"></div><div>Be aware that we now have a forum at <a shape="rect" href="http://discourse.gstreamer.org" target="_blank" rel="noreferrer noopener">discourse.gstreamer.org</a> which is getting more activity.</div><br clear="none"><br clear="none"><div class="yiv5284857886gmail_quote"><div dir="ltr" class="yiv5284857886gmail_attr">Le jeu. 5 oct. 2023, 20 h 15, cfd new via gstreamer-devel <<a shape="rect" ymailto="mailto:gstreamer-devel@lists.freedesktop.org" href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank" rel="noreferrer noopener">gstreamer-devel@lists.freedesktop.org</a>> a écrit :<br clear="none"></div><blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;" class="yiv5284857886gmail_quote"><div><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div dir="ltr">I have a audio pipeline with a sink. When I switch audio devices, I want to replace the sink only. What I did in the code are,</div><div dir="ltr">1. set pipeline state to NULL<br clear="none"></div><div dir="ltr">1. disconnect sink element from the pipeline</div><div dir="ltr">2. unref it <===problem here: reference count is 0 and can not unref it. Why?<br clear="none"></div><div dir="ltr">3. create a new sink element and link it to pipeline</div><div dir="ltr">4. set pipeline state to PLAYING</div><div dir="ltr"><br clear="none"></div><div dir="ltr">   the pipeline works fine with the new sink. But why can not the old sink be deleted?</div></div></div></blockquote></div></div><div><br clear="none"></div><div>When you create an element from factory, it's created with a floating ref. As a side effect, when the element get added to the pipeline, the pipeline will get the floating ref, effectively passing ownership. In your case, you have dropped the last reference when you removed the element from the bin/pipeline. Use ref_sink if you want to prevent that.</div><div><br clear="none"></div><div>Nicolas</div><div id="yiv5284857886yqtfd19696" class="yiv5284857886yqt6337123591"><div><br clear="none"></div><div><div class="yiv5284857886gmail_quote"><blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;" class="yiv5284857886gmail_quote"><div><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div dir="ltr"> <br clear="none"></div><div dir="ltr">   thanks for your help,</div><div dir="ltr"><br clear="none"></div><div dir="ltr">   Joe<br clear="none"></div></div></div></blockquote></div></div></div></div><div id="yiv5284857886yqtfd04822" class="yiv5284857886yqt6337123591">
</div></div></div></div>
            </div>
        </div></div></div></div></div>
            </div>
        </div></div></div></div></div>
            </div>
        </div></body></html>