Skip to content

Instantly share code, notes, and snippets.

@paulzhol
paulzhol / main.go
Last active April 15, 2023 08:34
golang.org/x/sys/unix.Signalfd usage example (Linux)
// +build linux
package main
import (
"flag"
"log"
"os"
"runtime"
"time"
@paulzhol
paulzhol / freebsd_arm_errors.go
Created August 8, 2017 10:37
generate errors_freebsd_arm.go on armv6 FreeBSD-11.1-RELEASE
// +build ignore
package unix
// copied from mkerrors.sh
/*
#include <sys/capability.h>
#include <sys/param.h>
#include <sys/types.h>
@paulzhol
paulzhol / gist:9f341d89335f20fb646fc6ae141f4bb4
Created July 30, 2017 21:21
FreeBSD-11.1-RELEASE-arm-armv6-CUBIEBOARD2.img.xz boot log
U-Boot SPL 2017.01-rc3 (Jul 21 2017 - 11:26:32)
DRAM: 1024 MiB
CPU: 912000000Hz, AXI/AHB/APB: 3/2/2
Trying to boot from MMC1
U-Boot 2017.01-rc3 (Jul 21 2017 - 11:26:32 +0000) Allwinner Technology
CPU: Allwinner A20 (SUN7I)
Model: Cubietech Cubieboard2
I2C: ready
@paulzhol
paulzhol / _all.o
Last active November 4, 2015 06:29
golang #13139 attachments
@paulzhol
paulzhol / .lircrc
Created April 13, 2013 17:03
lirc bindings for mplayer I've been using with an MCE remote that came with an old WinTV-PVR-150 card.
# mplayer -input cmdlist/keylist
# key-toggle-fullscreen
# key-leave-fullscreen
# key-play-pause
# key-pause
# key-play
# key-faster
# key-slower
# key-rate-normal
# key-rate-faster-fine
@paulzhol
paulzhol / crystalhd_gles.diff
Created April 13, 2013 16:34
Patch against XBMC 12.1 to disable drawing the window manager icon (seems broken for GLES 2.0 both Intel and PowerVR drivers due to color depth issues), and force the software conversion using ffmpeg libswscale from BCM70015 YUYV packed output to YV12 planner format. This is pretty fast with the optimized SSE/SIMD move instructions
diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/CrystalHD.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/CrystalHD.cpp
index 4b7a12f..dc8cc0b 100644
--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/CrystalHD.cpp
+++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/CrystalHD.cpp
@@ -850,7 +850,7 @@ bool CMPCOutputThread::GetDecoderOutput(void)
if (!pBuffer)
{
// No free pre-allocated buffers so make one
- if (m_output_YV12)
+ if (1 || m_output_YV12)
@paulzhol
paulzhol / launch_mplayer.py
Created April 13, 2013 16:15
Launcher script for XBMC external mplayer-vaapi. First argument is the XBMC pid, the second is the filename to play. The script will send a SIGSTOP to the XBMC process, wait for mplayer to exit and send SIGCONT to resume XBMC.
#!/usr/bin/env python
import sys
import os
import signal
import shlex
MPLAYER_PATH='/opt/mplayer-vaapi/bin/mplayer'
MPLAYER_OPTS='-vo vaapi:glfinish -ao alsa:noblock:device=hw=0.3 -fs -slang en -subfont-text-scale 2 -subpos 100'
@paulzhol
paulzhol / playercorefactory.xml
Created April 13, 2013 15:21
XBMC external video player setting
<playercorefactory>
<players>
<player name="mplayer-vaapi" type="ExternalPlayer" audio="false" video="true">
<filename>/home/user/launch_mplayer.py</filename>
<args>"$PPID" "{1}"</args>
<hidexbmc>false</hidexbmc>
<hideconsole>false</hideconsole>
<warpcursor>none</warpcursor>
</player>
</players>