[Mplayer-cvslog] CVS: main dvdauth.c,1.1,1.2 dvdauth.h,1.1,1.2 mplayer.c,1.80,1.81 demux_mpg.c,1.11,1.12 cfg-mplayer.h,1.28,1.29
Gabor Lenart
lgb at users.sourceforge.net
Fri Apr 20 16:32:12 CEST 2001
Update of /cvsroot/mplayer/main
In directory usw-pr-cvs1:/tmp/cvs-serv12364/main
Modified Files:
dvdauth.c dvdauth.h mplayer.c demux_mpg.c cfg-mplayer.h
Log Message:
command line requested DVD key support for Arpi :)
Index: dvdauth.c
===================================================================
RCS file: /cvsroot/mplayer/main/dvdauth.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** dvdauth.c 2001/04/17 22:04:44 1.1
--- dvdauth.c 2001/04/20 14:32:09 1.2
***************
*** 24,27 ****
--- 24,29 ----
unsigned char key_disc[2048];
unsigned char key_title[5];
+ unsigned char *dvdimportkey=NULL;
+ int descrambling=0;
***************
*** 60,63 ****
--- 62,89 ----
+ int dvd_import_key ( unsigned char *hexkey )
+ {
+ unsigned char *t=key_title;
+ int digit=4,len;
+ bzero(key_title,sizeof(key_title));
+ // printf("DVD key: %s\n",hexkey);
+ for (len=0;len<10;len++) {
+ // printf("-> %c\n",*hexkey);
+ if (!*hexkey) return 1;
+ if (*hexkey>='A'&&*hexkey<='F') *t|=(*hexkey-'A'+10)<<digit;
+ else if (*hexkey>='0'&&*hexkey<='9') *t|=(*hexkey-'0')<<digit;
+ else return 1;
+ if (digit) digit=0; else {
+ digit=4;
+ t++;
+ }
+ hexkey++;
+ }
+ if (*hexkey) return 1;
+ printf("DVD key (requested): %02X%02X%02X%02X%02X\n",key_title[0],key_title[1],key_title[2],key_title[3],key_title[4]);
+ descrambling=1;
+ return 0;
+ }
+
int dvd_auth ( char *dev , int fd )
***************
*** 100,103 ****
--- 126,131 ----
close(devfd);
+ printf("DVD title key is: %02X%02X%02X%02X%02X\n",key_title[0],key_title[1],key_title[2],key_title[3],key_title[4]);
+ descrambling=1;
return 0;
}
Index: dvdauth.h
===================================================================
RCS file: /cvsroot/mplayer/main/dvdauth.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** dvdauth.h 2001/04/17 22:04:44 1.1
--- dvdauth.h 2001/04/20 14:32:09 1.2
***************
*** 7,13 ****
extern unsigned char key_disc[];
extern unsigned char key_title[];
int dvd_auth ( char *, int );
!
#endif
--- 7,15 ----
extern unsigned char key_disc[];
extern unsigned char key_title[];
+ extern unsigned char *dvdimportkey;
+ extern int descrambling;
int dvd_auth ( char *, int );
! int dvd_import_key ( unsigned char * );
#endif
Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.80
retrieving revision 1.81
diff -C2 -r1.80 -r1.81
*** mplayer.c 2001/04/19 22:39:53 1.80
--- mplayer.c 2001/04/20 14:32:09 1.81
***************
*** 614,617 ****
--- 614,624 ----
if(f<0){ printf("File not found: '%s'\n",filename);return 1; }
#ifdef HAVE_LIBCSS
+ if (dvdimportkey) {
+ if (dvd_import_key(dvdimportkey)) {
+ fprintf(stderr,"Error processing DVD KEY.\n");
+ exit(1);
+ }
+ printf("DVD command line requested key is stored for descrambling.\n");
+ }
if (dvd_device) {
if (dvd_auth(dvd_device,f)) exit(0);
Index: demux_mpg.c
===================================================================
RCS file: /cvsroot/mplayer/main/demux_mpg.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** demux_mpg.c 2001/04/20 06:15:43 1.11
--- demux_mpg.c 2001/04/20 14:32:09 1.12
***************
*** 181,185 ****
// printf("packet start = 0x%X \n",stream_tell(demux->stream)-packet_start_pos);
#ifdef HAVE_LIBCSS
! if (css) CSSDescramble(demux->stream->buffer,key_title);
#endif
ds_read_packet(ds,demux->stream,len,pts/90000.0f,0);
--- 181,188 ----
// printf("packet start = 0x%X \n",stream_tell(demux->stream)-packet_start_pos);
#ifdef HAVE_LIBCSS
! if (css) {
! if (descrambling) CSSDescramble(demux->stream->buffer,key_title); else
! printf("Encrypted stream but authentication was not requested by you!!\n");
! }
#endif
ds_read_packet(ds,demux->stream,len,pts/90000.0f,0);
Index: cfg-mplayer.h
===================================================================
RCS file: /cvsroot/mplayer/main/cfg-mplayer.h,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -r1.28 -r1.29
*** cfg-mplayer.h 2001/04/19 20:11:27 1.28
--- cfg-mplayer.h 2001/04/20 14:32:09 1.29
***************
*** 26,29 ****
--- 26,30 ----
#ifdef HAVE_LIBCSS
{"dvd", &dvd_device, CONF_TYPE_STRING, 0, 0, 0},
+ {"dvdkey", &dvdimportkey, CONF_TYPE_STRING, 0, 0, 0},
#else
{"dvd", "DVD support was not compiled in. See file DOCS/DVD.\n",
_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog
More information about the MPlayer-cvslog
mailing list