[libdvdcss-devel] [PATCH 4/4] css: Restructure control flow of win32 bits in dvdcss_test()
Jean-Baptiste Kempf
jb at videolan.org
Tue Nov 18 23:56:05 CET 2014
Seems good.
On 18 Nov, Diego Biurrun wrote :
> Avoid checking an impossible condition, skip the check instead.
> This fixes CID 82126.
> ---
> src/css.c | 15 +++++++--------
> 1 file changed, 7 insertions(+), 8 deletions(-)
>
> diff --git a/src/css.c b/src/css.c
> index 4043efe..fef2ae5 100644
> --- a/src/css.c
> +++ b/src/css.c
> @@ -107,30 +107,29 @@ int dvdcss_test( dvdcss_t dvdcss )
>
> i_ret = ioctl_ReadCopyright( dvdcss->i_fd, 0 /* i_layer */, &i_copyright );
>
> -#ifdef WIN32
> if( i_ret < 0 )
> {
> +#ifdef WIN32
> /* Maybe we didn't have enough privileges to read the copyright
> * (see ioctl_ReadCopyright comments).
> * Apparently, on unencrypted DVDs dvdcss_disckey() always fails, so
> * we can check this as a workaround. */
> - i_ret = 0;
> - i_copyright = 1;
> if( dvdcss_disckey( dvdcss ) < 0 )
> {
> i_copyright = 0;
> }
> - }
> -#endif /* WIN32 */
> -
> - if( i_ret < 0 )
> - {
> + else
> + {
> + i_copyright = 1;
> + }
> +#else
> /* Since it's the first ioctl we try to issue, we add a notice */
> print_error( dvdcss, "CSS error: could not get \"copyright\""
> " information, make sure there is a DVD in the drive,"
> " and that you have used the correct device node." );
>
> return -1;
> +#endif /* WIN32 */
> }
>
> print_debug( dvdcss, "disc reports copyright information 0x%x",
> --
> 2.1.0
>
> _______________________________________________
> libdvdcss-devel mailing list
> libdvdcss-devel at videolan.org
> https://mailman.videolan.org/listinfo/libdvdcss-devel
--
With my kindest regards,
--
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device
More information about the libdvdcss-devel
mailing list