Re: [PATCH spice-gtk v3] gst: check pulsesrc version >= 1.14.5

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jan 14, 2019 at 2:56 PM Victor Toso <victortoso@xxxxxxxxxx> wrote:
>
> Hi,
>
> On Sun, Jan 13, 2019 at 08:31:43PM +0400, Marc-André Lureau wrote:
> > Hi
> >
> > On Sun, Jan 13, 2019 at 1:13 PM Snir Sheriber <ssheribe@xxxxxxxxxx> wrote:
> > >
> > >
> > > On 1/11/19 1:03 PM, marcandre.lureau@xxxxxxxxxx wrote:
> > > > From: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>
> > > >
> > > > There is a racy bug in pulsesrc that we can't easily workaround:
> > > > https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/merge_requests/69
> > > >
> > > > It is fixed with 1.15, and will be backported to upcoming 1.14.5.
> > > >
> > > > PulseAudio may not be picked by autoaudiosrc, but looking up the
> > > > actual source or mimicking GstAutoDetect is unnecessarily complicated.
> > > >
> > > > When pulsesrc < 1.14.5 is detected, let's drop its rank, so it won't be picked.
> > > >
> > > > Signed-off-by: Marc-André Lureau <marcandre.lureau@xxxxxxxxxx>
> > > > ---
> > > >   src/spice-gstaudio.c | 28 ++++++++++++++++++++++++++++
> > > >   1 file changed, 28 insertions(+)
> > > >
> > > > diff --git a/src/spice-gstaudio.c b/src/spice-gstaudio.c
> > > > index d0cfbc6..49e9ae6 100644
> > > > --- a/src/spice-gstaudio.c
> > > > +++ b/src/spice-gstaudio.c
> > > > @@ -527,7 +527,35 @@ SpiceGstaudio *spice_gstaudio_new(SpiceSession *session, GMainContext *context,
> > > >                                     const char *name)
> > > >   {
> > > >       GError *err = NULL;
> > > > +
> > > >       if (gst_init_check(NULL, NULL, &err)) {
> > > > +        GstPluginFeature *pulsesrc;
> > > > +
> > > > +        pulsesrc = gst_registry_lookup_feature(gst_registry_get(), "pulsesrc");
> > > > +        if (pulsesrc) {
> > > > +            unsigned major, minor, micro;
> > > > +            GstPlugin *plugin = gst_plugin_feature_get_plugin(pulsesrc);
> > > > +
> > > > +            if (sscanf(gst_plugin_get_version(plugin), "%u.%u.%u",
> > > > +                       &major, &minor, &micro) != 3) {
> > > > +                g_warn_if_reached();
> > > > +                gst_object_unref(plugin);
> > > > +                gst_object_unref(pulsesrc);
> > > > +                return NULL;
> > >
> > > In that case plugin exists but version is unclear, isn't it preferable
> > > to just setting a low rank as well?
> >
> > I don't think we should touch it in that case, as we don't know about it.
> >
> > >
> > > Looks good to me other than that
> >
> > ack, then?
>
> Considering that 1.14.5 is not released yet, shouldn't we change
> the g_warning to g_debug below? User that receives spice-gtk
> 0.36?

No, I would rather have a warning about broken pulsesrc, even if
1.14.5 is not yet released.

>
> Not that important as pulseaudio still defaults for 0.36.
>
> > thanks
> >
> > >
> > >
> > > Snir.
> > >
> > > > +            }
> > > > +
> > > > +            if (major < 1 ||
> > > > +                (major == 1 && minor < 14) ||
> > > > +                (major == 1 && minor == 14 && micro < 5)) {
> > > > +                g_warning("Bad pulsesrc version %s, lowering its rank",
> > > > +                          gst_plugin_get_version(plugin));
> > > > +                gst_plugin_feature_set_rank(pulsesrc, GST_RANK_NONE);
> > > > +            }
> > > > +
> > > > +            gst_object_unref(plugin);
> > > > +            gst_object_unref(pulsesrc);
> > > > +        }
> > > > +
> > > >           return g_object_new(SPICE_TYPE_GSTAUDIO,
> > > >                               "session", session,
> > > >                               "main-context", context,
> > > _______________________________________________
> > > Spice-devel mailing list
> > > Spice-devel@xxxxxxxxxxxxxxxxxxxxx
> > > https://lists.freedesktop.org/mailman/listinfo/spice-devel
> >
> >
> >
> > --
> > Marc-André Lureau
> > _______________________________________________
> > Spice-devel mailing list
> > Spice-devel@xxxxxxxxxxxxxxxxxxxxx
> > https://lists.freedesktop.org/mailman/listinfo/spice-devel



-- 
Marc-André Lureau
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]