Discussion:
[libdvdcss-devel] [PATCH] more aggressive dvdcss_test
Reimar Döffinger
2010-09-25 14:46:49 UTC
Permalink
Hello,
attached patch makes dvdcss_test more agressive by making it only
set b_scrambled to 0 if it is _absolutely_ certain the disc is
not encrypted (the per-title checks will detect unscrambled titles
just fine anyway), never unsetting b_ioctls (which I tested on a disc image
with b_ioctls always forced to 1, it still works just fine).
I also removed the return value, since it tried to indicate orthogonal
things (like RPC state and scrambling) which is just confusing and
not really behaving right (e.g. printing a misleading debug message
for the -2 return value that would only duplicate debug info from
dvdcss_test anyway).
This fixes the behaviour with some region-free and possibly some hacked drives
where the RPC status ioctl would not work, causing ioctls to be
not used at all.
I guess it might be possible to do this a bit nicer,
but it is at least better than the current state IMO.
Jean-Baptiste Kempf
2011-11-02 23:11:32 UTC
Permalink
Post by Reimar Döffinger
attached patch makes dvdcss_test more agressive by making it only
set b_scrambled to 0 if it is _absolutely_ certain the disc is
not encrypted (the per-title checks will detect unscrambled titles
just fine anyway), never unsetting b_ioctls (which I tested on a disc image
with b_ioctls always forced to 1, it still works just fine).
I also removed the return value, since it tried to indicate orthogonal
things (like RPC state and scrambling) which is just confusing and
not really behaving right (e.g. printing a misleading debug message
for the -2 return value that would only duplicate debug info from
dvdcss_test anyway).
This fixes the behaviour with some region-free and possibly some hacked drives
where the RPC status ioctl would not work, causing ioctls to be
not used at all.
I guess it might be possible to do this a bit nicer,
but it is at least better than the current state IMO.
Could an wise elder libdvdcss developer comment on this patch, please?

Best Regards,
--
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device
Diego Biurrun
2011-11-02 23:33:51 UTC
Permalink
Post by Reimar Döffinger
attached patch makes dvdcss_test more agressive by making it only
set b_scrambled to 0 if it is _absolutely_ certain the disc is
not encrypted (the per-title checks will detect unscrambled titles
just fine anyway), never unsetting b_ioctls (which I tested on a disc image
with b_ioctls always forced to 1, it still works just fine).
This was never discussed or applied. Reimar committed a slightly different
version to MPlayer in the meantime.

Reimar, can you comment on the changes you did and why?

Diego
Reimar Döffinger
2011-11-03 07:25:29 UTC
Permalink
Post by Diego Biurrun
Post by Reimar Döffinger
attached patch makes dvdcss_test more agressive by making it only
set b_scrambled to 0 if it is _absolutely_ certain the disc is
not encrypted (the per-title checks will detect unscrambled titles
just fine anyway), never unsetting b_ioctls (which I tested on a disc image
with b_ioctls always forced to 1, it still works just fine).
This was never discussed or applied. Reimar committed a slightly different
version to MPlayer in the meantime.
Reimar, can you comment on the changes you did and why?
I don't think it fully fixes the issues, but dvdcss sometimes randomly (possibly on read errors) decides a disk is unencrypted, stores that in the cache and playback is permanently broken.
This was an attempt to fix it, but I have some doubts it really achieves the purpose.
Reimar Döffinger
2011-11-03 08:06:54 UTC
Permalink
- * 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
-
- if( i_ret < 0 )
- {
+ * On unencrypted DVDs _dvdcss_disckey() always fails, however
+ * it will always fail if ioctls do not work at all so we cannot
+ * use that either.
+ * We just assume the disc will be scrambled, the per-title checks
+ * should still handle this fine. */
@@ -138,8 +123,8 @@
if( i_ret < 0 )
{
- print_error( dvdcss, "css error: could not get RPC status" );
- return -2;
+ print_error( dvdcss, "css error: could not get RPC status, region-free drive?" );
+ return;
Note that the core of this is that for some non-RPC-2, region-free
drives the RPC status fails, so disabling ioctls due to that is
just wrong.
At the same time, _dvdcss_disckey will fail if ioctls do not work,
so it makes no sense to decide a disk is unscrabled just because it
fails!
Jean-Baptiste Kempf
2011-11-04 00:35:27 UTC
Permalink
Post by Reimar Döffinger
At the same time, _dvdcss_disckey will fail if ioctls do not work,
so it makes no sense to decide a disk is unscrabled just because it
fails!
So at least, this part should be fixed, if I understand correctly.

Best Regards,
--
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device
Reimar Döffinger
2011-11-04 15:33:54 UTC
Permalink
Post by Jean-Baptiste Kempf
Post by Reimar Döffinger
At the same time, _dvdcss_disckey will fail if ioctls do not work,
so it makes no sense to decide a disk is unscrabled just because it
fails!
So at least, this part should be fixed, if I understand correctly.
Probably. Though since it is Windows-only I have not well tested it
and don't care personally.
However the other part (disabling ioctls) means that I could not play
some DVDs on one of my drives since without ioctls only CSS cracking is
available and that fails in some cases (which might be another bug,
but I don't have time to investigate and the problematic DVD drive
is a few 1000 km away in my other PC).

Loading...