-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmplayer-svn-src-aros.patch
2963 lines (2686 loc) · 89.7 KB
/
mplayer-svn-src-aros.patch
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
diff -ur -x.svn mplayer-svn-src/configure mplayer-svn-src-aros/configure
--- mplayer-svn-src/configure 2012-04-15 21:43:24.000000000 +0200
+++ mplayer-svn-src-aros/configure 2012-04-16 19:18:01.000000000 +0200
@@ -224,6 +224,7 @@
}
aix() { issystem "AIX"; }
amigaos() { issystem "AmigaOS"; }
+aros() { issystem "AROS"; }
bsdos() { issystem "BSD/OS"; }
cygwin() { issystem "CYGWIN"; }
darwin() { issystem "Darwin"; }
@@ -1534,6 +1535,7 @@
amigaos) system_name=AmigaOS ;;
mingw32*) system_name=MINGW32 ;;
wine) system_name=Wine ;;
+ aros) system_name=AROS ;;
esac
done
# We need to convert underscores so that values like k6-2 and pentium-mmx can be passed
@@ -1591,6 +1593,20 @@
extra_cflags="-DNEWLIB -D__USE_INLINE__ $extra_cflags"
fi
+if aros ; then
+ extra_cflags="-nix -D__MORPHOS__ -DHAVE_SWAB -D__BSD_VISIBLE=1 -fno-strict-aliasing -Iaros/include -Ilibdvdnav $extra_cflags"
+ extra_ldflags="$extra_ldflags -nix -L./aros/obj -lmissing -lcybergraphics"
+ _aros_common=yes
+ _cgx_common=yes
+ _cgx_wpa=yes
+ _ahi_dev=yes
+ _bindir="PROGDIR:"
+ _datadir="PROGDIR:conf"
+ _mandir="PROGDIR:man"
+ _confdir="PROGDIR:conf"
+ _libdir="PROGDIR:"
+fi
+
if qnx ; then
extra_ldflags="$extra_ldflags -lph"
fi
@@ -3154,12 +3170,22 @@
echocheck "socklib"
+if aros ; then
+cat > $TMPC << EOF
+#include <netdb.h>
+#include <proto/socket.h>
+#include <sys/socket.h>
+struct Library * SocketBase = NULL;
+int main(void) { (void) gethostbyname(0); (void) socket(AF_INET, SOCK_STREAM, 0); return 0; }
+EOF
+else
# for Solaris (socket stuff is in -lsocket, gethostbyname and friends in -lnsl):
cat > $TMPC << EOF
#include <netdb.h>
#include <sys/socket.h>
int main(void) { gethostbyname(0); socket(AF_INET, SOCK_STREAM, 0); return 0; }
EOF
+fi
_socklib=no
for ld_tmp in "" "-lsocket -ldnet" "-lsocket -lnsl" "-lnsl" "-lsocket" ; do
cc_check $ld_tmp && ld_sock="$ld_tmp" && _socklib=yes && break
@@ -3292,11 +3318,16 @@
echores "$_struct_sockaddr_sa_len"
+# AROS: Check modified to include <sys/socket.h>
echocheck "arpa/inet.h"
arpa_inet_h=no
def_arpa_inet_h='#define HAVE_ARPA_INET_H 0'
-header_check arpa/inet.h && arpa_inet_h=yes &&
- def_arpa_inet_h='#define HAVE_ARPA_INET_H 1'
+cat > $TMPC << EOF
+#include <sys/socket.h>
+#include <arpa/inet.h>
+int main(void) { return 0; }
+EOF
+cc_check && arpa_inet_h=yes && def_arpa_inet_h='#define HAVE_ARPA_INET_H 1'
echores "$arpa_inet_h"
@@ -3353,6 +3384,9 @@
echocheck "networking"
test $_winsock2_h = no && test $inet_pton = no &&
test $inet_aton = no && networking=no
+if aros ; then
+networking=yes
+fi
if test "$networking" = yes ; then
def_network='#define CONFIG_NETWORK 1'
def_networking='#define CONFIG_NETWORKING 1'
@@ -5676,11 +5710,13 @@
test $(uname -r | sed 's/^5\.//') -gt 10 && default_cdrom_device="/cdrom/cdrom0"
elif amigaos ; then
default_cdrom_device="a1ide.device:2"
+elif aros ; then
+ default_cdrom_device="ata.device:2"
else
default_cdrom_device="/dev/cdrom"
fi
-if win32 || os2 || dragonfly || freebsd || openbsd || sunos || amigaos ; then
+if win32 || os2 || dragonfly || freebsd || openbsd || sunos || amigaos || aros ; then
default_dvd_device=$default_cdrom_device
elif darwin ; then
default_dvd_device="/dev/rdiskN"
@@ -5692,7 +5728,7 @@
echocheck "VCD support"
if test "$_vcd" = auto; then
_vcd=no
- if linux || freebsd || netbsd || openbsd || dragonfly || bsdos || darwin || sunos || os2; then
+ if linux || freebsd || netbsd || openbsd || dragonfly || bsdos || darwin || sunos || os2 ; then
_vcd=yes
elif mingw32; then
header_check ddk/ntddcdrm.h && _vcd=yes
@@ -5736,6 +5772,10 @@
_dvdread_internal=yes
_dvdread=yes
extra_cflags="-Ilibdvdread4 $extra_cflags"
+ elif aros ; then
+ _dvdread_internal=yes
+ _dvdread=yes
+ extra_cflags="-Ilibdvdread4 $extra_cflags"
fi
elif test "$_dvdread" = auto ; then
_dvdread=no
@@ -5878,6 +5918,8 @@
fi
echores "$_bitmap_font"
+if aros ; then
+#FreeType AROS check
echocheck "freetype >= 2.0.9"
@@ -5888,6 +5930,125 @@
fi
if test "$_freetype" = auto ; then
+
+ cat > $TMPC << EOF
+#include <stdio.h>
+#include <ft2build.h>
+#include FT_FREETYPE_H
+#if ((FREETYPE_MAJOR < 2) || ((FREETYPE_MINOR == 0) && (FREETYPE_PATCH < 9)))
+#error "Need FreeType 2.0.9 or newer"
+#endif
+int main(void) {
+ FT_Library library;
+ FT_Int major=-1,minor=-1,patch=-1;
+ int err=FT_Init_FreeType(&library);
+ return 0;
+}
+EOF
+ _freetype=no
+ cc_check -lfreetype2 && _freetype=yes
+fi
+if test "$_freetype" = yes ; then
+ def_freetype='#define CONFIG_FREETYPE 1'
+ extra_ldflags="$extra_ldflags -lfreetype2"
+else
+ def_freetype='#undef CONFIG_FREETYPE'
+fi
+echores "$_freetype"
+
+if test "$_freetype" = no ; then
+ _fontconfig=no
+ _res_comment="FreeType support needed"
+fi
+echocheck "fontconfig"
+if test "$_fontconfig" = auto ; then
+ cat > $TMPC << EOF
+#include <stdio.h>
+#include <stdlib.h>
+#include <fontconfig/fontconfig.h>
+#if FC_VERSION < 20402
+#error At least version 2.4.2 of fontconfig required
+#endif
+int main(void) {
+ int err = FcInit();
+ if (err == FcFalse) {
+ printf("Couldn't initialize fontconfig lib\n");
+ exit(err);
+ }
+ return 0;
+}
+EOF
+ _fontconfig=no
+ for _ld_tmp in "" "-lexpat -lfreetype" "-lexpat -lfreetype -lz" "-lexpat -lfreetype -lz -liconv" ; do
+ _ld_tmp="-lfontconfig $_ld_tmp"
+ cc_check $_ld_tmp && _fontconfig=yes && extra_ldflags="$extra_ldflags $_ld_tmp" && break
+ done
+ if test "$_fontconfig" = no && $_pkg_config --exists fontconfig ; then
+ _inc_tmp=$($_pkg_config --cflags fontconfig)
+ _ld_tmp=$($_pkg_config --libs fontconfig)
+ cc_check $_inc_tmp $_ld_tmp && _fontconfig=yes \
+ && extra_ldflags="$extra_ldflags $_ld_tmp" && extra_cflags="$extra_cflags $_inc_tmp"
+ fi
+fi
+if test "$_fontconfig" = yes ; then
+ def_fontconfig='#define CONFIG_FONTCONFIG 1'
+else
+ def_fontconfig='#undef CONFIG_FONTCONFIG'
+fi
+echores "$_fontconfig"
+
+
+echocheck "SSA/ASS support"
+# libass depends on FreeType
+if test "$_freetype" = no ; then
+ _ass=no
+ ass_internal=no
+ _res_comment="FreeType support needed"
+fi
+
+if test "$_ass" = auto ; then
+ cat > $TMPC << EOF
+#include <ft2build.h>
+#include FT_FREETYPE_H
+#if ((FREETYPE_MAJOR < 2) || (FREETYPE_MINOR < 2) || ((FREETYPE_MINOR == 2) && (FREETYPE_PATCH < 1)))
+#error "Need FreeType 2.2.1 or newer"
+#endif
+int main(void) { return 0; }
+EOF
+ _ass=no
+ cc_check && _ass=yes
+ if test "$_ass" = no ; then
+ ass_internal=no
+ _res_comment="FreeType >= 2.2.1 needed"
+ elif test "$ass_internal" = no ; then
+ _res_comment="external"
+ extra_ldflags="$extra_ldflags -lass"
+ fi
+fi
+if test "$_ass" = yes ; then
+ def_ass='#define CONFIG_ASS 1'
+else
+ def_ass='#undef CONFIG_ASS'
+fi
+if test "$ass_internal" = yes ; then
+ def_ass_internal='#define CONFIG_ASS_INTERNAL 1'
+else
+ def_ass_internal='#undef CONFIG_ASS_INTERNAL'
+fi
+echores "$_ass"
+
+else
+#FreeType regular check
+
+echocheck "freetype >= 2.0.9"
+
+# freetype depends on iconv
+if test "$_iconv" = no ; then
+ _freetype=no
+ _res_comment="iconv support needed"
+fi
+
+if test "$_freetype" = auto ; then
if ( $_freetypeconfig --version ) >/dev/null 2>&1 ; then
cat > $TMPC << EOF
#include <stdio.h>
@@ -6044,6 +6205,7 @@
ass_internal=no
fi
echores "$_ass"
+fi
echocheck "ENCA"
@@ -7441,7 +7603,11 @@
fi
test "$_freetype" = no && test "$_bitmap_font" = no &&
die "The GUI requires either FreeType or bitmap font support."
-if ! win32 ; then
+if aros ; then
+ _gui_mui=yes
+ libs_mplayer="$libs_mplayer -lmui"
+ def_gui='#define CONFIG_GUI 1'
+elif ! win32 ; then
_gui_gtk=yes
test "$_x11" != yes && die "X11 support required for GUI compilation."
@@ -8022,16 +8188,20 @@
# features
3DFX = $_3dfx
AA = $_aa
+AHI_DEV = $_ahi_dev
ALSA = $_alsa
APPLE_IR = $_apple_ir
APPLE_REMOTE = $_apple_remote
ARTS = $_arts
+AROS_COMMON = $_aros_common
AUDIO_INPUT = $_audio_input
BITMAP_FONT = $_bitmap_font
BL = $_bl
CACA = $_caca
CDDA = $_cdda
CDDB = $_cddb
+CGX_COMMON = $_cgx_common
+CGX_WPA = $_cgx_wpa
COREAUDIO = $_coreaudio
COREVIDEO = $_corevideo
DART = $_dart
@@ -8063,6 +8233,7 @@
MATRIXVIEW = $matrixview
GUI = $_gui
GUI_GTK = $_gui_gtk
+GUI_MUI = $_gui_mui
GUI_WIN32 = $_gui_win32
HAVE_POSIX_SELECT = $_posix_select
HAVE_SYS_MMAN_H = $_mman
diff -ur -x.svn mplayer-svn-src/cpudetect.c mplayer-svn-src-aros/cpudetect.c
--- mplayer-svn-src/cpudetect.c 2012-04-15 21:43:24.000000000 +0200
+++ mplayer-svn-src-aros/cpudetect.c 2012-04-15 21:50:50.000000000 +0200
@@ -25,11 +25,13 @@
#include <stdlib.h>
-#ifdef __MORPHOS__
+#if defined(__MORPHOS__) && !defined(__AROS__)
#include <proto/exec.h>
#include <exec/execbase.h>
#include <exec/system.h>
+#endif
+#if defined(__MORPHOS__)
int altivec_disabled = 0;
#endif
@@ -225,6 +227,9 @@
mp_msg(MSGT_CPUDETECT,MSGL_WARN, "Cannot test OS support for SSE, disabling to be safe.\n" );
gCpuCaps.hasSSE=0;
#endif /* _POSIX_SOURCE */
+#elif defined(__AROS__)
+ /* No changes. AROS kernel support SSE/SSE2 */
+ /* gCpuCaps.hasSSE=0; */
#else
/* Do nothing on other platforms for now.
*/
diff -ur -x.svn mplayer-svn-src/ffmpeg/libavcodec/utils.c mplayer-svn-src-aros/ffmpeg/libavcodec/utils.c
--- mplayer-svn-src/ffmpeg/libavcodec/utils.c 2012-03-17 01:45:47.000000000 +0100
+++ mplayer-svn-src-aros/ffmpeg/libavcodec/utils.c 2012-04-17 19:36:10.000000000 +0200
@@ -48,6 +48,10 @@
#include <limits.h>
#include <float.h>
+#ifdef __AROS__
+#define SIZE_MAX INT32_MAX
+#endif
+
static int volatile entangled_thread_counter=0;
static int (*ff_lockmgr_cb)(void **mutex, enum AVLockOp op);
static void *codec_mutex;
diff -ur -x.svn mplayer-svn-src/ffmpeg/libavformat/os_support.c mplayer-svn-src-aros/ffmpeg/libavformat/os_support.c
--- mplayer-svn-src/ffmpeg/libavformat/os_support.c 2012-01-26 23:15:59.000000000 +0100
+++ mplayer-svn-src-aros/ffmpeg/libavformat/os_support.c 2012-04-17 19:34:44.000000000 +0200
@@ -69,6 +69,11 @@
#include "network.h"
+#ifndef INADDR_LOOPBACK
+#define INADDR_LOOPBACK 0x7f000001
+#endif
+
+
#if !HAVE_INET_ATON
#include <stdlib.h>
diff -ur -x.svn mplayer-svn-src/ffmpeg/libavformat/os_support.h mplayer-svn-src-aros/ffmpeg/libavformat/os_support.h
--- mplayer-svn-src/ffmpeg/libavformat/os_support.h 2012-01-26 23:15:59.000000000 +0100
+++ mplayer-svn-src-aros/ffmpeg/libavformat/os_support.h 2012-04-17 19:40:55.000000000 +0200
@@ -60,6 +60,13 @@
#define closesocket close
#endif
+#if defined(__AROS__)
+#undef closesocket
+#define closesocket CloseSocket
+#include <proto/socket.h>
+#define atoll(x) atol(x)
+#endif
+
#if !HAVE_POLL_H
typedef unsigned long nfds_t;
diff -ur -x.svn mplayer-svn-src/ffmpeg/libavformat/rtsp.h mplayer-svn-src-aros/ffmpeg/libavformat/rtsp.h
--- mplayer-svn-src/ffmpeg/libavformat/rtsp.h 2012-01-26 23:15:59.000000000 +0100
+++ mplayer-svn-src-aros/ffmpeg/libavformat/rtsp.h 2012-04-17 19:38:26.000000000 +0200
@@ -31,6 +31,14 @@
#include "libavutil/log.h"
#include "libavutil/opt.h"
+#ifndef INET_ADDRSTRLEN
+#define INET_ADDRSTRLEN (16)
+#endif
+
+#ifndef INET6_ADDRSTRLEN
+#define INET6_ADDRSTRLEN (48)
+#endif
+
/**
* Network layer over which RTP/etc packet data will be transported.
*/
diff -ur -x.svn mplayer-svn-src/ffmpeg/libavutil/file.c mplayer-svn-src-aros/ffmpeg/libavutil/file.c
--- mplayer-svn-src/ffmpeg/libavutil/file.c 2012-01-26 23:15:59.000000000 +0100
+++ mplayer-svn-src-aros/ffmpeg/libavutil/file.c 2012-04-17 19:39:18.000000000 +0200
@@ -21,6 +21,9 @@
#include <fcntl.h>
#include <sys/stat.h>
#include <unistd.h>
+#ifdef __AROS__
+#define SIZE_MAX INT32_MAX
+#endif
#if HAVE_MMAP
#include <sys/mman.h>
#elif HAVE_MAPVIEWOFFILE
diff -ur -x.svn mplayer-svn-src/fmt-conversion.c mplayer-svn-src-aros/fmt-conversion.c
--- mplayer-svn-src/fmt-conversion.c 2012-04-15 21:43:24.000000000 +0200
+++ mplayer-svn-src-aros/fmt-conversion.c 2012-04-16 22:13:47.000000000 +0200
@@ -65,7 +65,7 @@
{IMGFMT_RGBA, PIX_FMT_RGB0},
{IMGFMT_RGB64LE, PIX_FMT_RGBA64LE},
{IMGFMT_RGB64BE, PIX_FMT_RGBA64BE},
- {IMGFMT_444A, PIX_FMT_YUVA444P},
+// {IMGFMT_444A, PIX_FMT_YUVA444P},
#endif
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51, 20, 1)
{IMGFMT_GBR24P, PIX_FMT_GBRP},
diff -ur -x.svn mplayer-svn-src/gui/morphos/cfg.c mplayer-svn-src-aros/gui/morphos/cfg.c
--- mplayer-svn-src/gui/morphos/cfg.c 2011-09-25 17:53:48.000000000 +0200
+++ mplayer-svn-src-aros/gui/morphos/cfg.c 2012-04-16 21:32:10.000000000 +0200
@@ -168,7 +168,7 @@
return m_config_parse_config_file(gui_conf, filename);
}
-int cfg_read(void)
+void cfg_read(void)
{
char *cfg = get_path("gui.conf");
@@ -179,10 +179,9 @@
if (m_config_parse_config_file(gui_conf, cfg) < 0)
mp_msg(MSGT_GPLAYER, MSGL_FATAL, MSGTR_ConfigFileError);
free(cfg);
- return 0;
}
-int cfg_write(void)
+void cfg_write(void)
{
char *cfg = get_path("gui.conf");
FILE *f;
@@ -207,5 +206,4 @@
fclose(f);
}
free(cfg);
- return 0;
}
diff -ur -x.svn mplayer-svn-src/gui/morphos/classes.h mplayer-svn-src-aros/gui/morphos/classes.h
--- mplayer-svn-src/gui/morphos/classes.h 2010-12-08 22:40:11.000000000 +0100
+++ mplayer-svn-src-aros/gui/morphos/classes.h 2012-04-14 15:49:59.000000000 +0200
@@ -13,6 +13,9 @@
#include <proto/intuition.h>
#include <libraries/gadtools.h>
+#if defined(__AROS__)
+#define MUI_OBSOLETE
+#endif
#include <libraries/mui.h>
#include <proto/muimaster.h>
diff -ur -x.svn mplayer-svn-src/gui/morphos/gui.c mplayer-svn-src-aros/gui/morphos/gui.c
--- mplayer-svn-src/gui/morphos/gui.c 2011-09-26 03:44:12.000000000 +0200
+++ mplayer-svn-src-aros/gui/morphos/gui.c 2012-04-19 20:59:13.000000000 +0200
@@ -34,7 +34,9 @@
extern int fullscreen;
+#if !defined(__AROS__)
struct Library * MUIMasterBase = NULL;
+#endif
guiInterface_t guiInfo;
@@ -49,10 +51,10 @@
CONST TEXT credits[] =
"\033bCredits:\033n\n"
- "\t© by MPlayer Team\n\n"
+ "\t(C) by MPlayer Team\n\n"
"\033bMorphOS Port:\033n\n"
- "\t© 2003-2004 by Nicolas Det\n"
- "\t© 2005-2011 by Fabien Coeurjoly\n\n"
+ "\t(C) 2003-2004 by Nicolas Det\n"
+ "\t(C) 2005-2011 by Fabien Coeurjoly\n\n"
"\033bReferences:\033n\n"
"\thttp://mplayerhq.hu\n"
"\thttp://fabportnawak.free.fr/mplayer/";
@@ -502,12 +504,14 @@
snprintf(iconpath, sizeof(iconpath), "%s.info", _ProgramName);
+#if !defined(__AROS__)
if (!(MUIMasterBase = OpenLibrary((UBYTE *)MUIMASTER_NAME, MUIMASTER_VMIN)))
{
fprintf(stderr, "Failed to open "MUIMASTER_NAME".");
res = 1;
goto quit;
}
+#endif
mygui = malloc(sizeof(*mygui));
@@ -532,7 +536,7 @@
app = NewObject(getmplayerappclass(), NULL,
MUIA_Application_Title , "MPlayer",
MUIA_Application_Version , muiversion,
- MUIA_Application_Copyright , "©2005-2011 Fabien Coeurjoly",
+ MUIA_Application_Copyright , "(C)2005-2011 Fabien Coeurjoly",
MUIA_Application_Author , "Fabien Coeurjoly",
MUIA_Application_Description, APPLICATION_DESCRIPTION,
MUIA_Application_Base , APPLICATION_BASE,
@@ -636,7 +640,11 @@
goto quit;
}
- if(remember_path)
+#if defined(__AROS__)
+ set(GR_URLGroup, MA_URLGroup_Target, GR_MPlayerGroup);
+#endif
+
+ if(remember_path)
MorphOS_RestorePath();
/* Dynamically added aboutbox (falls back to mui_request if not available) */
@@ -870,11 +878,13 @@
classes_cleanup();
+#if !defined(__AROS__)
if (MUIMasterBase)
{
CloseLibrary(MUIMasterBase);
MUIMasterBase = NULL;
}
+#endif
D(kprintf("[GUI] bye bye\n"));
diff -ur -x.svn mplayer-svn-src/gui/morphos/gui.h mplayer-svn-src-aros/gui/morphos/gui.h
--- mplayer-svn-src/gui/morphos/gui.h 2011-09-25 17:45:43.000000000 +0200
+++ mplayer-svn-src-aros/gui/morphos/gui.h 2012-04-17 19:49:31.000000000 +0200
@@ -21,6 +21,28 @@
#define PATTERN_PLAYLIST "#?.(pls|m3u|m3u8)"
#define PATTERN_SUBTITLE "#?.(srt|ssa|ass|sub|txt|vob|utf|utf8|utf-8|smi|rt|aqt|jss|js)"
+#if defined(__AROS__)
+IPTR DoSuperNew(struct IClass *cl, Object *obj, ULONG tag1, ...);
+APTR AllocVecTaskPooled(ULONG byteSize);
+VOID FreeVecTaskPooled(APTR memory);
+#undef NewObject
+#include <proto/intuition.h>
+#define MUIM_Menustrip_Popup (MUIB_MUI|0x00420e76) /* MUI: V20 */
+#define MUIM_Menustrip_ExitChange (MUIB_MUI|0x0042ce4d) /* MUI: V20 */
+#define MUIM_Menustrip_InitChange (MUIB_MUI|0x0042dcd9) /* MUI: V20 */
+#define MUIA_List_DoubleClick (MUIB_MUI|0x00424635) /* MUI: V4 i.g BOOL */
+#define MUIA_List_DragType (MUIB_MUI|0x00425cd3) /* MUI: V11 isg LONG */
+#define MUIA_List_TitleClick (MUIB_MUI|0x00422fd9) /* MUI: V20 ..g LONG */
+#define MUIV_PushMethod_Delay(millis) MIN(0x0ffffff0, (((ULONG)millis) << 8))
+#define NM_WHEEL_UP 0x7a
+#define NM_WHEEL_DOWN 0x7b
+#define MUIV_Frame_Window MUIV_Frame_None
+#define MUIV_Frame_Page MUIV_Frame_None
+#define MCC_TI_TAGBASE ((TAG_USER)|((1307<<16)+0x712))
+#define MCC_TI_ID(x) (MCC_TI_TAGBASE+(x))
+#define MUIA_Textinput_ResetMarkOnCursor MCC_TI_ID(157) /* V29 isg BOOL */
+#endif
+
/* gtk emulation */
#define GTK_MB_FATAL 0x1
#define GTK_MB_ERROR 0x2
@@ -149,7 +171,6 @@
};
/* mplayer vars */
-extern char *skinName;
extern float sub_aspect;
extern play_tree_t* playtree;
extern m_config_t* mconfig;
@@ -259,7 +280,6 @@
void uiState(void);
/* external vars */
-extern char * dvd_device;
extern int fullscreen;
#endif
diff -ur -x.svn mplayer-svn-src/gui/morphos/include/macros/vapor.h mplayer-svn-src-aros/gui/morphos/include/macros/vapor.h
--- mplayer-svn-src/gui/morphos/include/macros/vapor.h 2010-12-08 22:58:19.000000000 +0100
+++ mplayer-svn-src-aros/gui/morphos/include/macros/vapor.h 2012-04-14 16:01:06.000000000 +0200
@@ -34,6 +34,10 @@
* Use DISPATCHERREF to give the dispatcher to the MUI_CreateCustomClass() call, eg:
* mcc = MUI_CreateCustomClass(NULL, MUIC_Area, NULL, sizeof(struct Data), DISPATCHERREF);
*/
+#ifdef __AROS__
+#define DISPATCHERREF dispatch
+#define DISPATCHERREF2(name) name##_dispatch
+#else
#ifdef __MORPHOS__
#define DISPATCHERREF &GATE_dispatch
#define DISPATCHERREF2(name) &GATE_##name##_dispatch
@@ -41,11 +45,16 @@
#define DISPATCHERREF dispatch
#define DISPATCHERREF2(name) name##_dispatch
#endif /* !__MORPHOS__ */
+#endif
/*
* Use BEGINMTABLE to start the description of a dispatcher (BEGINMTABLE2 if you need a name)
*/
#ifdef __GNUC__
+#ifdef __AROS__
+#define BEGINMTABLE BOOPSI_DISPATCHER(IPTR, dispatch, cl, obj, msg){switch(msg->MethodID){
+#define BEGINMTABLE2(name) BOOPSI_DISPATCHER(IPTR, name##_dispatch, cl, obj, msg){switch(msg->MethodID){
+#else
#ifdef __MORPHOS__
#define BEGINMTABLE static ULONG dispatch(void); \
static struct EmulLibEntry GATE_dispatch = \
@@ -79,6 +88,7 @@
#define BEGINMTABLE static ULONG dispatch( __reg(a0, struct IClass *cl), __reg(a2, Object *obj), __reg(a1, Msg msg)){switch(msg->MethodID){
#define BEGINMTABLE2(name) static ULONG name##_Dispatcher( __reg(a0, struct IClass *cl), __reg(a2, Object *obj), __reg(a1, Msg msg)){switch(msg->MethodID){
#endif /* !__MORPHOS__ */
+#endif
#else
#define BEGINMTABLE static ULONG __asm __saveds dispatch( register __a0 struct IClass *cl, register __a2 Object *obj, register __a1 Msg msg ){switch(msg->MethodID){
#define BEGINMTABLE2(name) static ULONG __asm __saveds name##_Dispatcher(register __a0 struct IClass *cl, register __a2 Object *obj, register __a1 Msg msg){switch(msg->MethodID){
@@ -103,7 +113,11 @@
/*
* Use ENDMTABLE to end the description of a dispatcher
*/
+#ifndef __AROS__
#define ENDMTABLE }return(DOSUPER);}
+#else
+#define ENDMTABLE }return(DOSUPER);}BOOPSI_DISPATCHER_END
+#endif
/* Methods */
@@ -267,6 +281,14 @@
/* Hooks */
+#ifdef __AROS__
+
+#define MUI_HOOK(n, y, z) \
+ static LONG n##_func(struct Hook * n, y, z); \
+ static struct Hook n##_hook = {{0, 0}, (IPTR (*)())n##_func, NULL, NULL}; \
+ static LONG n##_func(struct Hook * n, y, z)
+
+#else
#ifdef __MORPHOS__
#define __callback
@@ -284,8 +306,8 @@
struct EmulLibEntry n = { \
TRAP_LIB, 0, (void (*)(void))n##_GATE }; \
static LONG n##_GATE(void) { \
- return (n##_GATE2((struct Hook *)REG_A0, (void *)REG_A2, (void *)REG_A1)); } \
- static struct Hook n##_hook = { { 0, 0}, (ULONG (*)(void))&n, (ULONG (*)(void))&n##_GATE2 , NULL }; \
+ return (n##_GATE2((struct Hook *)REG_A0, (void *)REG_A2, (void *)REG_A1)); } \
+ static struct Hook n##_hook = { { 0, 0}, (ULONG (*)(void))&n, (ULONG (*)(void))&n##_GATE2 , NULL }; \
static LONG n##_GATE2(struct Hook *h, y, z)
#else
#define DEFHOOK(n) static struct Hook n##_hook={0,0,(HOOKFUNC)n##_func}
@@ -297,6 +319,7 @@
#define __callback __asm __saveds
#endif /* !_MORPHOS__ */
+#endif /* !__AROS__ */
#define _reg(x) register __##x
diff -ur -x.svn mplayer-svn-src/gui/morphos/interface.c mplayer-svn-src-aros/gui/morphos/interface.c
--- mplayer-svn-src/gui/morphos/interface.c 2011-09-27 03:52:50.000000000 +0200
+++ mplayer-svn-src-aros/gui/morphos/interface.c 2012-04-21 14:19:57.000000000 +0200
@@ -60,13 +60,14 @@
#include "stream/stream_dvdnav.h"
#endif
#include "libass/ass.h"
+#include "osdep/timer.h"
#include "morphos_stuff.h"
#include "gui/interface.h"
#include "gui.h"
#include "thread.h"
-#define D(x) x;
+#define D(x) ;
extern void dvd_read_name(char *name, char *serial, const char *device);
@@ -418,7 +419,7 @@
mp_input_queue_cmd(mp_input_parse_cmd(command));
break;
}
- case evSetDVDChapter:
+ case ivSetDVDChapter:
{
char command[64];
snprintf(command, sizeof(command), "seek_chapter %d 1", iparam);
@@ -426,7 +427,7 @@
mp_input_queue_cmd(mp_input_parse_cmd(command));
break;
}
- case evSetDVDTitle:
+ case ivSetDVDTitle:
{
guiInfo.Track = iparam;
goto playdvd;
@@ -462,7 +463,7 @@
gui(GUI_PREPARE, 0);
mygui->playlist->clear_playlist(mygui->playlist);
- mygui->playlist->add_track(mygui->playlist, filename, NULL, dvdname, 0, gui_use_dvdnav ? STREAMTYPE_DVDNAV: STREAMTYPE_DVD);
+ mygui->playlist->add_track(mygui->playlist, gui_use_dvdnav ? "dvdnav://" : "dvd://", NULL, dvdname, 0, gui_use_dvdnav ? STREAMTYPE_DVDNAV: STREAMTYPE_DVD);
// Rebuild playlist
update_playlistwindow(TRUE);
@@ -625,7 +626,7 @@
case STREAMTYPE_DVDNAV:
if(guiInfo.Chapter == guiInfo.Chapters)
return;
- mygui->playercontrol(evSetDVDChapter, (guiInfo.Chapter - 1) + 1);
+ mygui->playercontrol(ivSetDVDChapter, (guiInfo.Chapter - 1) + 1);
break;
#endif
@@ -660,7 +661,7 @@
case STREAMTYPE_DVDNAV:
if(guiInfo.Chapter == 1)
return;
- mygui->playercontrol(evSetDVDChapter, (guiInfo.Chapter - 1) -1);
+ mygui->playercontrol(ivSetDVDChapter, (guiInfo.Chapter - 1) -1);
break;
#endif
@@ -802,6 +803,7 @@
int stream_interrupt_cb(int timeout)
{
+ usec_sleep(timeout * 1000);
return mygui->running == FALSE;
}
@@ -863,9 +865,13 @@
/* always add screenshot filter */
m_config_set_option(mconfig, "vf-add", "screenshot");
+#if !defined(__AROS__)
if (NewGetTaskAttrs(NULL, &msg, sizeof(struct startupmsg *),
TASKINFOTYPE_STARTUPMSG,
TAG_DONE) && msg)
+#else
+ msg = ((struct Process *)FindTask(NULL))->pr_Task.tc_UserData;
+#endif
{
mygui = NULL;
gui_initialized = FALSE;
@@ -878,6 +884,9 @@
gui_failed = rc;
+#if defined(__AROS__)
+ ReplyMsg((struct Message *)msg);
+#endif
return 0;
}
@@ -1040,6 +1049,7 @@
break;
}
+#if 0 /* Merge of 34866, partially moved to GUI_PREPARE */
case GUI_SET_FILE:
{
D(kprintf("GUI_SET_FILE\n"));
@@ -1082,6 +1092,7 @@
break;
}
+#endif
case GUI_HANDLE_EVENTS:
{
//D(kprintf("GUI_HANDLE_EVENTS\n"));
@@ -1164,7 +1175,24 @@
case GUI_PREPARE:
{
D(kprintf("GUI_PREPARE %d\n", guiInfo.StreamType));
- //gui(GUI_SET_FILE, 0);
+ if (guiInfo.NewPlay == GUI_FILE_NEW)
+ {
+ dvd_title = 0;
+ //audio_id = -1;
+ if(audio_id != -2) audio_id = -1; // Fixes -nosound
+ video_id = -1;
+ dvdsub_id = -1;
+ vobsub_id = -1;
+
+ stream_cache_size = -1;
+ autosync = 0;
+ force_fps = 0;
+
+ free(mygui->icy_info);
+ mygui->icy_info = NULL;
+ }
+
+ guiInfo.sh_video = NULL; // NEW
switch(guiInfo.StreamType)
{
@@ -1207,6 +1235,10 @@
}
#endif
}
+
+ if(!mygui->playlist->tracks) return 0;
+ guiSetFilename(guiInfo.Filename, mygui->playlist->tracks[mygui->playlist->current]->filename);
+
if(guiInfo.Filename)
filename = guiInfo.Filename;
else if(filename && guiInfo.Filename)
@@ -1226,6 +1258,7 @@
ass_top_margin = gtkASS.top_margin;
ass_bottom_margin = gtkASS.bottom_margin;
#endif
+ break;
}
case GUI_SET_STREAM:
@@ -1389,7 +1422,7 @@
guiInfo.VideoWidth = guiInfo.sh_video->disp_w;
guiInfo.VideoHeight = guiInfo.sh_video->disp_h;
- D(kprintf("Codec %s, FPS %f, Width %d, Height %d\n", codecname, guiInfo.FPS, guiInfo.VideoWidth, guiInfo.VideoHeight));
+ D(kprintf("Codec %s, FPS %d, Width %d, Height %d\n", codecname, (int)guiInfo.FPS, guiInfo.VideoWidth, guiInfo.VideoHeight));
sub_aspect = (float)guiInfo.VideoWidth / guiInfo.VideoHeight;
@@ -1517,12 +1550,14 @@
}
else
{
+#if !defined(__AROS__) /* AROS: Don't put MPlayer window on screen which has video */
mygui->gui_ready = FALSE;
DoMethod(app, MUIM_Application_PushMethod, mygui->maingroup, 2, MM_MPlayerGroup_SetWindow, (APTR) data);
while(mygui->running && !mygui->gui_ready) // wait until SetWindow is finished or gui is quitting
{
Delay(1);
}
+#endif
}
break;
}
diff -ur -x.svn mplayer-svn-src/gui/morphos/mplayergroupclass.c mplayer-svn-src-aros/gui/morphos/mplayergroupclass.c
--- mplayer-svn-src/gui/morphos/mplayergroupclass.c 2011-09-27 01:18:41.000000000 +0200
+++ mplayer-svn-src-aros/gui/morphos/mplayergroupclass.c 2012-04-19 21:02:22.000000000 +0200
@@ -30,6 +30,7 @@
#endif
#include "sub/sub.h"
#include "sub/subreader.h"
+#include "sub/vobsub.h"
#include "gui/interface.h"
#include "gui.h"
@@ -49,11 +50,20 @@
static ULONG innerleft, innerright, innertop, innerbottom;
+#if !defined(__AROS__)
/* Handle appwindow messages */
static LONG AppMsgFunc(void)
{
struct AppMessage **x = (struct AppMessage **) REG_A1;
// APTR obj = (APTR) REG_A2;
+#else
+AROS_UFH3(static LONG, AppMsgFunc,
+ AROS_UFPA(struct Hook * , hook , A0),
+ AROS_UFPA(APTR , obj , A2),
+ AROS_UFPA(struct AppMessage ** , x , A1))
+{
+ AROS_USERFUNC_INIT
+#endif
struct WBArg *ap;
struct AppMessage *amsg = *x;
int i;
@@ -110,10 +120,16 @@
DoMethod(mygui->playlistgroup, MM_PlaylistGroup_Refresh, TRUE);
return(0);
+#if !defined(__AROS__)
}
static struct EmulLibEntry AppMsgHookGate = { TRAP_LIB, 0, (void (*)(void))AppMsgFunc };
static struct Hook AppMsgHook = { {0, 0}, (HOOKFUNC)&AppMsgHookGate, NULL, NULL };
+#else
+ AROS_USERFUNC_EXIT
+}
+static struct Hook AppMsgHook = { {0, 0}, (HOOKFUNC)&AppMsgFunc, NULL, NULL };
+#endif
/******************************************************************
* mplayergroupclass
@@ -1051,6 +1067,8 @@
}
extern int sub_source(MPContext * mpctx);
+extern int dvd_lang_from_sid(stream_t *stream, int id);
+extern int mp_dvdnav_lang_from_sid(stream_t *stream, int sid);
static char * GetSubtitleLabel(int pos, char * buffer, int size)
{
@@ -1069,9 +1087,13 @@
}
else if(vo_spudec && guiInfo.mpcontext->stream->type == STREAMTYPE_DVDNAV && pos >= 0)
{
- unsigned char lang[3];
- if (mp_dvdnav_lang_from_sid(guiInfo.mpcontext->stream, pos, lang))
+ int code;
+ if ((code = mp_dvdnav_lang_from_sid(guiInfo.mpcontext->stream, pos)))
{
+ char lang[3];
+ lang[0] = code >> 8;
+ lang[1] = code;
+ lang[2] = 0;
snprintf(buffer, size, "(%d) %s", pos, lang);
}
else
@@ -2237,7 +2259,7 @@
if(entry)
{
set(data->ST_Chapters, MUIA_Text_Contents, entry->label);
- mygui->playercontrol(evSetDVDChapter, getv(data->LI_Chapters, MUIA_List_Active));
+ mygui->playercontrol(ivSetDVDChapter, getv(data->LI_Chapters, MUIA_List_Active));
}
}
break;
@@ -2322,7 +2344,7 @@
if(entry)
{
set(data->ST_Titles, MUIA_Text_Contents, entry->label);;
- mygui->playercontrol(evSetDVDTitle, getv(data->LI_Titles, MUIA_List_Active) + 1);
+ mygui->playercontrol(ivSetDVDTitle, getv(data->LI_Titles, MUIA_List_Active) + 1);
}
}
diff -ur -x.svn mplayer-svn-src/gui/morphos/mui.h mplayer-svn-src-aros/gui/morphos/mui.h
--- mplayer-svn-src/gui/morphos/mui.h 2010-11-28 18:38:22.000000000 +0100
+++ mplayer-svn-src-aros/gui/morphos/mui.h 2012-04-14 15:21:23.000000000 +0200
@@ -4,7 +4,9 @@
ULONG mui_getv(APTR o, ULONG a);
#define getv(_o,_a) mui_getv(_o,_a)
+#ifndef nnset
#define nnset(obj,attr,value) SetAttrs(obj,MUIA_NoNotify,TRUE,attr,value,TAG_DONE)
+#endif
#define _between(_a,_x,_b) ((_x)>=(_a) && (_x)<=(_b))
#define _isinobject(_o,_x,_y) (_between(_left(_o),(_x),_right(_o)) && _between(_top(_o),(_y),_bottom(_o)))
diff -ur -x.svn mplayer-svn-src/gui/morphos/playlist.c mplayer-svn-src-aros/gui/morphos/playlist.c
--- mplayer-svn-src/gui/morphos/playlist.c 2011-09-25 06:09:35.000000000 +0200
+++ mplayer-svn-src-aros/gui/morphos/playlist.c 2012-04-21 11:56:05.000000000 +0200
@@ -36,6 +36,7 @@
#include "mp_msg.h"
#include "playlist.h"
#include "morphos_stuff.h"
+#include <clib/debug_protos.h>
/* TODO: implement sort_playlist */
@@ -60,7 +61,12 @@
if(stat(filename, &st) != -1)
{
+#if !defined(__AROS__)
if(S_ISDIR(st.st_mode))
+#else
+ if((S_ISDIR(st.st_mode)) && (strcmp(entry->d_name, ".") != 0)
+ && (strcmp(entry->d_name, "..") != 0))
+#endif
{
if(recursive)
{
diff -ur -x.svn mplayer-svn-src/gui/morphos/playlistgroupclass.c mplayer-svn-src-aros/gui/morphos/playlistgroupclass.c
--- mplayer-svn-src/gui/morphos/playlistgroupclass.c 2011-09-25 06:12:10.000000000 +0200
+++ mplayer-svn-src-aros/gui/morphos/playlistgroupclass.c 2012-04-19 21:02:34.000000000 +0200
@@ -8,10 +8,19 @@
#include "gui/interface.h"
#include "gui.h"