| CODENOTIFIER | HelpYou are not signed inSign in |
Project: Icecast
Revision: 14867
Author: karl
Date: 11 May 2008 21:21:06
Changes:update from win32 build. Mostly cleanup work
Files:| ... | ...@@ -1,6 +1,5 @@ | |
| 1 | 1 | #include <windows.h> |
| 2 | 2 | #include <stdio.h> |
| 3 | #include <errno.h> | |
| 4 | 3 | #include <direct.h> |
| 5 | 4 | extern "C" { |
| 6 | 5 | #include "thread/thread.h" |
| ... | ...@@ -15,6 +14,10 @@ | |
| 15 | 14 | #include "stats.h" |
| 16 | 15 | } |
| 17 | 16 | |
| 17 | // Issues to be wary of. Careful of the runtime you use, I've had printf and similar routines | |
| 18 | // crash because of this on apparently valid strings. some weird thing related to checking for | |
| 19 | // multiple byte characters. DeleteService only marks a service for deletion, and the docs | |
| 20 | // are unclear on the cases that lead to purging however a reboot should do it. | |
| 18 | 21 | |
| 19 | 22 | SERVICE_STATUS ServiceStatus; |
| 20 | 23 | SERVICE_STATUS_HANDLE hStatus; |
| ... | ...@@ -30,14 +33,16 @@ | |
| 30 | 33 | return(result); |
| 31 | 34 | } |
| 32 | 35 | |
| 33 | void installService(char *path) | |
| 36 | void installService (const char *path) | |
| 34 | 37 | { |
| 35 | if (path) { | |
| 36 | char fullPath[8096*2] = ""; | |
| 38 | if (path) { | |
| 39 | char fullPath[8096*2] = "\""; | |
| 40 | int len = GetModuleFileName (NULL, fullPath+1, sizeof (fullPath)-1); | |
| 37 | 41 | |
| 38 | _snprintf(fullPath, sizeof (fullPath), "\"%s\\icecastService.exe\" \"%s\"", path, path); | |
| 39 | SC_HANDLE handle = OpenSCManager( NULL, NULL, SC_MANAGER_ALL_ACCESS ); | |
| 40 | if (handle == NULL) | |
| 42 | _snprintf(fullPath+len+1, sizeof (fullPath)-len, "\" \"%s\"", path); | |
| 43 | ||
| 44 | SC_HANDLE manager = OpenSCManager( NULL, NULL, SC_MANAGER_ALL_ACCESS ); | |
| 45 | if (manager == NULL) | |
| 41 | 46 | { |
| 42 | 47 | LPVOID lpMsgBuf; |
| 43 | 48 | FormatMessage( |
| ... | ...@@ -58,9 +63,9 @@ | |
| 58 | 63 | } |
| 59 | 64 | |
| 60 | 65 | SC_HANDLE service = CreateService( |
| 61 | handle, | |
| 62 | "Icecast", | |
| 63 | "Icecast Media Server", | |
| 66 | manager, | |
| 67 | PACKAGE_STRING, | |
| 68 | PACKAGE_STRING " Streaming Media Server", | |
| 64 | 69 | GENERIC_READ | GENERIC_EXECUTE, |
| 65 | 70 | SERVICE_WIN32_OWN_PROCESS, |
| 66 | 71 | SERVICE_AUTO_START, |
| ... | ...@@ -72,7 +77,7 @@ | |
| 72 | 77 | NULL, |
| 73 | 78 | NULL |
| 74 | 79 | ); |
| 75 | if (handle == NULL) | |
| 80 | if (service == NULL) | |
| 76 | 81 | { |
| 77 | 82 | LPVOID lpMsgBuf; |
| 78 | 83 | FormatMessage( |
| ... | ...@@ -89,19 +94,19 @@ | |
| 89 | 94 | |
| 90 | 95 | printf ("CreateService: %s\n", (LPCTSTR)lpMsgBuf); |
| 91 | 96 | LocalFree( lpMsgBuf ); |
| 92 | CloseServiceHandle (handle); | |
| 97 | CloseServiceHandle (manager); | |
| 93 | 98 | return; |
| 94 | 99 | } |
| 95 | 100 | |
| 96 | 101 | printf("Service Installed\n"); |
| 97 | 102 | CloseServiceHandle (service); |
| 98 | CloseServiceHandle (handle); | |
| 103 | CloseServiceHandle (manager); | |
| 99 | 104 | } |
| 100 | 105 | } |
| 101 | 106 | void removeService() |
| 102 | 107 | { |
| 103 | SC_HANDLE handle = OpenSCManager( NULL, NULL, SC_MANAGER_ALL_ACCESS ); | |
| 104 | if (handle == NULL) | |
| 108 | SC_HANDLE manager = OpenSCManager( NULL, NULL, SC_MANAGER_ALL_ACCESS ); | |
| 109 | if (manager == NULL) | |
| 105 | 110 | { |
| 106 | 111 | LPVOID lpMsgBuf; |
| 107 | 112 | FormatMessage( |
| ... | ...@@ -121,13 +126,15 @@ | |
| 121 | 126 | return; |
| 122 | 127 | } |
| 123 | 128 | |
| 124 | SC_HANDLE service = OpenService(handle, "Icecast", DELETE); | |
| 129 | SC_HANDLE service = OpenService (manager, PACKAGE_STRING, DELETE); | |
| 125 | 130 | if (service) { |
| 126 | 131 | DeleteService(service); |
| 127 | 132 | printf("Service Removed\n"); |
| 133 | CloseServiceHandle (service); | |
| 128 | 134 | } |
| 129 | 135 | else |
| 130 | 136 | printf("Service not found\n"); |
| 137 | CloseServiceHandle (manager); | |
| 131 | 138 | } |
| 132 | 139 | void ControlHandler(DWORD request) |
| 133 | 140 | { |
| ... | ...@@ -167,7 +174,7 @@ | |
| 167 | 174 | ServiceStatus.dwCheckPoint = 0; |
| 168 | 175 | ServiceStatus.dwWaitHint = 0; |
| 169 | 176 | |
| 170 | hStatus = RegisterServiceCtrlHandler("Icecast", (LPHANDLER_FUNCTION)ControlHandler); | |
| 177 | hStatus = RegisterServiceCtrlHandler(PACKAGE_STRING, (LPHANDLER_FUNCTION)ControlHandler); | |
| 171 | 178 | if (hStatus == (SERVICE_STATUS_HANDLE)0) { |
| 172 | 179 | // Registering Control Handler failed |
| 173 | 180 | return; |
| ... | ...@@ -188,11 +195,15 @@ | |
| 188 | 195 | /* Here we do the work */ |
| 189 | 196 | |
| 190 | 197 | int argc2 = 3; |
| 191 | char* argv2[3]; | |
| 198 | char* argv2 [4]; | |
| 192 | 199 | |
| 193 | argv2[0] = "icecastService.exe"; | |
| 194 | argv2[1] = "-c"; | |
| 195 | argv2[2] = "icecast.xml"; | |
| 200 | argv2 [0] = argv[0]; | |
| 201 | argv2 [1] = "-c"; | |
| 202 | if (argc < 2) | |
| 203 | argv2 [2] = "icecast.xml"; | |
| 204 | else | |
| 205 | argv2 [2] = argv[1]; | |
| 206 | argv2[3] = NULL; | |
| 196 | 207 | |
| 197 | 208 | int ret = mainService(argc2, (char **)argv2); |
| 198 | 209 | |
| ... | ...@@ -203,33 +214,48 @@ | |
| 203 | 214 | } |
| 204 | 215 | |
| 205 | 216 | |
| 206 | void main(int argc, char **argv) | |
| 217 | int main(int argc, char **argv) | |
| 207 | 218 | { |
| 208 | ||
| 209 | bool matched = false; | |
| 210 | if (argv[0]) { | |
| 211 | if (argv[1]) { | |
| 212 | if (!strcmp(argv[1], "install")) { | |
| 213 | installService(argv[2]); | |
| 214 | matched = true; | |
| 215 | } | |
| 216 | if (!strcmp(argv[1], "remove")) { | |
| 217 | removeService(); | |
| 218 | matched = true; | |
| 219 | } | |
| 220 | } | |
| 221 | } | |
| 222 | if (matched) { | |
| 223 | return; | |
| 224 | } | |
| 225 | _chdir(argv[1]); | |
| 219 | if (argc < 2) | |
| 220 | { | |
| 221 | printf ("Usage:\n %s remove\n %s install path\n", argv[0], argv[0]); | |
| 222 | return 0; | |
| 223 | } | |
| 224 | if (!strcmp(argv[1], "install")) | |
| 225 | { | |
| 226 | if (argc > 2) | |
| 227 | { | |
| 228 | printf ("Installing service from %s\n", argv[2]); | |
| 229 | installService(argv[2]); | |
| 230 | } | |
| 231 | else | |
| 232 | printf ("install requires a path arg as well\n"); | |
| 233 | Sleep (2000); | |
| 234 | return 0; | |
| 235 | } | |
| 236 | if (!strcmp(argv[1], "remove") || !strcmp(argv[1], "uninstall")) | |
| 237 | { | |
| 238 | printf ("removing service\n"); | |
| 239 | removeService(); | |
| 240 | Sleep (2000); | |
| 241 | return 0; | |
| 242 | } | |
| 243 | ||
| 244 | if (_chdir(argv[1]) < 0) | |
| 245 | { | |
| 246 | printf ("unable to change to directory %s\n", argv[1]); | |
| 247 | Sleep (2000); | |
| 248 | return 0; | |
| 249 | } | |
| 226 | 250 | |
| 227 | 251 | SERVICE_TABLE_ENTRY ServiceTable[2]; |
| 228 | ServiceTable[0].lpServiceName = "Icecast Server"; | |
| 252 | ServiceTable[0].lpServiceName = PACKAGE_STRING; | |
| 229 | 253 | ServiceTable[0].lpServiceProc = (LPSERVICE_MAIN_FUNCTION)ServiceMain; |
| 230 | 254 | |
| 231 | 255 | ServiceTable[1].lpServiceName = NULL; |
| 232 | 256 | ServiceTable[1].lpServiceProc = NULL; |
| 233 | 257 | // Start the control dispatcher thread for our service |
| 234 | 258 | StartServiceCtrlDispatcher(ServiceTable); |
| 259 | ||
| 260 | return 0; | |
| 235 | 261 | } |
| ... | ...@@ -89,288 +89,304 @@ | |
| 89 | 89 | # End Source File |
| 90 | 90 | # Begin Source File |
| 91 | 91 | |
| 92 | SOURCE=..\src\admin.h | |
| 92 | SOURCE=..\src\auth.c | |
| 93 | 93 | # End Source File |
| 94 | 94 | # Begin Source File |
| 95 | 95 | |
| 96 | SOURCE=..\src\auth.c | |
| 96 | SOURCE=..\src\auth_htpasswd.c | |
| 97 | 97 | # End Source File |
| 98 | 98 | # Begin Source File |
| 99 | 99 | |
| 100 | SOURCE=..\src\auth.h | |
| 100 | SOURCE=..\src\auth_url.c | |
| 101 | 101 | # End Source File |
| 102 | 102 | # Begin Source File |
| 103 | 103 | |
| 104 | SOURCE=..\src\auth_htpasswd.c | |
| 104 | SOURCE=..\src\avl\avl.c | |
| 105 | 105 | # End Source File |
| 106 | 106 | # Begin Source File |
| 107 | 107 | |
| 108 | SOURCE=..\src\auth_htpasswd.h | |
| 108 | SOURCE=..\src\cfgfile.c | |
| 109 | 109 | # End Source File |
| 110 | 110 | # Begin Source File |
| 111 | 111 | |
| 112 | SOURCE=..\src\auth_url.c | |
| 112 | SOURCE=..\src\client.c | |
| 113 | 113 | # End Source File |
| 114 | 114 | # Begin Source File |
| 115 | 115 | |
| 116 | SOURCE=..\src\auth_url.h | |
| 116 | SOURCE=..\src\connection.c | |
| 117 | 117 | # End Source File |
| 118 | 118 | # Begin Source File |
| 119 | 119 | |
| 120 | SOURCE=..\src\avl\avl.c | |
| 120 | SOURCE=..\src\event.c | |
| 121 | 121 | # End Source File |
| 122 | 122 | # Begin Source File |
| 123 | 123 | |
| 124 | SOURCE=..\src\avl\avl.h | |
| 124 | SOURCE=..\src\format.c | |
| 125 | 125 | # End Source File |
| 126 | 126 | # Begin Source File |
| 127 | 127 | |
| 128 | SOURCE=..\src\cfgfile.c | |
| 128 | SOURCE=..\src\format_flac.c | |
| 129 | 129 | # End Source File |
| 130 | 130 | # Begin Source File |
| 131 | 131 | |
| 132 | SOURCE=..\src\cfgfile.h | |
| 132 | SOURCE=..\src\format_kate.c | |
| 133 | 133 | # End Source File |
| 134 | 134 | # Begin Source File |
| 135 | 135 | |
| 136 | SOURCE=..\src\client.c | |
| 136 | SOURCE=..\src\format_midi.c | |
| 137 | 137 | # End Source File |
| 138 | 138 | # Begin Source File |
| 139 | 139 | |
| 140 | SOURCE=..\src\client.h | |
| 140 | SOURCE=..\src\format_mp3.c | |
| 141 | 141 | # End Source File |
| 142 | 142 | # Begin Source File |
| 143 | 143 | |
| 144 | SOURCE=..\src\compat.h | |
| 144 | SOURCE=..\src\format_ogg.c | |
| 145 | 145 | # End Source File |
| 146 | 146 | # Begin Source File |
| 147 | 147 | |
| 148 | SOURCE=..\src\connection.c | |
| 148 | SOURCE=..\src\format_skeleton.c | |
| 149 | 149 | # End Source File |
| 150 | 150 | # Begin Source File |
| 151 | 151 | |
| 152 | SOURCE=..\src\connection.h | |
| 152 | SOURCE=..\src\format_speex.c | |
| 153 | 153 | # End Source File |
| 154 | 154 | # Begin Source File |
| 155 | 155 | |
| 156 | SOURCE=..\src\event.c | |
| 156 | SOURCE=..\src\format_theora.c | |
| 157 | 157 | # End Source File |
| 158 | 158 | # Begin Source File |
| 159 | 159 | |
| 160 | SOURCE=..\src\event.h | |
| 160 | SOURCE=..\src\format_vorbis.c | |
| 161 | 161 | # End Source File |
| 162 | 162 | # Begin Source File |
| 163 | 163 | |
| 164 | SOURCE=..\src\format.c | |
| 164 | SOURCE=..\src\fserve.c | |
| 165 | 165 | # End Source File |
| 166 | 166 | # Begin Source File |
| 167 | 167 | |
| 168 | SOURCE=..\src\format.h | |
| 168 | SOURCE=..\src\global.c | |
| 169 | 169 | # End Source File |
| 170 | 170 | # Begin Source File |
| 171 | 171 | |
| 172 | SOURCE=..\src\format_flac.c | |
| 172 | SOURCE=..\src\httpp\httpp.c | |
| 173 | 173 | # End Source File |
| 174 | 174 | # Begin Source File |
| 175 | 175 | |
| 176 | SOURCE=..\src\format_flac.h | |
| 176 | SOURCE=..\src\log\log.c | |
| 177 | 177 | # End Source File |
| 178 | 178 | # Begin Source File |
| 179 | 179 | |
| 180 | SOURCE=..\src\format_midi.c | |
| 180 | SOURCE=..\src\logging.c | |
| 181 | 181 | # End Source File |
| 182 | 182 | # Begin Source File |
| 183 | 183 | |
| 184 | SOURCE=..\src\format_midi.h | |
| 184 | SOURCE=..\src\md5.c | |
| 185 | 185 | # End Source File |
| 186 | 186 | # Begin Source File |
| 187 | 187 | |
| 188 | SOURCE=..\src\format_mp3.c | |
| 188 | SOURCE=..\src\os.h | |
| 189 | 189 | # End Source File |
| 190 | 190 | # Begin Source File |
| 191 | 191 | |
| 192 | SOURCE=..\src\format_mp3.h | |
| 192 | SOURCE=..\src\refbuf.c | |
| 193 | 193 | # End Source File |
| 194 | 194 | # Begin Source File |
| 195 | 195 | |
| 196 | SOURCE=..\src\format_ogg.c | |
| 196 | SOURCE=..\src\net\resolver.c | |
| 197 | 197 | # End Source File |
| 198 | 198 | # Begin Source File |
| 199 | 199 | |
| 200 | SOURCE=..\src\format_ogg.h | |
| 200 | SOURCE=..\src\sighandler.c | |
| 201 | 201 | # End Source File |
| 202 | 202 | # Begin Source File |
| 203 | 203 | |
| 204 | SOURCE=..\src\format_speex.c | |
| 204 | SOURCE=..\src\slave.c | |
| 205 | 205 | # End Source File |
| 206 | 206 | # Begin Source File |
| 207 | 207 | |
| 208 | SOURCE=..\src\format_speex.h | |
| 208 | SOURCE=..\src\net\sock.c | |
| 209 | 209 | # End Source File |
| 210 | 210 | # Begin Source File |
| 211 | 211 | |
| 212 | SOURCE=..\src\format_theora.c | |
| 212 | SOURCE=..\src\source.c | |
| 213 | 213 | # End Source File |
| 214 | 214 | # Begin Source File |
| 215 | 215 | |
| 216 | SOURCE=..\src\format_theora.h | |
| 216 | SOURCE=..\src\stats.c | |
| 217 | 217 | # End Source File |
| 218 | 218 | # Begin Source File |
| 219 | 219 | |
| 220 | SOURCE=..\src\format_vorbis.c | |
| 220 | SOURCE=..\src\thread\thread.c | |
| 221 | 221 | # End Source File |
| 222 | 222 | # Begin Source File |
| 223 | 223 | |
| 224 | SOURCE=..\src\format_vorbis.h | |
| 224 | SOURCE=..\src\timing\timing.c | |
| 225 | 225 | # End Source File |
| 226 | 226 | # Begin Source File |
| 227 | 227 | |
| 228 | SOURCE=..\src\fserve.c | |
| 228 | SOURCE=..\src\util.c | |
| 229 | 229 | # End Source File |
| 230 | 230 | # Begin Source File |
| 231 | 231 | |
| 232 | SOURCE=..\src\fserve.h | |
| 232 | SOURCE=..\src\xslt.c | |
| 233 | 233 | # End Source File |
| 234 | 234 | # Begin Source File |
| 235 | 235 | |
| 236 | SOURCE=..\src\global.c | |
| 236 | SOURCE=..\src\yp.c | |
| 237 | 237 | # End Source File |
| 238 | # End Group | |
| 239 | # Begin Group "Header Files" | |
| 240 | ||
| 241 | # PROP Default_Filter "h;hpp;hxx;hm;inl" | |
| 238 | 242 | # Begin Source File |
| 239 | 243 | |
| 240 | SOURCE=..\src\global.h | |
| 244 | SOURCE=..\src\admin.h | |
| 241 | 245 | # End Source File |
| 242 | 246 | # Begin Source File |
| 243 | 247 | |
| 244 | SOURCE=..\src\httpp\httpp.c | |
| 248 | SOURCE=..\src\auth.h | |
| 245 | 249 | # End Source File |
| 246 | 250 | # Begin Source File |
| 247 | 251 | |
| 248 | SOURCE=..\src\httpp\httpp.h | |
| 252 | SOURCE=..\src\auth_htpasswd.h | |
| 249 | 253 | # End Source File |
| 250 | 254 | # Begin Source File |
| 251 | 255 | |
| 252 | SOURCE=..\src\log\log.c | |
| 256 | SOURCE=..\src\auth_url.h | |
| 253 | 257 | # End Source File |
| 254 | 258 | # Begin Source File |
| 255 | 259 | |
| 256 | SOURCE=..\src\log\log.h | |
| 260 | SOURCE=..\src\avl\avl.h | |
| 257 | 261 | # End Source File |
| 258 | 262 | # Begin Source File |
| 259 | 263 | |
| 260 | SOURCE=..\src\logging.c | |
| 264 | SOURCE=..\src\cfgfile.h | |
| 261 | 265 | # End Source File |
| 262 | 266 | # Begin Source File |
| 263 | 267 | |
| 264 | SOURCE=..\src\logging.h | |
| 268 | SOURCE=..\src\client.h | |
| 265 | 269 | # End Source File |
| 266 | 270 | # Begin Source File |
| 267 | 271 | |
| 268 | SOURCE=..\src\md5.c | |
| 272 | SOURCE=..\src\compat.h | |
| 269 | 273 | # End Source File |
| 270 | 274 | # Begin Source File |
| 271 | 275 | |
| 272 | SOURCE=..\src\md5.h | |
| 276 | SOURCE=..\src\connection.h | |
| 273 | 277 | # End Source File |
| 274 | 278 | # Begin Source File |
| 275 | 279 | |
| 276 | SOURCE=..\src\os.h | |
| 280 | SOURCE=..\src\event.h | |
| 277 | 281 | # End Source File |
| 278 | 282 | # Begin Source File |
| 279 | 283 | |
| 280 | SOURCE=..\src\refbuf.c | |
| 284 | SOURCE=..\src\format.h | |
| 281 | 285 | # End Source File |
| 282 | 286 | # Begin Source File |
| 283 | 287 | |
| 284 | SOURCE=..\src\refbuf.h | |
| 288 | SOURCE=..\src\format_flac.h | |
| 285 | 289 | # End Source File |
| 286 | 290 | # Begin Source File |
| 287 | 291 | |
| 288 | SOURCE=..\src\net\resolver.c | |
| 292 | SOURCE=..\src\format_kate.h | |
| 289 | 293 | # End Source File |
| 290 | 294 | # Begin Source File |
| 291 | 295 | |
| 292 | SOURCE=..\src\net\resolver.h | |
| 296 | SOURCE=..\src\format_midi.h | |
| 293 | 297 | # End Source File |
| 294 | 298 | # Begin Source File |
| 295 | 299 | |
| 296 | SOURCE=..\src\sighandler.c | |
| 300 | SOURCE=..\src\format_mp3.h | |
| 297 | 301 | # End Source File |
| 298 | 302 | # Begin Source File |
| 299 | 303 | |
| 300 | SOURCE=..\src\sighandler.h | |
| 304 | SOURCE=..\src\format_ogg.h | |
| 301 | 305 | # End Source File |
| 302 | 306 | # Begin Source File |
| 303 | 307 | |
| 304 | SOURCE=..\src\slave.c | |
| 308 | SOURCE=..\src\format_skeleton.h | |
| 305 | 309 | # End Source File |
| 306 | 310 | # Begin Source File |
| 307 | 311 | |
| 308 | SOURCE=..\src\net\sock.c | |
| 312 | SOURCE=..\src\format_speex.h | |
| 309 | 313 | # End Source File |
| 310 | 314 | # Begin Source File |
| 311 | 315 | |
| 312 | SOURCE=..\src\net\sock.h | |
| 316 | SOURCE=..\src\format_theora.h | |
| 313 | 317 | # End Source File |
| 314 | 318 | # Begin Source File |
| 315 | 319 | |
| 316 | SOURCE=..\src\source.c | |
| 320 | SOURCE=..\src\format_vorbis.h | |
| 317 | 321 | # End Source File |
| 318 | 322 | # Begin Source File |
| 319 | 323 | |
| 320 | SOURCE=..\src\source.h | |
| 324 | SOURCE=..\src\fserve.h | |
| 321 | 325 | # End Source File |
| 322 | 326 | # Begin Source File |
| 323 | 327 | |
| 324 | SOURCE=..\src\stats.c | |
| 328 | SOURCE=..\src\global.h | |
| 325 | 329 | # End Source File |
| 326 | 330 | # Begin Source File |
| 327 | 331 | |
| 328 | SOURCE=..\src\stats.h | |
| 332 | SOURCE=..\src\httpp\httpp.h | |
| 329 | 333 | # End Source File |
| 330 | 334 | # Begin Source File |
| 331 | 335 | |
| 332 | SOURCE=..\src\thread\thread.c | |
| 336 | SOURCE=..\src\log\log.h | |
| 333 | 337 | # End Source File |
| 334 | 338 | # Begin Source File |
| 335 | 339 | |
| 336 | SOURCE=..\src\thread\thread.h | |
| 340 | SOURCE=..\src\logging.h | |
| 337 | 341 | # End Source File |
| 338 | 342 | # Begin Source File |
| 339 | 343 | |
| 340 | SOURCE=..\src\timing\timing.c | |
| 344 | SOURCE=..\src\md5.h | |
| 341 | 345 | # End Source File |
| 342 | 346 | # Begin Source File |
| 343 | 347 | |
| 344 | SOURCE=..\src\util.c | |
| 348 | SOURCE=..\src\refbuf.h | |
| 345 | 349 | # End Source File |
| 346 | 350 | # Begin Source File |
| 347 | 351 | |
| 348 | SOURCE=..\src\util.h | |
| 352 | SOURCE=..\src\net\resolver.h | |
| 349 | 353 | # End Source File |
| 350 | 354 | # Begin Source File |
| 351 | 355 | |
| 352 | SOURCE=..\src\xslt.c | |
| 356 | SOURCE=..\src\sighandler.h | |
| 353 | 357 | # End Source File |
| 354 | 358 | # Begin Source File |
| 355 | 359 | |
| 356 | SOURCE=..\src\yp.c | |
| 360 | SOURCE=..\src\net\sock.h | |
| 357 | 361 | # End Source File |
| 358 | 362 | # Begin Source File |
| 359 | 363 | |
| 360 | SOURCE=..\src\yp.h | |
| 364 | SOURCE=..\src\source.h | |
| 361 | 365 | # End Source File |
| 362 | # End Group | |
| 363 | # Begin Group "Header Files" | |
| 366 | # Begin Source File | |
| 364 | 367 | |
| 365 | # PROP Default_Filter "h;hpp;hxx;hm;inl" | |
| 368 | SOURCE=..\src\stats.h | |
| 369 | # End Source File | |
| 370 | # Begin Source File | |
| 371 | ||
| 372 | SOURCE=..\src\thread\thread.h | |
| 373 | # End Source File | |
| 366 | 374 | # Begin Source File |
| 367 | 375 | |
| 368 | 376 | SOURCE=..\src\timing\timing.h |
| 369 | 377 | # End Source File |
| 370 | 378 | # Begin Source File |
| 371 | 379 | |
| 380 | SOURCE=..\src\util.h | |
| 381 | # End Source File | |
| 382 | # Begin Source File | |
| 383 | ||
| 372 | 384 | SOURCE=..\src\xslt.h |
| 373 | 385 | # End Source File |
| 386 | # Begin Source File | |
| 387 | ||
| 388 | SOURCE=..\src\yp.h | |
| 389 | # End Source File | |
| 374 | 390 | # End Group |
| 375 | 391 | # End Target |
| 376 | 392 | # End Project |
| ... | ...@@ -42,7 +42,8 @@ | |
| 42 | 42 | # PROP Ignore_Export_Lib 0 |
| 43 | 43 | # PROP Target_Dir "" |
| 44 | 44 | # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c |
| 45 | # ADD CPP /nologo /MT /W3 /GX /O2 /I "../" /I "../../libxslt/include" /I "../../curl/include" /I "../../iconv/include" /I "../../libxml2/include" /I "..\src" /I "..\src/httpp" /I "..\src/thread" /I "..\src/log" /I "..\src/avl" /I "..\src/net" /I "..\src/timings" /I "../../pthreads" /I "../../oggvorbis-win32sdk-1.0.1/include" /I "../../theora/include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "WIN32_SERVICE" /D "HAVE_CURL" /D "USE_YP" /D "HAVE_SYS_STAT_H" /D PACKAGE_VERSION=\"trunk\" /D "HAVE_THEORA" /YX /FD /c | |
| 45 | # ADD CPP /nologo /MT /W3 /GX /O2 /I "../" /I "../../libxslt/include" /I "../../curl/include" /I "../../iconv/include" /I "../../libxml2/include" /I "..\src" /I "..\src/httpp" /I "..\src/thread" /I "..\src/log" /I "..\src/avl" /I "..\src/net" /I "..\src/timings" /I "../../pthreads" /I "../../oggvorbis-win32sdk-1.0.1/include" /I "../../theora/include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "WIN32_SERVICE" /D "HAVE_CURL" /D "USE_YP" /D "HAVE_SYS_STAT_H" /D PACKAGE_VERSION=\"trunk\" /D "HAVE_THEORA" /YX /FD /D PACKAGE_STRING=\"Icecast-trunk\" /c | |
| 46 | # SUBTRACT CPP /X | |
| 46 | 47 | # ADD BASE RSC /l 0x409 /d "NDEBUG" |
| 47 | 48 | # ADD RSC /l 0x409 /d "NDEBUG" |
| 48 | 49 | BSC32=bscmake.exe |
| ... | ...@@ -33,18 +33,10 @@ | |
| 33 | 33 | #include "logging.h" |
| 34 | 34 | |
| 35 | 35 | |
| 36 | typedef struct _skeleton_codec_tag | |
| 37 | { | |
| 38 | } skeleton_codec_t; | |
| 39 | ||
| 40 | ||
| 41 | 36 | static void skeleton_codec_free (ogg_state_t *ogg_info, ogg_codec_t *codec) |
| 42 | 37 | { |
| 43 | skeleton_codec_t *skeleton = codec->specific; | |
| 44 | ||
| 45 | 38 | DEBUG0 ("freeing skeleton codec"); |
| 46 | 39 | ogg_stream_clear (&codec->os); |
| 47 | free (skeleton); | |
| 48 | 40 | free (codec); |
| 49 | 41 | } |
| 50 | 42 | |
| ... | ...@@ -82,12 +74,9 @@ | |
| 82 | 74 | ogg_codec_t *codec = calloc (1, sizeof (ogg_codec_t)); |
| 83 | 75 | ogg_packet packet; |
| 84 | 76 | |
| 85 | skeleton_codec_t *skeleton_codec = calloc (1, sizeof (skeleton_codec_t)); | |
| 86 | ||
| 87 | 77 | ogg_stream_init (&codec->os, ogg_page_serialno (page)); |
| 88 | 78 | ogg_stream_pagein (&codec->os, page); |
| 89 | 79 | |
| 90 | ||
| 91 | 80 | ogg_stream_packetout (&codec->os, &packet); |
| 92 | 81 | |
| 93 | 82 | DEBUG0("checking for skeleton codec"); |
| ... | ...@@ -95,13 +84,11 @@ | |
| 95 | 84 | if ((packet.bytes<8) || memcmp(packet.packet, "fishead\0", 8)) |
| 96 | 85 | { |
| 97 | 86 | ogg_stream_clear (&codec->os); |
| 98 | free (skeleton_codec); | |
| 99 | 87 | free (codec); |
| 100 | 88 | return NULL; |
| 101 | 89 | } |
| 102 | 90 | |
| 103 | 91 | INFO0 ("seen initial skeleton header"); |
| 104 | codec->specific = skeleton_codec; | |
| 105 | 92 | codec->process_page = process_skeleton_page; |
| 106 | 93 | codec->codec_free = skeleton_codec_free; |
| 107 | 94 | codec->headers = 1; |
| ... | ...@@ -1100,7 +1100,7 @@ | |
| 1100 | 1100 | { |
| 1101 | 1101 | #define STREAMLIST_BLKSIZE 4096 |
| 1102 | 1102 | avl_node *node; |
| 1103 | int remaining = STREAMLIST_BLKSIZE; | |
| 1103 | unsigned int remaining = STREAMLIST_BLKSIZE; | |
| 1104 | 1104 | refbuf_t *start = refbuf_new (remaining), *cur = start; |
| 1105 | 1105 | char *buffer = cur->data; |
| 1106 | 1106 |