Changeset 82d34e6
- Timestamp:
- Aug 10, 2003, 10:07:06 PM (21 years ago)
- Branches:
- master, debian, mac, no-cups, nodebathena, web
- Children:
- 1db2bbb
- Parents:
- 1282871
- git-author:
- jhawk <jhawk> (08/10/03 22:07:06)
- git-committer:
- jhawk <jhawk> (08/10/03 22:07:06)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gutenbach/debian/lib/sipbmp3-filter
r1282871 r82d34e6 2 2 # Play the data on STDIN as an audio file 3 3 # 4 # $Id: sipbmp3-filter,v 1.5 2003-01-22 05:00:01 unknown Exp $ 4 # $Id: sipbmp3-filter,v 1.6 2003-08-11 02:07:06 jhawk Exp $ 5 # $Source: /tmp/tmp.UFBNno9997/RCS/sipbmp3-filter,v $ 5 6 # 6 7 # TODO … … 81 82 } elsif ($magic eq "EXT") { 82 83 # This is an external stream reference (a jered-special) 83 &play_external_reference(\%opts); 84 &play_external_reference(\%opts, $magic); 85 exit 0; 86 } elsif ($magic eq "htt") { 87 # This is an external stream reference (a jered-special) 88 &play_external_reference(\%opts, $magic); 84 89 exit 0; 85 90 } elsif ($magic eq "Ogg") { … … 101 106 # Retrieve those command line opts. 102 107 my %opts = %{shift(@_)}; 108 my $magic = shift(@_); 103 109 104 110 # External references are *not* playlists; they only support … … 117 123 my $format, $uri, $userpass; 118 124 119 if (<STDIN> =~ /^EXT (.*)$/) { 120 # Found the header 121 $format = $1; 122 } else { 123 print ZEPHYR "Couldn't read EXT header\n"; 125 if ("$magic" eq "EXT") { 126 if (<STDIN> =~ /^EXT (.*)$/) { 127 # Found the header 128 $format = $1; 129 } else { 130 print ZEPHYR "Couldn't read EXT header\n"; 131 close(ZEPHYR); 132 } 133 134 if (<STDIN> =~ /^(\S*)\s*(.*)$/) { 135 # Found the URI (and optionally user:pass) 136 $uri = $1; 137 if ($2) { 138 $userpass = $2; 139 } 140 } else { 141 print ZEPHYR "Couldn't read URI for external reference\n"; 142 close(ZEPHYR); 143 } 144 } elsif ("$magic" eq "htt") { 145 if (<STDIN> =~ /^(\S*)\s*(.*)$/) { 146 $uri=$1; 147 open(W3M, "/mit/sipb/bin/w3m -dump_head $uri|"); 148 $contenttype="unknown"; 149 while (<W3M>) { 150 if ($_ =~ /^Content-Type:\s(\S*)/) { 151 $contenttype=$1; 152 } 153 } 154 if ($contenttype eq "audio/mpeg") { $format="MP3" } 155 elsif ($contenttype eq "audio/ogg") { $format="OGG" } 156 else { 157 print ZEPHYR "Unknown Content-Type $contenttype trying to /mit/sipb/bin/w3m -dump_head $uri\n"; 158 close(ZEPHYR); 159 } 160 } else { 161 print ZEPHYR "Couldn't read URI for external reference\n"; 162 close(ZEPHYR); 163 } 164 } else { 165 print ZEPHYR "Unknown syntax in play_external_reference(): $magic\n"; 124 166 close(ZEPHYR); 125 } 126 127 if (<STDIN> =~ /^(\S*)\s*(.*)$/) { 128 # Found the URI (and optionally user:pass) 129 $uri = $1; 130 if ($2) { 131 $userpass = $2; 132 } 133 } else { 134 print ZEPHYR "Couldn't read URI for external reference\n"; 135 close(ZEPHYR); 136 } 167 } 137 168 138 169 # Echo the rest to the zephyr
Note: See TracChangeset
for help on using the changeset viewer.