allow mplayer to play (non-encrypted) bluray discs.

reviewed by Brad, edd@ and sthen@
This commit is contained in:
phessler 2012-03-30 13:23:03 +00:00
parent 17b9e6ec79
commit feb96f072a
3 changed files with 124 additions and 12 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.201 2012/02/28 19:48:41 sthen Exp $
# $OpenBSD: Makefile,v 1.202 2012/03/30 13:23:03 phessler Exp $
# May not be hard to add more.
ONLY_FOR_ARCHS = ${GCC4_ARCHS}
@ -13,7 +13,7 @@ SUBST_VARS += PREFIX CONFDIR
# Distfiles must be hand-rolled, see README
N = mplayer
DISTNAME = mplayer-${V}
REVISION = 13
REVISION = 14
CATEGORIES = x11 multimedia
@ -26,7 +26,7 @@ PERMIT_DISTFILES_CDROM = Yes
PERMIT_DISTFILES_FTP = Yes
WANTLIB = GL X11 Xext Xinerama Xss Xv Xxf86dga Xxf86vm ass avcodec \
avformat avutil bz2 c cdda_interface cdda_paranoia \
avformat avutil bluray bz2 c cdda_interface cdda_paranoia \
crypto dv enca fontconfig freetype fribidi gsm jpeg lcms \
m mng mp3lame ncurses ogg>=5 orc-0.4 png postproc \
pthread SDL schroedinger-1.0>=2.0 sndio speex stdc++ \
@ -48,6 +48,7 @@ LIB_DEPENDS = graphics/png \
audio/speex \
audio/libogg \
audio/lame \
multimedia/libbluray \
multimedia/libdv \
devel/fribidi \
graphics/lcms \

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-configure,v 1.60 2011/12/30 17:40:40 edd Exp $
--- configure.orig Tue Mar 8 19:33:03 2011
+++ configure Sat Sep 24 15:53:18 2011
$OpenBSD: patch-configure,v 1.61 2012/03/30 13:23:03 phessler Exp $
--- configure.orig Wed Mar 9 01:33:03 2011
+++ configure Wed Jan 25 10:27:59 2012
@@ -35,29 +35,33 @@
#
#############################################################################
@ -219,7 +219,32 @@ $OpenBSD: patch-configure,v 1.60 2011/12/30 17:40:40 edd Exp $
def_mlib='#define CONFIG_MLIB 0'
if sunos; then
echocheck "Sun mediaLib"
@@ -5832,8 +5866,9 @@ if test "$_dvdread_internal" = auto ; then
@@ -5780,7 +5814,15 @@ else
default_dvd_device="/dev/dvd"
fi
+if win32 || os2 || dragonfly || freebsd || openbsd || sunos || amigaos ; then
+ default_bluray_device=$default_cdrom_device
+elif darwin ; then
+ default_bluray_device="/dev/rdiskN"
+else
+ default_bluray_device="/dev/dvd"
+fi
+
echocheck "VCD support"
if test "$_vcd" = auto; then
_vcd=no
@@ -5805,7 +5847,7 @@ echores "$_vcd"
echocheck "Blu-ray support"
if test "$_bluray" = auto ; then
_bluray=no
- statement_check libbluray/bluray.h 'bd_get_title_info(0, 0)' -lbluray && _bluray=yes
+ statement_check libbluray/bluray.h 'bd_get_title_info(0, 0, 0)' -lbluray && _bluray=yes
fi
if test "$_bluray" = yes ; then
def_bluray='#define CONFIG_LIBBLURAY 1'
@@ -5832,8 +5874,9 @@ if test "$_dvdread_internal" = auto ; then
elif test "$_dvdread" = auto ; then
_dvdread=no
if test "$_dl" = yes; then
@ -231,7 +256,7 @@ $OpenBSD: patch-configure,v 1.60 2011/12/30 17:40:40 edd Exp $
if header_check dvdread/dvd_reader.h $_dvdreadcflags $_dvdreadlibs $_ld_dl ; then
_dvdread=yes
extra_cflags="$extra_cflags $_dvdreadcflags"
@@ -6521,7 +6556,7 @@ echores "$_libmpeg2"
@@ -6521,7 +6564,7 @@ echores "$_libmpeg2"
echocheck "libdca support"
if test "$_libdca" = auto ; then
_libdca=no
@ -240,7 +265,7 @@ $OpenBSD: patch-configure,v 1.60 2011/12/30 17:40:40 edd Exp $
statement_check_broken stdint.h dts.h 'dts_init(0)' $_ld_dca $_ld_lm &&
extra_ldflags="$extra_ldflags $_ld_dca" && _libdca=yes && break
done
@@ -7360,6 +7395,8 @@ if test "$_tv_v4l2" = auto ; then
@@ -7360,6 +7403,8 @@ if test "$_tv_v4l2" = auto ; then
_tv_v4l2=no
if test "$_tv" = yes && linux ; then
header_check_broken sys/time.h linux/videodev2.h && _tv_v4l2=yes
@ -249,7 +274,7 @@ $OpenBSD: patch-configure,v 1.60 2011/12/30 17:40:40 edd Exp $
fi
fi
if test "$_tv_v4l2" = yes ; then
@@ -8069,6 +8106,7 @@ SPEEX = $_speex
@@ -8069,6 +8114,7 @@ SPEEX = $_speex
STREAM_CACHE = $_stream_cache
SGIAUDIO = $_sgiaudio
SUNAUDIO = $_sunaudio
@ -257,7 +282,15 @@ $OpenBSD: patch-configure,v 1.60 2011/12/30 17:40:40 edd Exp $
SVGA = $_svga
TDFXFB = $_tdfxfb
TDFXVID = $_tdfxvid
@@ -8445,6 +8483,7 @@ $def_ossaudio_devmixer
@@ -8357,6 +8403,7 @@ $(ff_config_enable "$cpuexts_all" "$cpuexts" "#" "HAVE
/* Blu-ray/DVD/VCD/CD */
#define DEFAULT_CDROM_DEVICE "$default_cdrom_device"
#define DEFAULT_DVD_DEVICE "$default_dvd_device"
+#define DEFAULT_BLURAY_DEVICE "$default_bluray_device"
$def_bluray
$def_bsdi_dvd
$def_cddb
@@ -8445,6 +8492,7 @@ $def_ossaudio_devmixer
$def_pulse
$def_sgiaudio
$def_sunaudio
@ -265,7 +298,7 @@ $OpenBSD: patch-configure,v 1.60 2011/12/30 17:40:40 edd Exp $
$def_win32waveout
$def_ladspa
@@ -8622,6 +8661,7 @@ $def_round
@@ -8622,6 +8670,7 @@ $def_round
$def_roundf
$def_ten_operands
$def_threads

View File

@ -0,0 +1,78 @@
$OpenBSD: patch-stream_stream_bluray_c,v 1.1 2012/03/30 13:23:03 phessler Exp $
Update to new libbluray API
--- stream/stream_bluray.c.orig Wed Mar 9 01:32:47 2011
+++ stream/stream_bluray.c Sun Nov 13 23:59:03 2011
@@ -116,7 +116,7 @@ static int bluray_stream_control(stream_t *s, int cmd,
case STREAM_CTRL_GET_NUM_CHAPTERS: {
BLURAY_TITLE_INFO *ti;
- ti = bd_get_title_info(b->bd, b->current_title);
+ ti = bd_get_title_info(b->bd, b->current_title, 0);
if (!ti)
return STREAM_UNSUPPORTED;
@@ -137,7 +137,7 @@ static int bluray_stream_control(stream_t *s, int cmd,
int64_t pos;
int r;
- ti = bd_get_title_info(b->bd, b->current_title);
+ ti = bd_get_title_info(b->bd, b->current_title, 0);
if (!ti)
return STREAM_UNSUPPORTED;
@@ -156,7 +156,7 @@ static int bluray_stream_control(stream_t *s, int cmd,
case STREAM_CTRL_GET_NUM_ANGLES: {
BLURAY_TITLE_INFO *ti;
- ti = bd_get_title_info(b->bd, b->current_title);
+ ti = bd_get_title_info(b->bd, b->current_title, 0);
if (!ti)
return STREAM_UNSUPPORTED;
@@ -175,7 +175,7 @@ static int bluray_stream_control(stream_t *s, int cmd,
BLURAY_TITLE_INFO *ti;
int angle = *((int *) arg);
- ti = bd_get_title_info(b->bd, b->current_title);
+ ti = bd_get_title_info(b->bd, b->current_title, 0);
if (!ti)
return STREAM_UNSUPPORTED;
@@ -222,6 +222,8 @@ static int bluray_stream_open(stream_t *s, int mode,
device = p->device;
else if (bluray_device)
device = bluray_device;
+ else
+ device = DEFAULT_BLURAY_DEVICE;
if (!device) {
mp_msg(MSGT_OPEN, MSGL_ERR, MSGTR_BlurayNoDevice);
@@ -236,7 +238,7 @@ static int bluray_stream_open(stream_t *s, int mode,
}
/* check for available titles on disc */
- title_count = bd_get_titles(bd, TITLES_RELEVANT);
+ title_count = bd_get_titles(bd, TITLES_RELEVANT, 0);
mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_BLURAY_TITLES=%d\n", title_count);
if (!title_count) {
mp_msg(MSGT_OPEN, MSGL_ERR, MSGTR_BlurayNoTitles);
@@ -250,7 +252,7 @@ static int bluray_stream_open(stream_t *s, int mode,
BLURAY_TITLE_INFO *ti;
int sec, msec;
- ti = bd_get_title_info(bd, i);
+ ti = bd_get_title_info(bd, i, 0);
if (!ti)
continue;
@@ -284,7 +286,7 @@ static int bluray_stream_open(stream_t *s, int mode,
"ID_BLURAY_CURRENT_TITLE=%d\n", title + 1);
/* Get current title information */
- info = bd_get_title_info(bd, title);
+ info = bd_get_title_info(bd, title, 0);
if (!info)
goto err_no_info;