comparison TOOLS/w32codec_dl.pl @ 29263:0f1b5b68af32

whitespace cosmetics: Remove all trailing whitespace.
author diego
date Wed, 13 May 2009 02:58:57 +0000
parents 39805251ef61
children 32725ca88fed
comparison
equal deleted inserted replaced
29262:7d545a6b8aff 29263:0f1b5b68af32
31 CC: while (<CCONF>) 31 CC: while (<CCONF>)
32 { 32 {
33 next CC if (m/^[ \t]*\;/); 33 next CC if (m/^[ \t]*\;/);
34 s/\;.*//g; 34 s/\;.*//g;
35 s/#.*//g; 35 s/#.*//g;
36 36
37 if (m/^videocodec (.*)/) 37 if (m/^videocodec (.*)/)
38 { 38 {
39 $codec = $1; 39 $codec = $1;
40 } 40 }
41 elsif (m/^[ \t]+driver (.*)/) 41 elsif (m/^[ \t]+driver (.*)/)
103 103
104 %got_codecs = (); 104 %got_codecs = ();
105 sub find_codec 105 sub find_codec
106 { 106 {
107 my ($fourcc) = @_; 107 my ($fourcc) = @_;
108 108
109 my $guid = sprintf ("%08X", unpack ("V", $fourcc))."-0000-0010-8000-00AA00389B71"; 109 my $guid = sprintf ("%08X", unpack ("V", $fourcc))."-0000-0010-8000-00AA00389B71";
110 110
111 my $req = HTTP::Request->new (POST => "http://activex.microsoft.com/objects/ocget.dll"); 111 my $req = HTTP::Request->new (POST => "http://activex.microsoft.com/objects/ocget.dll");
112 $req->header ('Accept', '*/*'); 112 $req->header ('Accept', '*/*');
113 $req->content_type ('application/x-www-form-urlencoded'); 113 $req->content_type ('application/x-www-form-urlencoded');
114 $req->content ("CLSID=%7B${guid}%7D\n"); 114 $req->content ("CLSID=%7B${guid}%7D\n");
115 #$req->content ('CLSID={'.${guid}.'}'); 115 #$req->content ('CLSID={'.${guid}.'}');
116 116
117 my $res = $ua->request ($req); 117 my $res = $ua->request ($req);
118 118
119 if ($res->is_success) { 119 if ($res->is_success) {
120 print "Lookup returned success... weird!\n"; 120 print "Lookup returned success... weird!\n";
121 return 1; 121 return 1;
122 } else { 122 } else {
123 # Codec location 123 # Codec location
145 } 145 }
146 146
147 sub get_codec 147 sub get_codec
148 { 148 {
149 my ($url) = @_; 149 my ($url) = @_;
150 150
151 my $req = HTTP::Request->new (GET => $url); 151 my $req = HTTP::Request->new (GET => $url);
152 $req->header ("Accept", "*/*"); 152 $req->header ("Accept", "*/*");
153 my $res = $ua->request ($req); 153 my $res = $ua->request ($req);
154 154
155 if ($res->is_success) 155 if ($res->is_success)
156 { 156 {
157 open TMP, ">tmp.cab" or die "Unable to open tmp.cab"; 157 open TMP, ">tmp.cab" or die "Unable to open tmp.cab";
158 print TMP $res->content; 158 print TMP $res->content;
159 close TMP; 159 close TMP;
160 160
161 system "cabextract tmp.cab"; 161 system "cabextract tmp.cab";
162 unlink "tmp.cab"; 162 unlink "tmp.cab";
163 } 163 }
164 else 164 else
165 { 165 {