[vlc-devel] [PATCH] decoder device: remove VLC_DECODER_DEVICE_NONE
Rémi Denis-Courmont
remi at remlab.net
Fri Oct 25 12:16:08 CEST 2019
Ok
Le 25 octobre 2019 09:35:18 GMT+03:00, Steve Lhomme <robux4 at ycbcr.xyz> a écrit :
>A decoder device should always be associated with a "device" or
>adapter. If
>there is none it can be NULL, there's no need for a dummy one.
>
>Setting values on a module that failed to load and won't be used is
>misleading.
>---
> include/vlc_codec.h | 1 -
> src/input/decoder_helpers.c | 19 ++-----------------
> 2 files changed, 2 insertions(+), 18 deletions(-)
>
>diff --git a/include/vlc_codec.h b/include/vlc_codec.h
>index 36d48a6204d..6649ef94cc2 100644
>--- a/include/vlc_codec.h
>+++ b/include/vlc_codec.h
>@@ -534,7 +534,6 @@ static inline float decoder_GetDisplayRate(
>decoder_t *dec )
> /** Decoder device type */
> enum vlc_decoder_device_type
> {
>- VLC_DECODER_DEVICE_NONE,
> VLC_DECODER_DEVICE_VAAPI,
> VLC_DECODER_DEVICE_VDPAU,
> VLC_DECODER_DEVICE_DXVA2,
>diff --git a/src/input/decoder_helpers.c b/src/input/decoder_helpers.c
>index ed13fc98785..f3784e6dfbb 100644
>--- a/src/input/decoder_helpers.c
>+++ b/src/input/decoder_helpers.c
>@@ -114,26 +114,11 @@ struct vlc_decoder_device_priv
>
> static int decoder_device_Open(void *func, bool forced, va_list ap)
> {
>+ VLC_UNUSED(forced);
> vlc_decoder_device_Open open = func;
> vlc_decoder_device *device = va_arg(ap, vlc_decoder_device *);
> vout_window_t *window = va_arg(ap, vout_window_t *);
>- int ret = open(device, window);
>- if (ret != VLC_SUCCESS)
>- {
>- struct vlc_decoder_device_priv *priv =
>- container_of(device, struct vlc_decoder_device_priv,
>device);
>-
>- vlc_objres_clear(VLC_OBJECT(&priv->device));
>- device->sys = NULL;
>- device->type = VLC_DECODER_DEVICE_NONE;
>- device->opaque = NULL;
>- }
>- else
>- {
>- assert(device->type != VLC_DECODER_DEVICE_NONE);
>- }
>- (void) forced;
>- return ret;
>+ return open(device, window);
> }
>
> vlc_decoder_device *
>--
>2.17.1
>
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel
--
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20191025/3eb51072/attachment.html>
More information about the vlc-devel
mailing list