forked from streamripper/streamripper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gcs_notes.txt
1568 lines (1279 loc) · 43.3 KB
/
gcs_notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
-----------------------------------------------------------------------
Current 1.65.0 problem list:
console says ripping instead of skipping for first track (both mp3 and ogg)
valgrind reports memory error in libmad (jump or move depends on
uninitialised value)
valgrind reports memory leaks (due to exit method)
-----------------------------------------------------------------------
1.65.0 - Testing guide
Unix MP3, OGG
Windows MP3, OGG
MP3 w, w/o metadata
Win98
Check output files
Check relay
Check cue sheets
-----------------------------------------------------------------------
String conversion
lib/external.c:
external pgm strings (metadata->utf8)
raw_metadata (utf8->metadata)
lib/filelib.c:
output_dir, output_pattern (locale -> utf8)
icy_name (metadata->utf8)
cue_file (utf8->id3)
mkdir, file_exists, etc (utf8->filesys)
lib/parse.c:
rule compile (utf8->utf8)
compose_metadata (utf8->relay)
raw_metadata parsing (metadata->utf8)
lib/ripogg.c:
artist, title (locale->utf8)
lib/rip_manager.c:
console output (utf8->locale)
end_track callback (utf8->locale)
lib/ripstream.c:
id3v1 (utf8->id3)
id3v2 (utf8->id3)
-----------------------------------------------------------------------
Plans for 1.64.X
-----------------------------------------------------------------------
(6) prefs global key file should be locked for multithreaded use
(7) parse_rules not set for plugin
-----------------------------------------------------------------------
How to sync the web site:
rsync -av --del htdocs gregsharp,streamripper@web.sourceforge.net:
-----------------------------------------------------------------------
Adding locales on debian: dpkg-reconfigure locales
Russian locales: ru_RU.CP1251, ru_RU.UTF-8
-----------------------------------------------------------------------
GLIB FAILURE ON WIN98
-----------------------------------------------------------------------
OK, another step sideways for streamripper. See the problem on
the glib bug site:
http://bugzilla.gnome.org/show_bug.cgi?id=543789
Tor states that Wide character API is not fully implemented
on windows 98. But maybe enough of it is implemented such that
GLIB can work. Here is MS's take on the matter:
http://support.microsoft.com/kb/q210341/
Maybe also this one:
http://blogs.msdn.com/michkap/archive/2006/12/27/1368334.aspx
Since streamripper requires unicows, things might not be so bad
as Tor thinks. But anyway, at least I have to stuff gnu iconv
back into 2.16.
Note also that the new winiconv is not fully implemented in glib.
Specifically, setting $WINICONV_LIBICONV_DLL does not override
the default iconv.
-----------------------------------------------------------------------
MSYS quick links
-----------------------------------------------------------------------
Cf. wiki link on manual install.
http://www.mingw.org/node/24
Cf. wiki link on msys.
http://www.mingw.org/wiki/msys
Cf. recent email exchange on this very topic.
http://sourceforge.net/mailarchive/message.php?msg_id=4889219E.2010403%40gmail.com
Cf. enlightenment wiki
http://wiki.enlightenment.org/index.php/EFL_Windows_XP
-----------------------------------------------------------------------
MSYS madness
-----------------------------------------------------------------------
MinGW/MSYS is a poorly documented and poorly packaged mess.
My notes for understanding.
Part 1. MSYS and MinGW
-----------------------
(1) A MSYS binary is a binary which depends on msys-1.0.dll.
These tend to be small utilites such as "rm" and "mv".
The MSYS binaries belong in msys directory. For example:
$ pwd
/c/msys/1.0/bin
$ cygcheck ./grep.exe
.\grep.exe
.\msys-1.0.dll
C:\Windows\system32\KERNEL32.dll
C:\Windows\system32\ntdll.dll
(2) A MinGW binary does not depend on msys-1.0.dll. Instead they
seem to depend on msvcrt.dll.
These tend to be development tools, such as "gcc" and "ar".
For example:
$ pwd
/c/MinGW/bin
$ cygcheck ./gcc.exe
.\gcc.exe
C:\Windows\system32\KERNEL32.dll
C:\Windows\system32\ntdll.dll
C:\Windows\system32\msvcrt.dll
(3) Pre-built packages. Some GNU utils come pre-built. Use at your
own risk.
Part 2. Sourceforge FRS
------------------------
The packages are all found in the sourceforge FRS. I will divide
them into subgroups that make sense to me.
(*) MSYS packages:
MSYS Base System
MSYS System Builder
(*) MinGW packages:
Automated MinGW Installer
GCC Version 2
GCC Version 3
GCC Version 4
GNU Binutils
GNU Make
GNU Source-Level Debugger
MinGW API for MS-Windows
MinGW Runtime
MinGW Utilities
MinGW Utilities: TclTk
MinGW Utilities: wget
Previous
Snapshot
User Contributed: catgets
User Contributed: execwrap
User Contributed: mingwPORT
User Contributed: Miscellany
User Contributed: pdcurses
User Contributed: regex
(*) Mixed:
MSYS Supplementary Tools
- This replaces DTK.
- autoconf has no exe files. Is it mingw or msys? It has path /usr/local.
- gettext has both mingw and msys versions. msys version has path /,
mingw version is /usr/local.
(*) Other:
Cross-Hosted MinGW Build Tool
Part 3. How to install?
------------------------
You will get a lot of conflicting advice about what to install,
and how to do it.
(*) Install MSYS using installer. Install msysDTK using installer.
(**) The msysDTK yields wacked permissions. Fix them.
(**) Be sure to update coreutils. There is a problem with /bin/install.
But it has a wacked directory structure, so you can't just overwrite
things. <Left off here...>
(**) Manually install m4 from binary. Note that the directory is
usr/bin, so you should install it in the msys shell (or manually
move it).
(*) Install MinGW manually. Follow the directions on node 24, so no
need to repeat here. I put them in /c/msys/1.0/mingw to keep things tidy.
(**) I use cygwin to unpackage these. MSYS doesn't seem to set
the permission bits correctly.
(**) The package gcc-4.3.0-20080502-mingw32-alpha-bin.tar.gz
doesn't have the correct permission bits anyway. Here is what to fix:
$ chmod a+rx bin/*.exe
$ chmod a+rx bin/*.dll
$ chmod a+rx libexec/gcc/mingw32/4.3.0/*.exe
$ chmod a+rx libexec/gcc/mingw32/4.3.0/*/*.exe
(*) Upgrade autoconf, etc., from source. Use the msys shell for this.
(**) These will be MinGW executables, but they will be installed
in /usr/local (a.k.a. c:/msys/1.0/local) instead of /mingw.
(*) Gtk website doesn't distribute a proper gettext (it does not
contain binaries that glib requires. Instead, install these
from the mingw binaries: libiconf & gettext.
(*) Install pkg-config from gtk binary. Be sure to set executable
bits after extraction.
http://www.gtk.org/download-windows.html
(*) Set the path for building glib. I put these in /etc/profile
as per Enlightenment wiki
CPPFLAGS="-I/usr/local/include"
LDFLAGS="-L/usr/local/lib"
PKG_CONFIG_PATH="/usr/local/lib/pkgconfig"
CVS_RSH=ssh
export CPPFLAGS LDFLAGS PKG_CONFIG_PATH CVS_RSH
-----------------------------------------------------------------------
Win32 API compatibility
-----------------------------------------------------------------------
The MSDN site no longer lists which Win32 API calls are compatible
with which OS revision (95/98/ME/31/35/40/2K/XP/VI).
This site might help.
http://win32.freetechsecrets.com
-----------------------------------------------------------------------
Glib references to win32 api 2.16.5 (built)
-----------------------------------------------------------------------
_AddAtomA@4
_CloseHandle@4
_CoTaskMemFree@4
x _ConvertINetMultiByteToUnicode
x _ConvertINetString
x _ConvertINetUnicodeToMultiByte
_CreateEventA@16
_CreateFileMappingA@24
_CreateSemaphoreA@16
_DeleteCriticalSection@4
x _DllMain@12
x _DllMainCRTStartup@12
_DuplicateHandle@28
_EnterCriticalSection@4
_ExpandEnvironmentStringsW@12
_FindAtomA@4
_FormatMessageW@28
_FreeEnvironmentStringsW@4
_GetACP@0
_GetAtomNameA@12
x _GetCPInfoExA@12
_GetComputerNameA@8
_GetConsoleCursorInfo@8
_GetCurrentDirectoryW@8
_GetCurrentProcess@0
_GetDateFormatW@24
_GetEnvironmentStringsW@0
_GetEnvironmentVariableW@12
_GetExitCodeProcess@8
_GetFileAttributesA@4
_GetFileAttributesW@4
_GetLastError@0
_GetLocaleInfoA@16
_GetLocaleInfoW@16
_GetModuleFileNameW@12
_GetModuleHandleA@4
_GetModuleHandleW@4
_GetProcAddress@8
_GetShortPathNameW@12
_GetStdHandle@4
_GetSystemDirectoryW@8
_GetSystemInfo@4
_GetSystemTimeAsFileTime@4
_GetThreadLocale@0
_GetTimeFormatW@24
_GetTimeZoneInformation@4
_GetUserNameW@8
_GetVersion@0
_GetWindowsDirectoryW@8
_InitializeCriticalSection@4
x _IsConvertINetStringAvailable
x _IsDBCSLeadByteEx@8
_IsDebuggerPresent@0
_IsValidCodePage@4
_IsWindow@4
x _LcidToRfc1766A
_LeaveCriticalSection@4
_LoadLibraryA@4
_LocalFree@4
_MapViewOfFile@20
_MessageBoxA@16
_MirLev0
_MirLev1
_MirLev2
_MirLev3
_MoveFileExW@12
_MsgWaitForMultipleObjectsEx@20
x _MultiByteToWideChar@24
x _PeekConsoleInputA@16
_PeekMessageA@20
_PeekNamedPipe@24
_PostMessageA@16
x _ReadConsoleInputA@16
_ReadFile@20
_RegCloseKey@4
_RegOpenKeyExW@20
_RegQueryValueExW@24
_ReleaseSemaphore@12
_ResetEvent@4
x _Rfc1766ToLcidA
_SHGetPathFromIDListW@8
_SHGetSpecialFolderLocation@12
_SetEnvironmentVariableW@8
_SetEvent@4
_Sleep@4
_SleepEx@8
_UnmapViewOfFile@4
_VirtualQuery@12
_WSACreateEvent@0
_WSAEnumNetworkEvents@12
_WSAEventSelect@12
_WSAGetLastError@0
_WaitForMultipleObjectsEx@20
_WaitForSingleObject@8
x _WideCharToMultiByte@32
_WriteFile@20
-----------------------------------------------------------------------
Glib references to win32 api 2.16.5 (reference)
-----------------------------------------------------------------------
_AddAtomA@4
_CloseHandle@4
_CoTaskMemFree@4
_ConvertINetMultiByteToUnicode
_ConvertINetString
_ConvertINetUnicodeToMultiByte
_CreateEventA@16
_CreateFileMappingA@24
_CreateSemaphoreA@16
_DeleteCriticalSection@4
_DllMain@12
_DllMainCRTStartup@12
_DuplicateHandle@28
_EnterCriticalSection@4
_ExpandEnvironmentStringsW@12
_FindAtomA@4
_FormatMessageW@28
_FreeEnvironmentStringsW@4
_GetACP@0
_GetAtomNameA@12
_GetCPInfoExA@12
_GetComputerNameA@8
_GetConsoleCursorInfo@8
_GetCurrentDirectoryW@8
_GetCurrentProcess@0
_GetDateFormatW@24
_GetEnvironmentStringsW@0
_GetEnvironmentVariableW@12
_GetExitCodeProcess@8
_GetFileAttributesA@4
_GetFileAttributesW@4
_GetLastError@0
_GetLocaleInfoA@16
_GetLocaleInfoW@16
_GetModuleFileNameW@12
_GetModuleHandleA@4
_GetModuleHandleW@4
_GetProcAddress@8
_GetShortPathNameW@12
_GetStdHandle@4
_GetSystemDirectoryW@8
_GetSystemInfo@4
_GetSystemTimeAsFileTime@4
_GetThreadLocale@0
_GetTimeFormatW@24
_GetTimeZoneInformation@4
_GetUserNameW@8
_GetVersion@0
_GetWindowsDirectoryW@8
_InitializeCriticalSection@4
_IsConvertINetStringAvailable
_IsDBCSLeadByteEx@8
_IsDebuggerPresent@0
_IsValidCodePage@4
_IsWindow@4
_LcidToRfc1766A
_LeaveCriticalSection@4
_LoadLibraryA@4
_LocalFree@4
_MapViewOfFile@20
_MessageBoxA@16
_MirLev0
_MirLev1
_MirLev2
_MirLev3
_MoveFileExW@12
_MsgWaitForMultipleObjectsEx@20
_MultiByteToWideChar@24
_PeekConsoleInputA@16
_PeekMessageA@20
_PeekNamedPipe@24
_PostMessageA@16
_ReadConsoleInputA@16
_ReadFile@20
_RegCloseKey@4
_RegOpenKeyExW@20
_RegQueryValueExW@24
_ReleaseSemaphore@12
_ResetEvent@4
_Rfc1766ToLcidA
_SHGetPathFromIDListW@8
_SHGetSpecialFolderLocation@12
_SetEnvironmentVariableW@8
_SetEvent@4
_Sleep@4
_SleepEx@8
_UnmapViewOfFile@4
_VirtualQuery@12
_WSACreateEvent@0
_WSAEnumNetworkEvents@12
_WSAEventSelect@12
_WSAGetLastError@0
_WaitForMultipleObjectsEx@20
_WaitForSingleObject@8
_WideCharToMultiByte@32
_WriteFile@20
-----------------------------------------------------------------------
Glib references to win32 api 2.12.12
-----------------------------------------------------------------------
_AddAtomA@4
_CloseHandle@4
_CoTaskMemFree@4
_CreateEventA@16
_CreateFileMappingA@24
_CreateSemaphoreA@16
_DeleteCriticalSection@4
_DuplicateHandle@28
_EnterCriticalSection@4
_ExpandEnvironmentStringsA@12
_ExpandEnvironmentStringsW@12
_FindAtomA@4
_FormatMessageA@28
_FormatMessageW@28
_FreeEnvironmentStringsW@4
_GetACP@0
_GetAtomNameA@12
_GetComputerNameA@8
_GetConsoleCursorInfo@8
_GetCurrentDirectoryA@8
_GetCurrentDirectoryW@8
_GetCurrentProcess@0
_GetDateFormatW@24
_GetEnvironmentStringsW@0
_GetEnvironmentVariableA@12
_GetEnvironmentVariableW@12
_GetExitCodeProcess@8
_GetFileAttributesA@4
_GetFileAttributesW@4
_GetLastError@0
_GetLocaleInfoA@16
_GetLocaleInfoW@16
_GetModuleFileNameA@12
_GetModuleFileNameW@12
_GetModuleHandleA@4
_GetModuleHandleW@4
_GetProcAddress@8
_GetShortPathNameW@12
_GetStdHandle@4
_GetSystemDirectoryA@8
_GetSystemDirectoryW@8
_GetSystemInfo@4
_GetSystemTimeAsFileTime@4
_GetThreadLocale@0
_GetTimeFormatW@24
_GetTimeZoneInformation@4
_GetUserNameA@8
_GetUserNameW@8
_GetVersion@0
_GetWindowsDirectoryA@8
_GetWindowsDirectoryW@8
_InitializeCriticalSection@4
_IsDebuggerPresent@0
_IsWindow@4
_KillTimer@8
_LeaveCriticalSection@4
_LoadLibraryA@4
_LocalFree@4
_MapViewOfFile@20
_MessageBoxA@16
_MoveFileExW@12
_MsgWaitForMultipleObjects@20
_PeekMessageA@20
_PeekNamedPipe@24
_PostMessageA@16
_ReadFile@20
_RegCloseKey@4
_RegOpenKeyExA@20
_RegOpenKeyExW@20
_RegQueryValueExA@24
_RegQueryValueExW@24
_ReleaseSemaphore@12
_ResetEvent@4
_SHGetPathFromIDListA@8
_SHGetPathFromIDListW@8
_SHGetSpecialFolderLocation@12
_SetEnvironmentVariableW@8
_SetEvent@4
_SetTimer@16
_Sleep@4
_UnmapViewOfFile@4
_VirtualQuery@12
_WSACreateEvent@0
_WSAEnumNetworkEvents@12
_WSAEventSelect@12
_WSAGetLastError@0
_WaitForMultipleObjects@16
_WaitForSingleObject@8
_WaitMessage@0
_WriteFile@20
-----------------------------------------------------------------------
How to build glib win32 for streamripper
-----------------------------------------------------------------------
1) Edit configure.in. Commentout this part
if test x"$glib_native_win32" = xyes; then
with_libiconv=native
else
2) Edit glib/gconvert.c. It should include iconv.h instead of win_iconv.c.
3) Workaround bug in GetCurrentDirectoryW in unicows.dll.
File: gutils.h
Change
len = GetCurrentDirectoryW (2, dummy);
To
len = GetCurrentDirectoryW (0, dummy);
4) Re-enable runtime check
File: gwin32.h
Change
#define G_WIN32_IS_NT_BASED() TRUE
#define G_WIN32_HAVE_WIDECHAR_API() TRUE
To
#define G_WIN32_IS_NT_BASED() (g_win32_get_windows_version () < 0x80000000)
#define G_WIN32_HAVE_WIDECHAR_API() (G_WIN32_IS_NT_BASED ())
5) Re-implement checks for missing or buggy _w* or win32 API
Buggy Windows API implementations (e.g. MoveFileExW) are worked
around in OOo as uwinapi.dll
http://lxr.go-oo.org/source/porting/sal/systools/win32/uwinapi/
Files:
gdate.c
gfileutils.c
gstdio.c
gwin32.c
I skipped these, since the logic changed slightly, but I'm not
using them anyway.
gspawn-win32.c
gspawn-win32-helper.c
I don't think I need to modify gwin32.c, because I am using unicows.
gwin32.c
6) Build glib
7) Manually re-link with libunicows. Just do a make -n, to get the
original command line, and add this to the beginning of the link
-L/usr/local/lib -lunicows
It would look like the below. This is found in "relink-unicows.sh"
gcc -shared .libs/libglib-2.0-0.dll.def \
-L/usr/local/lib -lunicows \
.libs/garray.o \
.libs/gasyncqueue.o .libs/gatomic.o .libs/gbacktrace.o \
.libs/gbase64.o .libs/gbookmarkfile.o .libs/gcache.o \
.libs/gchecksum.o .libs/gcompletion.o .libs/gconvert.o \
.libs/gdataset.o .libs/gdate.o .libs/gdir.o \
.libs/gerror.o .libs/gfileutils.o .libs/ghash.o \
.libs/ghook.o .libs/giochannel.o .libs/gkeyfile.o \
.libs/glist.o .libs/gmain.o .libs/gmappedfile.o \
.libs/gmarkup.o .libs/gmem.o .libs/gmessages.o \
.libs/gnode.o .libs/goption.o .libs/gpattern.o \
.libs/gprimes.o .libs/gqsort.o .libs/gqueue.o \
.libs/grel.o .libs/grand.o .libs/gregex.o \
.libs/gscanner.o .libs/gsequence.o .libs/gshell.o \
.libs/gslice.o .libs/gslist.o .libs/gstdio.o \
.libs/gstrfuncs.o .libs/gstring.o .libs/gtestutils.o \
.libs/gthread.o .libs/gthreadpool.o .libs/gtimer.o \
.libs/gtree.o .libs/guniprop.o .libs/gutf8.o \
.libs/gunibreak.o .libs/gunicollate.o .libs/gunidecomp.o \
.libs/gurifuncs.o .libs/gutils.o .libs/gprintf.o \
.libs/giowin32.o .libs/gspawn-win32.o .libs/gwin32.o \
-Wl,--whole-archive libcharset/.libs/libcharset.a \
gnulib/.libs/libgnulib.a pcre/.libs/libpcre.a \
-Wl,--no-whole-archive \
-L/usr/local/lib -lws2_32 -lole32 \
/usr/local/lib/libiconv.dll.a \
/usr/local/lib/libintl.dll.a -mms-bitfields \
-Wl,glib-win32-res.o -o .libs/libglib-2.0-0.dll \
-Wl,--enable-auto-image-base -Xlinker --out-implib \
-Xlinker .libs/libglib-2.0.dll.a
-----------------------------------------------------------------------
Prefs/debug startup
-----------------------------------------------------------------------
command line version:
1) Load prefs
2) Parse command line parms
3) Open debug
4) rip_manager_init
wstreamripper:
1) Parse command line parms
2) rip_manager_init
3) Open debug
4) Load prefs
-----------------------------------------------------------------------
Basic connection code
-----------------------------------------------------------------------
http_sc_connect
http_get_sc_header
http_parse_sc_header
http_sc_connect (recursive case)
-----------------------------------------------------------------------
Multirip/main loop
-----------------------------------------------------------------------
Streamripper has 4 threads, and one child process.
main (GUI thread)
ripthread (reads from server)
thread_accept (waits for new relay connections)
thread_send (writes to relay clients)
External process (reads from stdin pipe)
ripthread (1.63.3 and earlier)
start_ripping
http_sc_connect
filelib_init
spawn_external
ripstream_clear
ripstream_init
relaylib_start
while (1)
ripstream_rip
check exit conditions
post_status
if recoverable error
close_stuff
start_ripping
if not recoverable
break
Subsystem naming convention
rip_manager_init() // Static memory/once per process
rip_manager_start() // Dynamic memory/once per stream
rip_manager_stop() // Dynamic memory/once per stream
rip_manager_cleanup() // Static memory/once per process
Shutdown procedure
signal handler sets m_got_sig on (CTL-C)
callback sets m_alldone on ??
gui thread polls m_got_sig and m_alldone
call rip_manager_stop() if either flags are seen
Relay startup and shutdown
rip_manager_start() calls relaylib_start()
On reconnection, ripthread() calls relaylib_stop() and relaylib_start()
Data structs:
1) Global preferences
2) Stream preferences
3) Stream state variables (rmi)
Semaphore/Mutex
1) cbuf2->cbuf_sem
2) m_debug_lock
3) m_started_sem
4) m_sem_not_connected
5) g_relay_list_sem
-----------------------------------------------------------------------
HTTP HEADERS
-----------------------------------------------------------------------
http://141.211.232.136:8000/wcbn-lo.ogg
===============================
http://stream.orban.com:8006 (Shoutcast/aac)
===============================
ICY 200 OK
icy-notice1:<BR>This stream requires <a href="http://www.winamp.com/">Winamp</a>
<BR>
icy-notice2:SHOUTcast Distributed Network Audio Server/win32 v1.9.4<BR>
icy-name:Nap's Jazz and Smooth Jazz
icy-genre:Jazz
icy-url:http://www.orban.com
content-type:audio/aac
icy-pub:1
icy-metaint:8192
icy-br:32
http://inet.orban.com:8010/test.aac (icecast2/aac)
===============================
HTTP/1.0 200 OK
Content-Type: audio/mpeg
icy-metaint:16000
icy-br:32
icy-description:Hi-Fi Internet Audio
icy-genre:Various
icy-name:Orban Opticodec-PC Encoder - aacPlus v2 Evaluation Stream
icy-pub:1
icy-url:http://www.orban.com
Server: Icecast 2.1.0
http://stream2.noise.net.nz:8000/twisted-lofi.ogg (icecast2/ogg)
===============================
HTTP/1.0 200 OK
Content-Type: application/ogg
ice-audio-info: samplerate=22000
icy-description:More than just great dance music!
icy-genre:Dance
icy-name:Twisted 107.7FM
icy-pub:1
icy-url:http://www.twisted.co.nz
Server: Icecast 2.0-kh58
http://rstream.xmission.com:8000/krcl-low.ogg (icecast2/ogg)
===============================
HTTP/1.0 200 OK
Content-Type: application/ogg
icy-br:0
icy-genre:ecclectic
icy-name:KRCL Community Radio
icy-pub:1
icy-url:http://www.krcl.org
Server: Icecast 2.1.0
http://64.236.34.97/stream/1021
===============================
ICY 200 OK
icy-notice1: <BR>This stream requires <a href="http://www.winamp.com/">Winamp</a><BR>
icy-notice2: SHOUTcast Distributed Network Audio Server/SolarisSparc v1.9.4<BR>
icy-name: Secret Agent: The soundtrack for your stylish, mysterious, dangerous life. For Spys and P.I.'s too! [SomaFM]
icy-genre: Downtempo Lounge Spy
icy-url: http://www.somafm.com
icy-pub: 1
icy-metaint: 8192
icy-br: 128
icy-irc: #shoutcast
icy-icq: 0
icy-aim: N/A
"http://nsv.stream.aol.com/uvox?cachefile=/aol/us/aolmusic/artists/wmg/80spopculture/aha_takeonme_120.nsv"
===============================
HTTP/1.1 200 OK
Date: Fri, 17 Sep 2004 21:15:06 GMT
Server: MODS/1.0 (optimized-dpare-02)
Content-Length: 2768860
Ultravox-Max-Msg: 3080
Ultravox-Avg-Bitrate: 98588
Ultravox-Max-Bitrate: 98588
Accept-Ranges: bytes
Connection: close
Content-Type: misc/ultravox
http://64.156.25.86:8010/;stream.nsv (last exile)
http://64.156.25.86:8000/;stream.nsv (love hina)
===============================
ICY 200 OK
icy-notice1:<BR>This stream requires <a href="http://www.winamp.com/">Winamp</a><BR>
icy-notice2:SHOUTcast Distributed Network Audio Server/FreeBSD4 v1.9.2<BR>
icy-name:desync.com: Last Exile
icy-genre:Anime
icy-url:http://desync.com/
Content-Type:video/nsv
icy-pub:1
icy-metaint:8192
icy-br:500
http://pubint.sc.llnwd.net:10045/
===============================
ICY 200 OK
icy-notice1:<BR>This stream requires <a href="http://www.winamp.com/">Winamp</a><BR>
icy-notice2:SHOUTcast Distributed Network Audio Server/Linux v1.9.2<BR>
icy-name:KUVO Public Radio
icy-genre:
icy-url:http://www.kuvo.org
Content-Type:audio/mpeg
icy-pub:0
icy-metaint:8192
icy-br:24
"http://www.live365.com/play/294341?LID=506-usa&lid=506-usa&SaneID=132.183.12.126-1095458924342&AuthType=NORMAL&VisitCount=1&bitrate=256&now=1095458993234&pid=40564"
===============================
---------------
HTTP/1.1 302 Found
Date: Fri, 17 Sep 2004 22:11:04 GMT
Server: Apache
Location: http://216.235.81.11:20186/play?membername=&session=velvet_ant:0&LID=506-usa&lid=506-usa&AuthType=NORMAL&SaneID=132.183.12.126-1095458924342&VisitCount=1&bitrate=256&now=1095458993234&pid=40564
Content-Type: text/html; charset=iso-8859-1
Connection: close
---------------
---------------
HTTP/1.0 200 OK
Server: Nanocaster/2.5.13
Content-Type: audio/mpeg
Cache-Control: no-cache
Pragma: no-cache
Connection: close
Content-Length: 44000000
---------------
Shoutcast vs streamripper headers
=================================
ICY 200 OK
icy-notice1:<BR>This stream requires <a href="http://www.winamp.com/">Winamp</a><BR>
icy-notice2:SHOUTcast Distributed Network Audio Server/Linux v1.9.4<BR>
icy-name:[JAPANESE R&B, HIPHOP, JROCK, JPOP & NEW RELEASES] SeiyaUsagi.Net Radio wo kiite kudasai!: SeiyaUsagi.Net Radio
icy-genre:World
icy-url:http://www.seiyausagi.net
content-type:audio/mpeg
icy-pub:1
icy-metaint:8192
icy-br:32
HTTP/1.0 200 OK
Server:SHOUTcast/Linux v1.9.4
icy-name:[relay stream] [JAPANESE R&B, HIPHOP, JROCK, JPOP & NEW RELEASES] SeiyaUsagi.Net Radio wo kiite kudasai!: SeiyaUsagi.Net Radio
icy-url:http://www.seiyausagi.net
icy-br:32
icy-metaint:8192
Content-Type: audio/mpeg
* More problems
Bitrate = 0 stuff:
http://www.mperia.com:8000/content/1569.mp3
-----------------------------------------------------------------------
* New filename output stuff
-----------------------------------------------------------------------
Pattern specifiers you can use:
%S Stream
%A Artist
%T Title
%a Album
%D Date and time (per song)
%d Date and time (per execution)
%Q Sequence number (parsing files to find it)
%q Sequence number (starting from zero)
%0203q Sequence number (starting from 203)
%V Song version number (?)
%% Percent sign
The default pattern is:
%S/%A - %T
Extensions, such as ".mp3", ".aac", ".ogg", or ".nsv" are
automatically appended.
Incomplete directory will be the most deeply nested directory
that doesn't depend on the pattern specifiers %A, %T, %a, %D,
%q, or %Q. The directory may depend on %d and %S.
Thus, the default incomplete directory is:
%S/incomplete
The filename within the incomplete directory is ??
For showfile, the idea is similar, but some patterns don't apply. Thus,
the default pattern is:
%S/sr_program_%d
HERE IS HOW THE -d and -D FLAGS INTERACT:
-d dir -D pat Action
-------- -------- ---------
absolute absolute Use: pat
relative absolute Use: pat
missing absolute Use: pat
absolute relative Concatinate: dir/pat
relative relative Concatinate: pwd/dir/pat
missing relative Concatinate: pwd/pat
absolute missing Concatinate: dir/default_pat
relative missing Concatinate: pwd/dir/default_pat
missing missing Use: pwd/default_pat
-----------------------------------------------------------------------
* How to upgrade the version number
-----------------------------------------------------------------------
1) configure.ac
2) lib/rip_manager.h
3) winamp_plugin/sr2x.nsi
4) makedist_win.bat
5) streamripper.1.asc
-----------------------------------------------------------------------
* Generated files
-----------------------------------------------------------------------
I deleted the automatically generated files from CVS. The people
who download from CVS should be advanced enough to figure out
how to build. Just in case, I included a config.sh file to show
how it is done.
Note the Windows mad.h should be coming from the msvc++ directory
anyways, so there is no need to keep the version built on unix.
CVS: Makefile.in configure libmad/Makefile.in
CVS: libmad-0.15.1b/Makefile.in libmad-0.15.1b/mad.h
CVS: libmad-0.15.1b/msvc++/Makefile.in
-----------------------------------------------------------------------
* Compile farms
-----------------------------------------------------------------------
http://www.testdrive.hp.com hpux, freebsd
http://powerdev.osuosl.org linux
http://www.blastwave.org solaris
http://freeshell.org netbsd
For HP-UX, I'm testing on this one:
td191.testdrive.hp.com
-----------------------------------------------------------------------
* How to build streamripper on hp testdrive host
-----------------------------------------------------------------------
1) pkg-config
2) gettext
3) glib
CFLAGS=-I$HOME/LOCAL-td191/include LDFLAGS=-L$HOME/LOCAL-td191/lib ./configure --prefix=$HOME/LOCAL-td191
-----------------------------------------------------------------------
* MP3 utilities
-----------------------------------------------------------------------
MP3TRIM
~~~~~~~
http://www.logiccell.com/~mp3trim/
(win only - did not seem to fix/detect prob)
ENCSPOT
~~~~~~~
http://www.guerillasoft.nstemp.com/EncSpot2/download.html