From 96c6579a11bdf61b35518e5ab29917437e706c18 Mon Sep 17 00:00:00 2001 From: miqlas <5569059+extrowerk@users.noreply.github.com> Date: Thu, 25 Apr 2019 17:44:35 +0200 Subject: [PATCH] MPlayer: bump to release (#3781) --- .../mplayer/additional-files/mplayer.rdef.in | 2 +- ...0_20180904.recipe => mplayer-1.4.0.recipe} | 14 +- ...04.patchset => mplayer_x86-1.4.0.patchset} | 546 +++++++++--------- 3 files changed, 276 insertions(+), 286 deletions(-) rename media-video/mplayer/{mplayer-1.4.0_20180904.recipe => mplayer-1.4.0.recipe} (94%) rename media-video/mplayer/patches/{mplayer_x86-1.4.0_20180904.patchset => mplayer_x86-1.4.0.patchset} (80%) diff --git a/media-video/mplayer/additional-files/mplayer.rdef.in b/media-video/mplayer/additional-files/mplayer.rdef.in index 82b9a7792..94a7904fa 100644 --- a/media-video/mplayer/additional-files/mplayer.rdef.in +++ b/media-video/mplayer/additional-files/mplayer.rdef.in @@ -1,5 +1,5 @@ -resource app_flags B_ARGV_ONLY; +resource app_flags B_MULTIPLE_LAUNCH | B_ARGV_ONLY; resource app_version { major = @MAJOR@, diff --git a/media-video/mplayer/mplayer-1.4.0_20180904.recipe b/media-video/mplayer/mplayer-1.4.0.recipe similarity index 94% rename from media-video/mplayer/mplayer-1.4.0_20180904.recipe rename to media-video/mplayer/mplayer-1.4.0.recipe index e9a3269ce..b74ea2e73 100644 --- a/media-video/mplayer/mplayer-1.4.0_20180904.recipe +++ b/media-video/mplayer/mplayer-1.4.0.recipe @@ -20,14 +20,12 @@ fonts are supported along with 12 subtitle formats (MicroDVD, SubRip, OGM, \ SubViewer, Sami, VPlayer, RT, SSA, AQTitle, JACOsub, PJS and our own: MPsub). \ DVD subtitles (SPU streams, VOBsub and Closed Captions) are supported as well." HOMEPAGE="http://www.mplayerhq.hu/" -COPYRIGHT="2001-2016 The MPlayer Team" +COPYRIGHT="2001-2019 The MPlayer Team" LICENSE="GNU LGPL v2.1" REVISION="1" -srcGitRev="c4eb74cb8d8d7b8ccd9936cb18742d086492fb9f" -SOURCE_URI="https://github.com/extrowerk/mplayer/archive/$srcGitRev.zip" -CHECKSUM_SHA256="ae9508e6504da751b3dc91b85aae141d6164c1da65fc270b666c0509518e45ee" -SOURCE_DIR="mplayer-$srcGitRev" -SOURCE_FILENAME="mplayer-$srcGitRev.zip" +SOURCE_URI="http://www.mplayerhq.hu/MPlayer/releases/MPlayer-1.4.tar.xz" +CHECKSUM_SHA256="82596ed558478d28248c7bc3828eb09e6948c099bbd76bb7ee745a0e3275b548" +SOURCE_DIR="MPlayer-1.4" PATCHES="mplayer_x86-$portVersion.patchset" ADDITIONAL_FILES="mplayer.rdef.in" @@ -56,7 +54,7 @@ REQUIRES=" lib:liba52$secondaryArchSuffix lib:libbz2$secondaryArchSuffix lib:libcaca$secondaryArchSuffix -# lib:libcdio$secondaryArchSuffix + lib:libcdio$secondaryArchSuffix lib:libdca$secondaryArchSuffix lib:libdv$secondaryArchSuffix lib:libdvdcss$secondaryArchSuffix @@ -113,7 +111,7 @@ BUILD_REQUIRES=" devel:libbz2$secondaryArchSuffix devel:libcaca$secondaryArchSuffix devel:libcddb$secondaryArchSuffix -# devel:libcdio$secondaryArchSuffix + devel:libcdio$secondaryArchSuffix devel:libdca$secondaryArchSuffix devel:libdv$secondaryArchSuffix devel:libdvdcss$secondaryArchSuffix diff --git a/media-video/mplayer/patches/mplayer_x86-1.4.0_20180904.patchset b/media-video/mplayer/patches/mplayer_x86-1.4.0.patchset similarity index 80% rename from media-video/mplayer/patches/mplayer_x86-1.4.0_20180904.patchset rename to media-video/mplayer/patches/mplayer_x86-1.4.0.patchset index 21c6cdd0f..ac6852cbb 100644 --- a/media-video/mplayer/patches/mplayer_x86-1.4.0_20180904.patchset +++ b/media-video/mplayer/patches/mplayer_x86-1.4.0.patchset @@ -1,22 +1,23 @@ -From 683eb6964591da827fe9f7c7827507d999a12696 Mon Sep 17 00:00:00 2001 +From fa11c15302e76a470d9ae76c6983e74cceafb61f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= -Date: Mon, 26 Dec 2016 17:18:13 +0100 -Subject: [PATCH] Haiku supporting code from Sergei Reznikov +Date: Mon, 22 Apr 2019 11:38:50 +0200 +Subject: [PATCH] Haiku --- Makefile | 3 + - configure | 42 ++++++- - libao2/ao_haiku.cpp | 195 +++++++++++++++++++++++++++++++ - libao2/audio_out.c | 7 ++ - libvo/haiku_common.cpp | 304 +++++++++++++++++++++++++++++++++++++++++++++++++ - libvo/haiku_common.h | 69 +++++++++++ - libvo/haiku_view.cpp | 171 ++++++++++++++++++++++++++++ - libvo/haiku_view.h | 36 ++++++ - libvo/haiku_window.cpp | 125 ++++++++++++++++++++ + configure | 42 +++++- + libao2/ao_haiku.cpp | 195 ++++++++++++++++++++++++++ + libao2/audio_out.c | 7 + + libvo/haiku_common.cpp | 304 +++++++++++++++++++++++++++++++++++++++++ + libvo/haiku_common.h | 69 ++++++++++ + libvo/haiku_view.cpp | 171 +++++++++++++++++++++++ + libvo/haiku_view.h | 36 +++++ + libvo/haiku_window.cpp | 125 +++++++++++++++++ libvo/haiku_window.h | 31 +++++ libvo/video_out.c | 4 + - libvo/vo_haiku.cpp | 201 ++++++++++++++++++++++++++++++++ - 12 files changed, 1185 insertions(+), 3 deletions(-) + libvo/vo_haiku.cpp | 201 +++++++++++++++++++++++++++ + path.c | 18 +++ + 13 files changed, 1203 insertions(+), 3 deletions(-) create mode 100644 libao2/ao_haiku.cpp create mode 100644 libvo/haiku_common.cpp create mode 100644 libvo/haiku_common.h @@ -27,7 +28,7 @@ Subject: [PATCH] Haiku supporting code from Sergei Reznikov create mode 100644 libvo/vo_haiku.cpp diff --git a/Makefile b/Makefile -index f59f635..3d422c3 100644 +index efa871d..aec5a2f 100644 --- a/Makefile +++ b/Makefile @@ -544,6 +544,9 @@ SRCS_MPLAYER-$(S3FB) += libvo/vo_s3fb.c @@ -41,7 +42,7 @@ index f59f635..3d422c3 100644 SRCS_MPLAYER-$(SNDIO) += libao2/ao_sndio.c SRCS_MPLAYER-$(SUNAUDIO) += libao2/ao_sun.c diff --git a/configure b/configure -index d18543d..02f2004 100755 +index d1aa8cd..52aa9b5 100755 --- a/configure +++ b/configure @@ -228,6 +228,7 @@ qnx() { issystem "QNX"; } @@ -49,7 +50,7 @@ index d18543d..02f2004 100755 wine() { issystem "Wine"; } win32() { cygwin || mingw32 || wine; } +haiku() { issystem "Haiku"; } - + # arch test boolean functions # x86/x86pc is used by QNX @@ -469,6 +470,7 @@ Video output: @@ -60,7 +61,7 @@ index d18543d..02f2004 100755 --enable-kva enable KVA video output [autodetect] --enable-aa enable AAlib video output [autodetect] --enable-caca enable CACA video output [autodetect] -@@ -678,6 +680,7 @@ _xvmc=no #auto when complete +@@ -682,6 +684,7 @@ _xvmc=no #auto when complete _vda=auto _vdpau=auto _sdl=auto @@ -68,7 +69,7 @@ index d18543d..02f2004 100755 _kva=auto _direct3d=auto _directx=auto -@@ -1028,6 +1031,8 @@ for ac_option do +@@ -1033,6 +1036,8 @@ for ac_option do --disable-vdpau) _vdpau=no ;; --enable-sdl) _sdl=yes ;; --disable-sdl) _sdl=no ;; @@ -77,7 +78,7 @@ index d18543d..02f2004 100755 --enable-kva) _kva=yes ;; --disable-kva) _kva=no ;; --enable-direct3d) _direct3d=yes ;; -@@ -1640,7 +1645,7 @@ else +@@ -1676,7 +1681,7 @@ else cc_name=$cc_name_tmp echocheck "$_cc version" cc_vendor=gnu @@ -86,7 +87,7 @@ index d18543d..02f2004 100755 case $cc_version in 2.96*) cc_fail=yes -@@ -1710,7 +1715,7 @@ if test -z "$_target" ; then +@@ -1746,7 +1751,7 @@ if test -z "$_target" ; then # host's CPU/instruction set set_host_arch() { case "$1" in @@ -95,7 +96,7 @@ index d18543d..02f2004 100755 ia64) host_arch=ia64 ;; macppc|ppc*|Power*) host_arch=ppc ;; alpha) host_arch=alpha ;; -@@ -1749,6 +1754,7 @@ else # if test -z "$_target" +@@ -1785,6 +1790,7 @@ else # if test -z "$_target" amigaos) system_name=AmigaOS ;; mingw32*) system_name=MINGW32 ;; wine) system_name=Wine ;; @@ -103,10 +104,10 @@ index d18543d..02f2004 100755 esac done # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed -@@ -1825,6 +1831,11 @@ if wine ; then +@@ -1863,6 +1869,11 @@ if wine ; then extra_cflags="-fno-pic -UWIN32 -U_WIN32 -U__WIN32 -U__WIN32__ -DWINE_NOWINSOCK $extra_cflags" fi - + +if haiku ; then + extra_ldflags="$extra_ldflags -lbe -lmedia -lsupc++" + extra_cflags="-fno-pic $extra_cflags" @@ -115,10 +116,10 @@ index d18543d..02f2004 100755 if darwin && test "$cc_vendor" != "clang" ; then extra_cflags="-falign-loops=16 -shared-libgcc $extra_cflags" fi -@@ -5766,6 +5777,29 @@ fi +@@ -5894,6 +5905,29 @@ fi echores "$_v4l2" - - + + +echocheck "Haiku" +if test "$_haiku" = auto || test "$_haiku" = yes ; then + cat > $TMPC << EOF @@ -142,10 +143,10 @@ index d18543d..02f2004 100755 +fi +echores "$_haiku" + - + ######### # AUDIO # -@@ -8005,7 +8039,7 @@ fi +@@ -8059,7 +8093,7 @@ fi # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly) ld_dl_dynamic='' freebsd || netbsd || openbsd || dragonfly || bsdos && ld_dl_dynamic='-rdynamic' @@ -153,8 +154,8 @@ index d18543d..02f2004 100755 +if test "$_real" = yes || test "$_xanim" = yes && ! win32 && ! qnx && ! darwin && ! os2 && ! sunos && ! haiku; then ld_dl_dynamic='-rdynamic' fi - -@@ -8498,6 +8532,7 @@ RADIO_CAPTURE=$_radio_capture + +@@ -8552,6 +8586,7 @@ RADIO_CAPTURE=$_radio_capture REAL_CODECS = $_real S3FB = $_s3fb SDL = $_sdl @@ -162,7 +163,7 @@ index d18543d..02f2004 100755 SDL_IMAGE = $sdl_image SPEEX = $_speex STREAM_CACHE = $_stream_cache -@@ -9080,6 +9115,7 @@ $def_quartz +@@ -9153,6 +9188,7 @@ $def_quartz $def_s3fb $def_sdl $def_sdl_sdl_h @@ -172,7 +173,7 @@ index d18543d..02f2004 100755 $def_tdfxvid diff --git a/libao2/ao_haiku.cpp b/libao2/ao_haiku.cpp new file mode 100644 -index 0000000..e201f17 +index 0000000..e50f1dc --- /dev/null +++ b/libao2/ao_haiku.cpp @@ -0,0 +1,195 @@ @@ -216,7 +217,7 @@ index 0000000..e201f17 + &info, + control, + init, -+ uninit, ++ uninit, + reset, + get_space, + play, @@ -239,17 +240,17 @@ index 0000000..e201f17 +static BSoundPlayer *player = NULL; + +static int write_buffer(unsigned char* data,int len){ -+ int free = av_fifo_space(buffer); -+ if (len > free) len = free; -+ return av_fifo_generic_write(buffer, data, len, NULL); ++ int free = av_fifo_space(buffer); ++ if (len > free) len = free; ++ return av_fifo_generic_write(buffer, data, len, NULL); +} + + +static int read_buffer(unsigned char* data,int len){ -+ int buffered = av_fifo_size(buffer); -+ if (len > buffered) len = buffered; -+ av_fifo_generic_read(buffer, data, len, NULL); -+ return len; ++ int buffered = av_fifo_size(buffer); ++ if (len > buffered) len = buffered; ++ av_fifo_generic_read(buffer, data, len, NULL); ++ return len; +} + +//BSoundPlayer proc func @@ -272,7 +273,7 @@ index 0000000..e201f17 + ao_data.samplerate = rate; + ao_data.buffersize = CHUNK_SIZE; + ao_data.outburst = CHUNK_SIZE; -+ ao_data.format = format; ++ ao_data.format = format; + + media_raw_audio_format hspec = { + rate, @@ -283,48 +284,48 @@ index 0000000..e201f17 + }; + + switch(format) { -+ case AF_FORMAT_U8: ++ case AF_FORMAT_U8: + hspec.format = media_raw_audio_format::B_AUDIO_UCHAR; + break; -+ case AF_FORMAT_S8: ++ case AF_FORMAT_S8: + hspec.format = media_raw_audio_format::B_AUDIO_CHAR;; + break; -+ case AF_FORMAT_S16_LE: ++ case AF_FORMAT_S16_LE: + hspec.format = media_raw_audio_format::B_AUDIO_SHORT; -+ hspec.byte_order = B_MEDIA_LITTLE_ENDIAN; ++ hspec.byte_order = B_MEDIA_LITTLE_ENDIAN; + break; -+ case AF_FORMAT_S16_BE: ++ case AF_FORMAT_S16_BE: + hspec.format = media_raw_audio_format::B_AUDIO_SHORT; + hspec.byte_order = B_MEDIA_BIG_ENDIAN; + break; -+ case AF_FORMAT_FLOAT_LE: ++ case AF_FORMAT_FLOAT_LE: + hspec.format = media_raw_audio_format::B_AUDIO_FLOAT; -+ hspec.byte_order = B_MEDIA_LITTLE_ENDIAN; ++ hspec.byte_order = B_MEDIA_LITTLE_ENDIAN; + break; -+ case AF_FORMAT_FLOAT_BE: ++ case AF_FORMAT_FLOAT_BE: + hspec.format = media_raw_audio_format::B_AUDIO_FLOAT; -+ hspec.byte_order = B_MEDIA_BIG_ENDIAN; ++ hspec.byte_order = B_MEDIA_BIG_ENDIAN; + break; -+ default: -+ hspec.format = media_raw_audio_format::B_AUDIO_SHORT; -+ hspec.byte_order = B_MEDIA_LITTLE_ENDIAN; -+ ao_data.format = AF_FORMAT_S16_LE; ++ default: ++ hspec.format = media_raw_audio_format::B_AUDIO_SHORT; ++ hspec.byte_order = B_MEDIA_LITTLE_ENDIAN; ++ ao_data.format = AF_FORMAT_S16_LE; + break; + } -+ ++ + hspec.buffer_size = CHUNK_SIZE / (af_fmt2bits(ao_data.format) / 8); + ao_data.bps = channels * rate * (af_fmt2bits(ao_data.format) / 8); -+ ++ + player = new BSoundPlayer(&hspec, "MPlayer", proc); -+ ++ + if(player->InitCheck() != B_OK) { -+ delete player; ++ delete player; + player = NULL; + return 0; + } -+ ++ + player->Start(); -+ player->SetHasData(true); ++ player->SetHasData(true); + + return 1; +} @@ -333,8 +334,8 @@ index 0000000..e201f17 +static void uninit(int immed){ + + if (!immed) -+ usec_sleep(get_delay() * 1000 * 1000); -+ ++ usec_sleep(get_delay() * 1000 * 1000); ++ + player->SetHasData(false); + delete player; + @@ -354,11 +355,11 @@ index 0000000..e201f17 +static void audio_resume(void) +{ + player->Start(); -+ player->SetHasData(true); ++ player->SetHasData(true); +} + +static int get_space(void){ -+ return av_fifo_space(buffer); ++ return av_fifo_space(buffer); +} + +static int play(void* data,int len,int flags){ @@ -368,8 +369,8 @@ index 0000000..e201f17 +} + +static float get_delay(void){ -+ int buffered = av_fifo_size(buffer); // could be less -+ return (float)(buffered + ao_data.buffersize)/(float)ao_data.bps; ++ int buffered = av_fifo_size(buffer); // could be less ++ return (float)(buffered + ao_data.buffersize)/(float)ao_data.bps; +} diff --git a/libao2/audio_out.c b/libao2/audio_out.c index 197a63b..7f7baff 100644 @@ -426,29 +427,29 @@ index 0000000..1ea5f96 +} + + -+FBView::FBView(BRect rect) : ++FBView::FBView(BRect rect) : + BView(rect, "FBView", B_FOLLOW_ALL, B_WILL_DRAW) +{ + FBView(rect, rect.IntegerWidth(), rect.IntegerHeight()); +} + -+FBView::FBView(BRect rect, int width, int height) : ++FBView::FBView(BRect rect, int width, int height) : + BView(rect, "FBView", B_FOLLOW_ALL, B_WILL_DRAW) +{ + renderRect = Bounds(); -+ ++ + buffer_width = width; + buffer_height = height; -+ -+ BRect fbRect = BRect(0,0,buffer_width-1,buffer_height-1); ++ ++ BRect fbRect = BRect(0,0,buffer_width-1,buffer_height-1); + bufferView = new BView(fbRect, "bufferView", B_FOLLOW_ALL_SIDES, 0); + bufferBitmap = new BBitmap(fbRect, B_RGB32, true); -+ bufferBitmap->AddChild(bufferView); ++ bufferBitmap->AddChild(bufferView); +} + +FBView::~FBView() +{ -+ ++ +} + +void @@ -456,22 +457,22 @@ index 0000000..1ea5f96 +{ + uint32 buttons = Window()->CurrentMessage()->FindInt32("buttons"); + int32 clicks = Window()->CurrentMessage()->FindInt32("clicks"); -+ ++ + if( buttons & B_PRIMARY_MOUSE_BUTTON ) { + if(clicks==1) + mplayer_put_key(MOUSE_BTN0); + else { + vo_fs = !vo_fs; -+ ((MWindow*)Window())->SetFullscreen(vo_fs); ++ ((MWindow*)Window())->SetFullscreen(vo_fs); + mplayer_put_key(MOUSE_BTN0); -+ } ++ } + } + if( buttons & B_SECONDARY_MOUSE_BUTTON ) { + mplayer_put_key(clicks==1?MOUSE_BTN2:MOUSE_BTN2_DBL); + } + if( buttons & B_TERTIARY_MOUSE_BUTTON ) { + mplayer_put_key(clicks==1?MOUSE_BTN1:MOUSE_BTN1_DBL); -+ } ++ } +} + +void @@ -481,24 +482,24 @@ index 0000000..1ea5f96 + if (msg->FindFloat("be:wheel_delta_y", &dy) == B_OK) { + if(dy<0) + mplayer_put_key(MOUSE_BTN3); -+ else -+ mplayer_put_key(MOUSE_BTN4); ++ else ++ mplayer_put_key(MOUSE_BTN4); + } +} + -+void ++void +FBView::MouseMoved(BPoint point, uint32 transit,const BMessage *message) +{ + switch(transit) -+ { -+ case B_INSIDE_VIEW: -+ case B_ENTERED_VIEW: -+ { -+ BPoint p = point; ++ { ++ case B_INSIDE_VIEW: ++ case B_ENTERED_VIEW: ++ { ++ BPoint p = point; + vo_mouse_movement(p.x, p.y); -+ break; -+ } -+ } ++ break; ++ } ++ } +} + +void @@ -514,13 +515,13 @@ index 0000000..1ea5f96 + } +} + -+void ++void +FBView::Draw(BRect rect) +{ + Paint(); +} + -+void ++void +FBView::SetRenderRect(BRect rect) +{ + renderRect = rect; @@ -529,12 +530,12 @@ index 0000000..1ea5f96 + Paint(); +} + -+void ++void +FBView::Paint() +{ -+ if(LockLooper()) { -+ bufferView->LockLooper(); -+ SetDrawingMode(B_OP_COPY); ++ if(LockLooper()) { ++ bufferView->LockLooper(); ++ SetDrawingMode(B_OP_COPY); + DrawBitmap(bufferBitmap,bufferView->Bounds(),Bounds()); + bufferView->UnlockLooper(); + UnlockLooper(); @@ -550,7 +551,7 @@ index 0000000..1ea5f96 + return NULL; +} + -+uint32 ++uint32 +FBView::GetBufferSize() +{ + if(bufferBitmap) { @@ -560,7 +561,7 @@ index 0000000..1ea5f96 +} + +int -+FBView::Width() ++FBView::Width() +{ + return buffer_width; +} @@ -574,36 +575,36 @@ index 0000000..1ea5f96 + +MWindow::MWindow(int width, int height, const char* title) + : BWindow(BRect(80,80,80+width,80+height), title, B_TITLED_WINDOW_LOOK,B_NORMAL_WINDOW_FEEL,0)//B_NOT_RESIZABLE|B_NOT_ZOOMABLE) -+{ ++{ + BScreen scr; + image_width = width; + image_height = height; -+ ++ + float oWidth = ( Frame().left + width )SetViewColor(0,0,0); + AddChild(view); -+ ++ + fb = new FBView(Bounds(), width, height); + fb->SetViewColor(B_TRANSPARENT_32_BIT); + view->AddChild(fb); -+ ++ + ResizeTo(oWidth, oHeight); + + renderRect = Bounds(); + prev_frame = Frame(); -+ ++ +} + + +MWindow::~MWindow() +{ -+ ++ +} + +void @@ -612,31 +613,31 @@ index 0000000..1ea5f96 + if(fs==1) { + prev_frame = Frame(); + BScreen scr; -+ MoveTo(0,0); ++ MoveTo(0,0); + ResizeTo(scr.Frame().right+1,scr.Frame().bottom+1); + } else { + MoveTo(prev_frame.left,prev_frame.top); -+ ResizeTo(prev_frame.Width(),prev_frame.Height()); -+ } ++ ResizeTo(prev_frame.Width(),prev_frame.Height()); ++ } +} + +void +MWindow::FrameResized(float width, float height) +{ -+ int d_width=width; -+ int d_height=height; -+ -+ float winaspect = width/height; -+ float videoaspect = image_width/image_height; -+ -+ d_width = width; -+ d_height = width/videoaspect; -+ -+ if(d_height>height) { -+ d_height = height; -+ d_width = height*videoaspect; -+ } -+ ++ int d_width=width; ++ int d_height=height; ++ ++ float winaspect = width/height; ++ float videoaspect = image_width/image_height; ++ ++ d_width = width; ++ d_height = width/videoaspect; ++ ++ if(d_height>height) { ++ d_height = height; ++ d_width = height*videoaspect; ++ } ++ + renderRect.left = (width - d_width) / 2; + renderRect.top = (height - d_height) / 2; + renderRect.right = renderRect.left + d_width; @@ -644,14 +645,14 @@ index 0000000..1ea5f96 + fb->SetRenderRect(renderRect); +} + -+void ++void +MWindow::Zoom(BPoint origin, float width,float height) +{ -+ vo_fs = !vo_fs; -+ SetFullscreen(vo_fs); ++ vo_fs = !vo_fs; ++ SetFullscreen(vo_fs); +} + -+void ++void +MWindow::MessageReceived(BMessage *message) +{ + switch (message->what) { @@ -664,9 +665,9 @@ index 0000000..1ea5f96 + case B_ESCAPE: + if(vo_fs==1) { + vo_fs = !vo_fs; -+ SetFullscreen(vo_fs); ++ SetFullscreen(vo_fs); + } else { -+ mplayer_put_key(KEY_ESC); ++ mplayer_put_key(KEY_ESC); + } + break; + case B_LEFT_ARROW: @@ -677,7 +678,7 @@ index 0000000..1ea5f96 + break; + case B_UP_ARROW: + mplayer_put_key(KEY_UP); -+ break; ++ break; + case B_DOWN_ARROW: + mplayer_put_key(KEY_DOWN); + break; @@ -686,14 +687,14 @@ index 0000000..1ea5f96 + break; + case B_ENTER: + mplayer_put_key(KEY_ENTER); -+ break; ++ break; + default: + mplayer_put_key(raw_char); + break; -+ -+ } ++ ++ } + break; -+ } ++ } + default: + BWindow::MessageReceived(message); + break; @@ -732,13 +733,13 @@ index 0000000..53e21ef +#include + + -+class FBView : public BView ++class FBView : public BView +{ + public: + FBView(BRect rect); + FBView(BRect rect, int width, int height); + virtual ~FBView(); -+ ++ + void SetRenderRect(BRect r); + void Paint(void); + uint32 *GetBuffer(); @@ -748,14 +749,14 @@ index 0000000..53e21ef + virtual void MouseMoved(BPoint point, uint32 transit,const BMessage *message); + void MouseWheelChanged(BMessage *msg); + void MessageReceived(BMessage *pmsg); -+ ++ + int Width(); + int Height(); + private: -+ int buffer_width; -+ int buffer_height; ++ int buffer_width; ++ int buffer_height; + BView *bufferView; -+ BBitmap *bufferBitmap; ++ BBitmap *bufferBitmap; + BRect renderRect; +}; + @@ -769,13 +770,13 @@ index 0000000..53e21ef + virtual void Zoom(BPoint origin, float width,float height); + bool QuitRequested(); + void SetFullscreen(int fs); -+ ++ + FBView *fb; +public: + BRect prev_frame; + BRect renderRect; -+ thread_id renderer_thread; -+ float image_width, image_height; ++ thread_id renderer_thread; ++ float image_width, image_height; +}; + +#endif //MPLAYER_HAIKU_COMMON_H @@ -791,7 +792,7 @@ index 0000000..e491de4 + * Copyright 2010 Your Name + * All rights reserved. Distributed under the terms of the MIT license. + */ -+ ++ +#include "haiku_window.h" +#include "haiku_view.h" + @@ -812,52 +813,52 @@ index 0000000..e491de4 + +extern void haiku_fullscreen(void); + -+FBView::FBView(BRect rect) : ++FBView::FBView(BRect rect) : + BView(rect, "FBView", B_FOLLOW_ALL, B_WILL_DRAW) //B_WILL_DRAW|B_PULSE_NEEDED|B_FRAME_EVENTS +{ + FBView(rect, rect.IntegerWidth(), rect.IntegerHeight()); +} + -+FBView::FBView(BRect rect, int width, int height) : ++FBView::FBView(BRect rect, int width, int height) : + BView(rect, "FBView", B_FOLLOW_ALL, B_WILL_DRAW) //B_WILL_DRAW|B_PULSE_NEEDED|B_FRAME_EVENTS +{ + renderRect = Bounds(); -+ ++ + buffer_width = width; + buffer_height = height; -+ -+ BRect fbRect = BRect(0,0,buffer_width-1,buffer_height-1); ++ ++ BRect fbRect = BRect(0,0,buffer_width-1,buffer_height-1); + bufferView = new BView(fbRect, "bufferView", B_FOLLOW_ALL_SIDES, 0); + bufferBitmap = new BBitmap(fbRect, B_RGB32, true); -+ bufferBitmap->AddChild(bufferView); ++ bufferBitmap->AddChild(bufferView); +} + +FBView::~FBView() +{ -+ ++ +} + +void +FBView::MouseDown(BPoint point) +{ + uint32 buttons = Window()->CurrentMessage()->FindInt32("buttons"); -+ int32 clicks = Window()->CurrentMessage()->FindInt32("clicks"); -+ ++ int32 clicks = Window()->CurrentMessage()->FindInt32("clicks"); ++ + if( buttons & B_PRIMARY_MOUSE_BUTTON ) { + if(clicks==1) + mplayer_put_key(MOUSE_BTN0); + else { + vo_fs = !vo_fs; -+ haiku_fullscreen(); -+ mplayer_put_key(MOUSE_BTN0); -+ } ++ haiku_fullscreen(); ++ mplayer_put_key(MOUSE_BTN0); ++ } + } + if( buttons & B_SECONDARY_MOUSE_BUTTON ) { + mplayer_put_key(clicks==1?MOUSE_BTN2:MOUSE_BTN2_DBL); + } + if( buttons & B_TERTIARY_MOUSE_BUTTON ) { + mplayer_put_key(clicks==1?MOUSE_BTN1:MOUSE_BTN1_DBL); -+ } ++ } +} + +void @@ -867,24 +868,24 @@ index 0000000..e491de4 + if (msg->FindFloat("be:wheel_delta_y", &dy) == B_OK) { + if(dy>0) + mplayer_put_key(MOUSE_BTN3); -+ else -+ mplayer_put_key(MOUSE_BTN4); ++ else ++ mplayer_put_key(MOUSE_BTN4); + } +} + -+void ++void +FBView::MouseMoved(BPoint point, uint32 transit,const BMessage *message) +{ -+ switch(transit) -+ { -+ case B_INSIDE_VIEW: -+ case B_ENTERED_VIEW: -+ { -+ BPoint p = point; ++ switch(transit) ++ { ++ case B_INSIDE_VIEW: ++ case B_ENTERED_VIEW: ++ { ++ BPoint p = point; + vo_mouse_movement(p.x, p.y); -+ break; -+ } -+ } ++ break; ++ } ++ } +} + +void @@ -900,13 +901,13 @@ index 0000000..e491de4 + } +} + -+void ++void +FBView::Draw(BRect rect) +{ + Paint(); +} + -+void ++void +FBView::SetRenderRect(BRect rect) +{ + renderRect = rect; @@ -915,15 +916,15 @@ index 0000000..e491de4 + Paint(); +} + -+void ++void +FBView::Paint() +{ -+ if(LockLooper()) { -+ bufferView->LockLooper(); -+ SetDrawingMode(B_OP_COPY); -+ DrawBitmap(bufferBitmap,bufferView->Bounds(),B_FILTER_BITMAP_BILINEAR,Bounds()); -+ bufferView->UnlockLooper(); -+ UnlockLooper(); ++ if(LockLooper()) { ++ bufferView->LockLooper(); ++ SetDrawingMode(B_OP_COPY); ++ DrawBitmap(bufferBitmap,bufferView->Bounds(),B_FILTER_BITMAP_BILINEAR,Bounds()); ++ bufferView->UnlockLooper(); ++ UnlockLooper(); + } +} + @@ -936,7 +937,7 @@ index 0000000..e491de4 + return NULL; +} + -+uint32 ++uint32 +FBView::GetBufferSize() +{ + if(bufferBitmap) { @@ -946,7 +947,7 @@ index 0000000..e491de4 +} + +int -+FBView::Width() ++FBView::Width() +{ + return buffer_width; +} @@ -972,13 +973,13 @@ index 0000000..21103eb +#include +#include + -+class FBView : public BView ++class FBView : public BView +{ + public: + FBView(BRect rect); + FBView(BRect rect, int width, int height); + ~FBView(); -+ ++ + void SetRenderRect(BRect r); + void Paint(void); + uint32 *GetBuffer(); @@ -988,14 +989,14 @@ index 0000000..21103eb + virtual void MouseMoved(BPoint point, uint32 transit,const BMessage *message); + void MouseWheelChanged(BMessage *msg); + void MessageReceived(BMessage *pmsg); -+ ++ + int Width(); + int Height(); + private: + int buffer_width; + int buffer_height; + BView *bufferView; -+ BBitmap *bufferBitmap; ++ BBitmap *bufferBitmap; + BRect renderRect; +}; + @@ -1026,14 +1027,14 @@ index 0000000..2f4c8bf + +TestWindow::TestWindow(int width, int height, const char* title) + : BWindow(BRect(100,100,100+width,100+height), title, B_TITLED_WINDOW_LOOK,B_NORMAL_WINDOW_FEEL,0)//B_NOT_RESIZABLE|B_NOT_ZOOMABLE) -+{ ++{ + image_width = width; + image_height = height; + renderRect = Bounds(); + BView *view = new BView(Bounds(),"back",B_FOLLOW_ALL, B_WILL_DRAW); + view->SetViewColor(0,0,0); + AddChild(view); -+ ++ + fb = new FBView(Bounds(), width, height); + fb->SetViewColor(B_TRANSPARENT_32_BIT); + view->AddChild(fb); @@ -1042,26 +1043,26 @@ index 0000000..2f4c8bf + +TestWindow::~TestWindow() +{ -+ ++ +} + +void +TestWindow::FrameResized(float width, float height) +{ -+ int d_width=width; -+ int d_height=height; -+ -+ float winaspect = width/height; -+ float videoaspect = image_width/image_height; -+ -+ d_width = width; -+ d_height = width/videoaspect; -+ -+ if(d_height>height) { -+ d_height = height; -+ d_width = height*videoaspect; -+ } -+ ++ int d_width=width; ++ int d_height=height; ++ ++ float winaspect = width/height; ++ float videoaspect = image_width/image_height; ++ ++ d_width = width; ++ d_height = width/videoaspect; ++ ++ if(d_height>height) { ++ d_height = height; ++ d_width = height*videoaspect; ++ } ++ + renderRect.left = (width - d_width) / 2; + renderRect.top = (height - d_height) / 2; + renderRect.right = renderRect.left + d_width; @@ -1069,14 +1070,14 @@ index 0000000..2f4c8bf + fb->SetRenderRect(renderRect); +} + -+void ++void +TestWindow::Zoom(BPoint origin, float width,float height) +{ + vo_fs = !vo_fs; -+ haiku_fullscreen(); ++ haiku_fullscreen(); +} + -+void ++void +TestWindow::MessageReceived(BMessage *message) +{ + switch (message->what) { @@ -1088,9 +1089,9 @@ index 0000000..2f4c8bf + case B_ESCAPE: + if(vo_fs==1) { + vo_fs = !vo_fs; -+ haiku_fullscreen(); ++ haiku_fullscreen(); + } else { -+ mplayer_put_key(KEY_ESC); ++ mplayer_put_key(KEY_ESC); + } + break; + case B_LEFT_ARROW: @@ -1101,7 +1102,7 @@ index 0000000..2f4c8bf + break; + case B_UP_ARROW: + mplayer_put_key(KEY_UP); -+ break; ++ break; + case B_DOWN_ARROW: + mplayer_put_key(KEY_DOWN); + break; @@ -1110,14 +1111,14 @@ index 0000000..2f4c8bf + break; + case B_ENTER: + mplayer_put_key(KEY_ENTER); -+ break; ++ break; + default: + mplayer_put_key(raw_char); + break; -+ -+ } ++ ++ } + break; -+ } ++ } + default: + BWindow::MessageReceived(message); + break; @@ -1161,8 +1162,8 @@ index 0000000..34513df + FBView *fb; +public: + BRect renderRect; -+ thread_id renderer_thread; -+ float image_width, image_height; ++ thread_id renderer_thread; ++ float image_width, image_height; +}; + +#endif @@ -1244,7 +1245,7 @@ index 0000000..614c8ff + control, + draw_frame, + draw_slice, -+ draw_osd, ++ draw_osd, + flip_page, + check_events, + uninit @@ -1266,12 +1267,12 @@ index 0000000..614c8ff + +static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src, unsigned char *srca, int stride) +{ -+ switch (image_format) -+ { -+ case IMGFMT_BGR32: -+ vo_draw_alpha_rgb32(w,h,src,srca,stride, image_data+4*(y0*image_width+x0),4*image_width); -+ break; -+ } ++ switch (image_format) ++ { ++ case IMGFMT_BGR32: ++ vo_draw_alpha_rgb32(w,h,src,srca,stride, image_data+4*(y0*image_width+x0),4*image_width); ++ break; ++ } +} + +static void draw_osd(void) @@ -1284,32 +1285,32 @@ index 0000000..614c8ff +flip_page(void) +{ + if(haiku_wnd) { -+ haiku_wnd->fb->Paint(); ++ haiku_wnd->fb->Paint(); + } else { + int32 msg_code='RGBA'; + int32 w = image_width, h = image_height, cmd = 0; + int32 sizeBuf = w*h*4; + unsigned char *pbuffer = (unsigned char *)image_data; -+ ++ + int n = sizeBuf/BLOCK; -+ int ln = sizeBuf%BLOCK; -+ unsigned char* ptr=pbuffer; -+ ++ int ln = sizeBuf%BLOCK; ++ unsigned char* ptr=pbuffer; ++ + write_port(port,'BITS',(void*)&cmd, sizeof(int)); -+ ++ + write_port(port,msg_code,(void*)&w, sizeof(int)); + write_port(port,msg_code,(void*)&h, sizeof(int)); -+ -+ for(int i=0;ifb->GetBuffer(); + haiku_wnd->Show(); -+ if(flags&VOFLAG_FULLSCREEN) { ++ if(flags&VOFLAG_FULLSCREEN) { + vo_fs=1; -+ if(haiku_wnd) -+ haiku_wnd->SetFullscreen(vo_fs); -+ } ++ if(haiku_wnd) ++ haiku_wnd->SetFullscreen(vo_fs); ++ } + } else { + image_data=(unsigned char *)malloc(image_size); + } -+ ++ + return 0; +} + +static void +uninit(void) +{ -+ if(!haiku_wnd) ++ if(!haiku_wnd) + free(image_data); +} + @@ -1367,60 +1368,51 @@ index 0000000..614c8ff +} + +static int preinit(const char *arg) -+{ -+// if(be_app==NULL) -+// be_app = new BApplication("application/x-vnd.mplayer"); -+ if(arg) -+ { ++{ ++// if(be_app==NULL) ++// be_app = new BApplication("application/x-vnd.mplayer"); ++ if(arg) ++ { + mp_msg(MSGT_VO,MSGL_WARN, MSGTR_LIBVO_NULL_UnknownSubdevice,arg); + return ENOSYS; -+ } -+ return 0; ++ } ++ return 0; +} + +static int control(uint32_t request, void *data) +{ -+ switch (request) { -+ case VOCTRL_QUERY_FORMAT: -+ { -+ return query_format(*((uint32_t*)data)); -+ } -+ case VOCTRL_FULLSCREEN: -+ { -+ vo_fs = !vo_fs; -+ if(haiku_wnd) -+ haiku_wnd->SetFullscreen(vo_fs); -+ return VO_TRUE; ++ switch (request) { ++ case VOCTRL_QUERY_FORMAT: ++ { ++ return query_format(*((uint32_t*)data)); ++ } ++ case VOCTRL_FULLSCREEN: ++ { ++ vo_fs = !vo_fs; ++ if(haiku_wnd) ++ haiku_wnd->SetFullscreen(vo_fs); ++ return VO_TRUE; + } + } + return VO_NOTIMPL; +} + + --- -2.10.2 - -From 38ddddaa2dd35b98fdbdaf063163cf28e288dea6 Mon Sep 17 00:00:00 2001 -From: Damillora -Date: Sun, 24 Dec 2017 13:13:40 +0700 -Subject: Put settings to user settings folder - - diff --git a/path.c b/path.c -index b8d9335..a98f43b 100644 +index e6287d2..e5c4cd9 100644 --- a/path.c +++ b/path.c @@ -42,6 +42,11 @@ #include #endif - + +#ifdef __HAIKU__ +#include +#include +#endif + #include "osdep/osdep.h" - + char *get_path(const char *filename){ @@ -51,6 +56,13 @@ char *get_path(const char *filename){ char *buff; @@ -1449,6 +1441,6 @@ index b8d9335..a98f43b 100644 len = strlen(homedir) + strlen(config_dir) + 1; if (filename == NULL) { if ((buff = malloc(len)) == NULL) --- -2.14.2 +-- +2.21.0