summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2009-12-29 23:57:14 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2009-12-29 23:57:14 +0200
commit67b40bd21988fed2f70b1c4f5aea301b28f78298 (patch)
treed68ea94ae2d712cb2e991496049bc13f19d9ea60
parent9fe4f647824b8067ea4e4f6cf7f699e6c8fa67cb (diff)
parentf97fd3eff02bd1048750f350230d9e9192ea3dfd (diff)
downloadmpv-67b40bd21988fed2f70b1c4f5aea301b28f78298.tar.bz2
mpv-67b40bd21988fed2f70b1c4f5aea301b28f78298.tar.xz
Merge svn changes up to r30065
-rw-r--r--DOCS/man/en/mplayer.13
-rw-r--r--DOCS/man/it/mplayer.19
-rw-r--r--Makefile1
-rwxr-xr-xconfigure19
-rw-r--r--help/help_mp-it.h5
-rw-r--r--libao2/ao_pulse.c17
-rw-r--r--libvo/gl_common.c12
-rw-r--r--libvo/gl_common.h12
-rw-r--r--libvo/vo_gl.c12
-rw-r--r--libvo/vo_gl2.c16
-rw-r--r--mpcommon.c11
11 files changed, 65 insertions, 52 deletions
diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1
index 29efd7c437..60c9ac9599 100644
--- a/DOCS/man/en/mplayer.1
+++ b/DOCS/man/en/mplayer.1
@@ -3305,7 +3305,8 @@ This option is not suitable to only set the startup screen (because
it will always display on the given screen in fullscreen mode),
\-geometry is the best that is available for that purpose
currently.
-Supported by at least the direct3d, gl, gl2, x11, xv and corevideo video output drivers.
+Supported by at least the direct3d, gl, gl2, x11, xv and corevideo video output
+drivers.
.
.TP
.B \-zrbw (\-vo zr only)
diff --git a/DOCS/man/it/mplayer.1 b/DOCS/man/it/mplayer.1
index 4d43a1b66f..891240c0d8 100644
--- a/DOCS/man/it/mplayer.1
+++ b/DOCS/man/it/mplayer.1
@@ -1,4 +1,4 @@
-.\" synced with r29905
+.\" synced with r30043
.\" Encoding: iso-8859-1
.\" MPlayer (C) 2000-2009 MPlayer Team
.\" Questa pagina di manuale è stata fatta da Gabucino, Diego Biurrun,
@@ -3275,11 +3275,11 @@ allora le coordinate x ed y sono relative all'angolo in alto a sinistra
della finestra stessa piuttosto che dello schermo.
Le coordinate sono relative allo schermo indicato con \-xineramascreen per i
driver di uscita video che gestiscono completamente \-xineramascreen (direct3d,
-gl, gl2, vdpau, x11, xv, xvmc).
+gl, gl2, vdpau, x11, xv, xvmc, corevideo).
.br
.I NOTA:
Questa opzione è supportata dai driver di uscita video x11, xmga, xv, xvmc,
-xvidix, gl, gl2, directx, fbdev e tdfxfb.
+xvidix, gl, gl2, directx, fbdev, tdfxfb e corevideo.
.sp 1
.I ESEMPIO:
.PD 0
@@ -3478,7 +3478,8 @@ Funzionerà solitamente solo con "\-fstype \-fullscreen" o "\-fstype none".
Quest'opzione non è utilizzabile per impostare solo la schermata di avvio
(dato che si aprirà sempre a tutto schermo sullo schermo indicato), per far
ciò la miglior opzione attualmente disponibilie è \-geometry.
-Supportata almeno dai driver di uscita video direct3d, gl, gl2, x11 e xv.
+Supportata almeno dai driver di uscita video direct3d, gl, gl2, x11, xv e
+corevideo.
.
.TP
.B \-zrbw (solo \-vo zr)
diff --git a/Makefile b/Makefile
index d2363bbb13..b8802193ad 100644
--- a/Makefile
+++ b/Makefile
@@ -540,6 +540,7 @@ SRCS_MPLAYER-$(GGI) += libvo/vo_ggi.c
SRCS_MPLAYER-$(GIF) += libvo/vo_gif89a.c
SRCS_MPLAYER-$(GL) += libvo/gl_common.c libvo/vo_gl.c libvo/vo_gl2.c
SRCS_MPLAYER-$(GL_WIN32) += libvo/w32_common.c
+SRCS_MPLAYER-$(GL_X11) += libvo/x11_common.c
SRCS_MPLAYER-$(IVTV) += libao2/ao_ivtv.c libvo/vo_ivtv.c
SRCS_MPLAYER-$(JACK) += libao2/ao_jack.c
diff --git a/configure b/configure
index a8a9f9caf1..95cba49f12 100755
--- a/configure
+++ b/configure
@@ -4799,11 +4799,14 @@ EOF
_gl=no
if cc_check -lGL $_ld_lm ; then
_gl=yes
+ _gl_x11=yes
libs_mplayer="$libs_mplayer -lGL $_ld_dl"
elif cc_check -lGL $_ld_lm $_ld_pthread ; then
_gl=yes
+ _gl_x11=yes
libs_mplayer="$libs_mplayer -lGL $_ld_pthread $_ld_dl"
- elif cc_check -DGL_WIN32 -lopengl32 ; then
+ fi
+ if cc_check -DGL_WIN32 -lopengl32 ; then
_gl=yes
_gl_win32=yes
libs_mplayer="$libs_mplayer -lopengl32 -lgdi32"
@@ -4813,14 +4816,20 @@ else
fi
if test "$_gl" = yes ; then
def_gl='#define CONFIG_GL 1'
+ _res_comment="backends:"
if test "$_gl_win32" = yes ; then
- def_gl_win32='#define GL_WIN32 1'
- _res_comment="win32 version"
+ def_gl_win32='#define CONFIG_GL_WIN32 1'
+ _res_comment="$_res_comment win32"
+ fi
+ if test "$_gl_x11" = yes ; then
+ def_gl_x11='#define CONFIG_GL_X11 1'
+ _res_comment="$_res_comment x11"
fi
_vomodules="opengl $_vomodules"
else
def_gl='#undef CONFIG_GL'
- def_gl_win32='#undef GL_WIN32'
+ def_gl_win32='#undef CONFIG_GL_WIN32'
+ def_gl_x11='#undef CONFIG_GL_X11'
_novomodules="opengl $_novomodules"
fi
echores "$_gl"
@@ -7830,6 +7839,7 @@ GIF = $_gif
GGI = $_ggi
GL = $_gl
GL_WIN32 = $_gl_win32
+GL_X11 = $_gl_x11
HAVE_POSIX_SELECT = $_posix_select
HAVE_SYS_MMAN_H = $_mman
IVTV = $_ivtv
@@ -8302,6 +8312,7 @@ $def_gif_4
$def_gif_tvt_hack
$def_gl
$def_gl_win32
+$def_gl_x11
$def_ivtv
$def_jpeg
$def_kva
diff --git a/help/help_mp-it.h b/help/help_mp-it.h
index 4fab4f04a7..ab33704006 100644
--- a/help/help_mp-it.h
+++ b/help/help_mp-it.h
@@ -2,7 +2,7 @@
// Updated by: Roberto Togni <see AUTHORS for email address>
// Updated by: PaulTT <see AUTHORS for email address>
-// Updated to help_mp-en.h r29912
+// Updated to help_mp-en.h r30044
// ========================= MPlayer help ===========================
@@ -851,8 +851,7 @@ static const char help_text[]=
#define MSGTR_LIBVO_FONT_LOAD_FT_CannotPrepareOSDFont "Impossibile preparare il font per l'OSD.\n"
#define MSGTR_LIBVO_FONT_LOAD_FT_CannotGenerateTables "Impossibile generare le tabelle.\n"
#define MSGTR_LIBVO_FONT_LOAD_FT_DoneFreeTypeFailed "FT_Done_FreeType in errore.\n"
-
-
+#define MSGTR_LIBVO_FONT_LOAD_FT_FontconfigNoMatch "Fontconfig non ha potuto selezionare un font. Provo senza fontconfig...\n"
// sub.c
#define MSGTR_VO_SUB_Seekbar "Barra ricerca"
diff --git a/libao2/ao_pulse.c b/libao2/ao_pulse.c
index b2fdcbb175..a07bf31da0 100644
--- a/libao2/ao_pulse.c
+++ b/libao2/ao_pulse.c
@@ -49,9 +49,6 @@ static struct pa_context *context;
/** Main event loop object */
static struct pa_threaded_mainloop *mainloop;
-/** A temporary variable to store the current volume */
-static pa_cvolume volume;
-
static int broken_pause;
LIBAO_EXTERN(pulse)
@@ -143,7 +140,7 @@ static int init(int rate_hz, int channels, int format, int flags) {
char *devarg = NULL;
char *host = NULL;
char *sink = NULL;
- char *version = pa_get_library_version();
+ const char *version = pa_get_library_version();
if (ao_subdevice) {
devarg = strdup(ao_subdevice);
@@ -189,8 +186,6 @@ static int init(int rate_hz, int channels, int format, int flags) {
pa_channel_map_init_auto(&map, ss.channels, PA_CHANNEL_MAP_ALSA);
ao_data.bps = pa_bytes_per_second(&ss);
- pa_cvolume_reset(&volume, ss.channels);
-
if (!(mainloop = pa_threaded_mainloop_new())) {
mp_msg(MSGT_AO, MSGL_ERR, "AO: [pulse] Failed to allocate main loop\n");
goto fail;
@@ -224,7 +219,7 @@ static int init(int rate_hz, int channels, int format, int flags) {
pa_stream_set_write_callback(stream, stream_request_cb, NULL);
pa_stream_set_latency_update_callback(stream, stream_latency_update_cb, NULL);
- if (pa_stream_connect_playback(stream, sink, NULL, PA_STREAM_INTERPOLATE_TIMING|PA_STREAM_AUTO_TIMING_UPDATE, &volume, NULL) < 0)
+ if (pa_stream_connect_playback(stream, sink, NULL, PA_STREAM_INTERPOLATE_TIMING|PA_STREAM_AUTO_TIMING_UPDATE, NULL, NULL) < 0)
goto unlock_and_fail;
/* Wait until the stream is ready */
@@ -350,13 +345,14 @@ static float get_delay(void) {
* pa_context_get_sink_input_info() operation completes. Saves the
* volume field of the specified structure to the global variable volume. */
static void info_func(struct pa_context *c, const struct pa_sink_input_info *i, int is_last, void *userdata) {
+ struct pa_cvolume *volume = userdata;
if (is_last < 0) {
GENERIC_ERR_MSG(context, "Failed to get sink input info");
return;
}
if (!i)
return;
- volume = i->volume;
+ *volume = i->volume;
pa_threaded_mainloop_signal(mainloop, 0);
}
@@ -365,8 +361,9 @@ static int control(int cmd, void *arg) {
case AOCONTROL_GET_VOLUME: {
ao_control_vol_t *vol = arg;
uint32_t devidx = pa_stream_get_index(stream);
+ struct pa_cvolume volume;
pa_threaded_mainloop_lock(mainloop);
- if (!waitop(pa_context_get_sink_input_info(context, devidx, info_func, NULL))) {
+ if (!waitop(pa_context_get_sink_input_info(context, devidx, info_func, &volume))) {
GENERIC_ERR_MSG(context, "pa_stream_get_sink_input_info() failed");
return CONTROL_ERROR;
}
@@ -384,7 +381,9 @@ static int control(int cmd, void *arg) {
case AOCONTROL_SET_VOLUME: {
const ao_control_vol_t *vol = arg;
pa_operation *o;
+ struct pa_cvolume volume;
+ pa_cvolume_reset(&volume, ao_data.channels);
if (volume.channels != 2)
pa_cvolume_set(&volume, volume.channels, (pa_volume_t)vol->left*PA_VOLUME_NORM/100);
else {
diff --git a/libvo/gl_common.c b/libvo/gl_common.c
index 250f2df2da..f9b8359906 100644
--- a/libvo/gl_common.c
+++ b/libvo/gl_common.c
@@ -1539,7 +1539,7 @@ void glDrawTex(GLfloat x, GLfloat y, GLfloat w, GLfloat h,
End();
}
-#ifdef GL_WIN32
+#ifdef CONFIG_GL_WIN32
#include "w32_common.h"
/**
* \brief little helper since wglGetProcAddress definition does not fit our
@@ -1635,7 +1635,7 @@ static void swapGlBuffers_w32(MPGLContext *ctx) {
vo_w32_release_dc(vo_w32_window, vo_hdc);
}
#endif
-#ifdef CONFIG_X11
+#ifdef CONFIG_GL_X11
#ifdef HAVE_LIBDL
#include <dlfcn.h>
#endif
@@ -1828,7 +1828,7 @@ int init_mpglcontext(MPGLContext *ctx, enum MPGLType type) {
memset(ctx, 0, sizeof(*ctx));
ctx->type = type;
switch (ctx->type) {
-#ifdef GL_WIN32
+#ifdef CONFIG_GL_WIN32
case GLTYPE_W32:
ctx->setGlWindow = setGlWindow_w32;
ctx->releaseGlContext = releaseGlContext_w32;
@@ -1840,7 +1840,7 @@ int init_mpglcontext(MPGLContext *ctx, enum MPGLType type) {
ctx->ontop = vo_w32_ontop;
return vo_w32_init();
#endif
-#ifdef CONFIG_X11
+#ifdef CONFIG_GL_X11
case GLTYPE_X11:
ctx->setGlWindow = setGlWindow_x11;
ctx->releaseGlContext = releaseGlContext_x11;
@@ -1860,12 +1860,12 @@ int init_mpglcontext(MPGLContext *ctx, enum MPGLType type) {
void uninit_mpglcontext(MPGLContext *ctx) {
ctx->releaseGlContext(ctx);
switch (ctx->type) {
-#ifdef GL_WIN32
+#ifdef CONFIG_GL_WIN32
case GLTYPE_W32:
vo_w32_uninit();
break;
#endif
-#ifdef CONFIG_X11
+#ifdef CONFIG_GL_X11
case GLTYPE_X11:
vo_x11_uninit();
break;
diff --git a/libvo/gl_common.h b/libvo/gl_common.h
index 5a3b4c4163..654f13caf9 100644
--- a/libvo/gl_common.h
+++ b/libvo/gl_common.h
@@ -27,12 +27,12 @@
#include "video_out.h"
-#ifdef GL_WIN32
+#ifdef CONFIG_GL_WIN32
#include <windows.h>
#include <GL/gl.h>
#include "w32_common.h"
#endif
-#ifdef CONFIG_X11
+#ifdef CONFIG_GL_X11
#include <GL/gl.h>
#include <X11/Xlib.h>
#include <GL/glx.h>
@@ -45,7 +45,7 @@
#ifndef GLAPIENTRY
#ifdef APIENTRY
#define GLAPIENTRY APIENTRY
-#elif defined(GL_WIN32)
+#elif defined(CONFIG_GL_WIN32)
#define GLAPIENTRY __stdcall
#else
#define GLAPIENTRY
@@ -364,15 +364,15 @@ typedef struct MPGLContext {
enum MPGLType type;
union {
int w32;
-#ifdef CONFIG_X11
+#ifdef CONFIG_GL_X11
XVisualInfo *x11;
#endif
} vinfo;
union {
-#ifdef GL_WIN32
+#ifdef CONFIG_GL_WIN32
HGLRC w32;
#endif
-#ifdef CONFIG_X11
+#ifdef CONFIG_GL_X11
GLXContext x11;
#endif
} context;
diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c
index e3c4571b32..fab076355f 100644
--- a/libvo/vo_gl.c
+++ b/libvo/vo_gl.c
@@ -44,7 +44,7 @@ static const vo_info_t info =
const LIBVO_EXTERN(gl)
-#ifdef CONFIG_X11
+#ifdef CONFIG_GL_X11
static int wsGLXAttrib[] = { GLX_RGBA,
GLX_RED_SIZE,1,
GLX_GREEN_SIZE,1,
@@ -424,7 +424,7 @@ static void uninitGl(void) {
DeleteBuffers(2, gl_buffer_uv);
gl_buffer_uv[0] = gl_buffer_uv[1] = 0; gl_buffersize_uv = 0;
gl_bufferptr_uv[0] = gl_bufferptr_uv[1] = 0;
-#ifdef CONFIG_X11
+#ifdef CONFIG_GL_X11
if (mesa_bufferptr)
FreeMemoryMESA(mDisplay, mScreen, mesa_bufferptr);
#endif
@@ -529,11 +529,11 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin
vo_flipped = !!(flags & VOFLAG_FLIPPING);
-#ifdef GL_WIN32
+#ifdef CONFIG_GL_WIN32
if (glctx.type == GLTYPE_W32 && !vo_w32_config(d_width, d_height, flags))
return -1;
#endif
-#ifdef CONFIG_X11
+#ifdef CONFIG_GL_X11
if (glctx.type == GLTYPE_X11) {
XVisualInfo *vinfo=glXChooseVisual( mDisplay,mScreen,wsGLXAttrib );
if (vinfo == NULL)
@@ -762,7 +762,7 @@ static uint32_t get_image(mp_image_t *mpi) {
mpi->stride[0] = mpi->width * mpi->bpp / 8;
needed_size = mpi->stride[0] * mpi->height;
if (mesa_buffer) {
-#ifdef CONFIG_X11
+#ifdef CONFIG_GL_X11
if (mesa_bufferptr && needed_size > mesa_buffersize) {
FreeMemoryMESA(mDisplay, mScreen, mesa_bufferptr);
mesa_bufferptr = NULL;
@@ -990,7 +990,7 @@ static int preinit(const char *arg)
{
enum MPGLType gltype = GLTYPE_X11;
// set defaults
-#ifdef GL_WIN32
+#ifdef CONFIG_GL_WIN32
gltype = GLTYPE_W32;
#endif
many_fmts = 1;
diff --git a/libvo/vo_gl2.c b/libvo/vo_gl2.c
index 70557b07c2..73c09364f7 100644
--- a/libvo/vo_gl2.c
+++ b/libvo/vo_gl2.c
@@ -104,7 +104,7 @@ struct TexSquare
static GLint getInternalFormat(void)
{
switch (glctx.type) {
-#ifdef GL_WIN32
+#ifdef CONFIG_GL_WIN32
case GLTYPE_W32:
{
PIXELFORMATDESCRIPTOR pfd;
@@ -122,7 +122,7 @@ static GLint getInternalFormat(void)
}
break;
#endif
-#ifdef CONFIG_X11
+#ifdef CONFIG_GL_X11
case GLTYPE_X11:
if (glXGetConfig(mDisplay, glctx.vinfo.x11, GLX_RED_SIZE, &r_sz) != 0) r_sz = 0;
if (glXGetConfig(mDisplay, glctx.vinfo.x11, GLX_GREEN_SIZE, &g_sz) != 0) g_sz = 0;
@@ -462,7 +462,7 @@ static void draw_alpha_15(int x0,int y0, int w,int h, unsigned char* src, unsign
static void draw_alpha_null(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride){
}
-#ifdef GL_WIN32
+#ifdef CONFIG_GL_WIN32
static int config_w32(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format) {
if (!vo_w32_config(d_width, d_height, flags))
@@ -609,7 +609,7 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin
image_width = width;
image_format = format;
-#ifdef GL_WIN32
+#ifdef CONFIG_GL_WIN32
if (config_w32(width, height, d_width, d_height, flags, title, format) == -1)
#else
if (config_glx(width, height, d_width, d_height, flags, title, format) == -1)
@@ -659,7 +659,7 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin
return 0;
}
-#ifndef GL_WIN32
+#ifndef CONFIG_GL_WIN32
static int gl_handlekey(int key)
{
if(key=='a'||key=='A') {
@@ -676,7 +676,7 @@ static int gl_handlekey(int key)
static void check_events(void)
{
int e;
-#ifndef GL_WIN32
+#ifndef CONFIG_GL_WIN32
XEvent Event;
char buf[100];
KeySym keySym;
@@ -830,7 +830,7 @@ static int preinit(const char *arg)
{
enum MPGLType gltype = GLTYPE_X11;
// set defaults
-#ifdef GL_WIN32
+#ifdef CONFIG_GL_WIN32
gltype = GLTYPE_W32;
#endif
use_yuv = 0;
@@ -882,7 +882,7 @@ static int control(uint32_t request, void *data)
case VOCTRL_SET_PANSCAN:
resize(vo_dwidth, vo_dheight);
return VO_TRUE;
-#ifndef GL_WIN32
+#ifndef CONFIG_GL_WIN32
case VOCTRL_SET_EQUALIZER:
{
struct voctrl_set_equalizer_args *args = data;
diff --git a/mpcommon.c b/mpcommon.c
index 456b6e9ee7..4088aada6d 100644
--- a/mpcommon.c
+++ b/mpcommon.c
@@ -199,12 +199,13 @@ void update_subtitles(struct MPContext *mpctx, struct MPOpts *opts,
(long long)((endpts-subpts)*1000 + 0.5));
} else { // plaintext subs with libass
if (subpts != MP_NOPTS_VALUE) {
+ subtitle tmp_subs = {0};
if (endpts == MP_NOPTS_VALUE) endpts = subpts + 3;
- sub_clear_text(&subs, MP_NOPTS_VALUE);
- sub_add_text(&subs, packet, len, endpts);
- subs.start = subpts * 100;
- subs.end = endpts * 100;
- ass_process_subtitle(ass_track, &subs);
+ sub_add_text(&tmp_subs, packet, len, endpts);
+ tmp_subs.start = subpts * 100;
+ tmp_subs.end = endpts * 100;
+ ass_process_subtitle(ass_track, &tmp_subs);
+ sub_clear_text(&tmp_subs, MP_NOPTS_VALUE);
}
}
continue;