update to gnome-mplayer-0.9.8

From MAINTAINER David Coppa with some reccommendations from landry@ and
myself, namely:

 - comments in patches.
 - remove fullscreen bar animation by default.
 - fix an issue regarding the volume defaulting to zero.
 - message regarding gconfd-2

OK landry@

Thanks
This commit is contained in:
edd 2009-10-31 12:26:25 +00:00
parent add11d9140
commit 9530e9a5f1
14 changed files with 599 additions and 99 deletions

View File

@ -1,8 +1,7 @@
# $OpenBSD: Makefile,v 1.10 2009/08/11 08:42:07 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.11 2009/10/31 12:26:25 edd Exp $
COMMENT = GTK+/GNOME frontend for MPlayer
DISTNAME = gnome-mplayer-0.9.5
PKGNAME = ${DISTNAME}p5
DISTNAME = gnome-mplayer-0.9.8
CATEGORIES = x11 multimedia
MAINTAINER = David Coppa <dcoppa@gmail.com>
@ -17,13 +16,12 @@ PERMIT_PACKAGE_FTP = Yes
PERMIT_DISTFILES_CDROM =Yes
PERMIT_DISTFILES_FTP = Yes
WANTLIB += ORBit-2 X11 Xau Xcomposite Xcursor Xdamage Xdmcp Xext
WANTLIB += Xfixes Xi Xinerama Xrandr Xrender asn1 atk-1.0 c cairo
WANTLIB += crypto dbus-1 dbus-glib-1 expat fontconfig freetype
WANTLIB += gdk-x11-2.0 gdk_pixbuf-2.0 gio-2.0 glib-2.0 glitz gmodule-2.0
WANTLIB += gobject-2.0 gssapi gthread-2.0 gtk-x11-2.0 idn krb5
WANTLIB += m neon pango-1.0 pangocairo-1.0 pangoft2-1.0 pcre pixman-1
WANTLIB += png pthread ssl xml2 z pthread-stubs xcb
WANTLIB += ORBit-2 X11 Xau Xcomposite Xcursor Xdamage Xdmcp Xext m \
Xfixes Xi Xinerama Xrandr Xrender c cairo dbus-1 dbus-glib-1 \
expat fontconfig freetype gdk-x11-2.0 gdk_pixbuf-2.0 gio-2.0 \
glib-2.0 glitz gmodule-2.0 gobject-2.0 gthread-2.0 gtk-x11-2.0 \
neon pango-1.0 pangocairo-1.0 pangoft2-1.0 pixman-1 png pthread \
z pthread-stubs xcb atk-1.0
MODULES = devel/gettext \
devel/gconf2
@ -33,7 +31,7 @@ LIB_DEPENDS = notify::devel/libnotify \
musicbrainz3::audio/libmusicbrainz \
curl.>=12::net/curl
RUN_DEPENDS = ::devel/desktop-file-utils \
::x11/mplayer
:mplayer->=20090708:x11/mplayer
USE_X11 = Yes
USE_LIBTOOL = Yes
@ -51,6 +49,10 @@ CONFIGURE_ARGS = --with-gio \
--with-libnotify \
--with-libgpod \
--with-libmusicbrainz3 \
--without-alsa \
--without-flat-volume \
--without-gpm-new-method \
--without-gpm-old-method \
--disable-nautilus
post-install:

View File

@ -1,5 +1,5 @@
MD5 (gnome-mplayer-0.9.5.tar.gz) = AtAfHMp/869RHFkZjzw1pw==
RMD160 (gnome-mplayer-0.9.5.tar.gz) = R0zHQ/NiVOkuFxZWoF4Zya3f/DQ=
SHA1 (gnome-mplayer-0.9.5.tar.gz) = 1qRuMtXTBe7WiyWuKAt310CV6HM=
SHA256 (gnome-mplayer-0.9.5.tar.gz) = TO+yr6CNjnXBJzmA4srQ4T9Lhy4vkAGfGsDXXsn6Qbc=
SIZE (gnome-mplayer-0.9.5.tar.gz) = 747308
MD5 (gnome-mplayer-0.9.8.tar.gz) = VAYwZU2wRBmMQ18ywEsbUw==
RMD160 (gnome-mplayer-0.9.8.tar.gz) = hKJDMlivAFruqXLRXqvmeqlwgpw=
SHA1 (gnome-mplayer-0.9.8.tar.gz) = hVHCx7e0ju0xWrc6NiN/gBK6c7c=
SHA256 (gnome-mplayer-0.9.8.tar.gz) = snW64/deleW06LdZano2K6D/nlAo5xVUDkIVvIeBr2A=
SIZE (gnome-mplayer-0.9.8.tar.gz) = 721269

View File

@ -0,0 +1,133 @@
$OpenBSD: patch-configure,v 1.1 2009/10/31 12:26:25 edd Exp $
don't check for libgpod 0.6.x: it's not in our ports tree
--- configure.orig Fri Oct 16 03:37:57 2009
+++ configure Fri Oct 16 03:39:08 2009
@@ -653,8 +653,6 @@ GPOD_CFLAGS
GPOD07_LIBS
GPOD07_CFLAGS
GPOD_DEFINES
-GPOD06_LIBS
-GPOD06_CFLAGS
NOTIFY_DEFINES
NOTIFY_LIBS
NOTIFY_CFLAGS
@@ -847,8 +845,6 @@ ALSA_CFLAGS
ALSA_LIBS
NOTIFY_CFLAGS
NOTIFY_LIBS
-GPOD06_CFLAGS
-GPOD06_LIBS
GPOD07_CFLAGS
GPOD07_LIBS
MUSICBRAINZ_CFLAGS
@@ -1548,9 +1544,6 @@ Some influential environment variables:
NOTIFY_CFLAGS
C compiler flags for NOTIFY, overriding pkg-config
NOTIFY_LIBS linker flags for NOTIFY, overriding pkg-config
- GPOD06_CFLAGS
- C compiler flags for GPOD06, overriding pkg-config
- GPOD06_LIBS linker flags for GPOD06, overriding pkg-config
GPOD07_CFLAGS
C compiler flags for GPOD07, overriding pkg-config
GPOD07_LIBS linker flags for GPOD07, overriding pkg-config
@@ -9658,87 +9651,6 @@ fi
if test "x$with_libgpod" != xno; then
pkg_failed=no
-{ $as_echo "$as_me:$LINENO: checking for GPOD06" >&5
-$as_echo_n "checking for GPOD06... " >&6; }
-
-if test -n "$GPOD06_CFLAGS"; then
- pkg_cv_GPOD06_CFLAGS="$GPOD06_CFLAGS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libgpod-1.0 <= 0.6.0\"") >&5
- ($PKG_CONFIG --exists --print-errors "libgpod-1.0 <= 0.6.0") 2>&5
- ac_status=$?
- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- pkg_cv_GPOD06_CFLAGS=`$PKG_CONFIG --cflags "libgpod-1.0 <= 0.6.0" 2>/dev/null`
-else
- pkg_failed=yes
-fi
- else
- pkg_failed=untried
-fi
-if test -n "$GPOD06_LIBS"; then
- pkg_cv_GPOD06_LIBS="$GPOD06_LIBS"
- elif test -n "$PKG_CONFIG"; then
- if test -n "$PKG_CONFIG" && \
- { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"libgpod-1.0 <= 0.6.0\"") >&5
- ($PKG_CONFIG --exists --print-errors "libgpod-1.0 <= 0.6.0") 2>&5
- ac_status=$?
- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- pkg_cv_GPOD06_LIBS=`$PKG_CONFIG --libs "libgpod-1.0 <= 0.6.0" 2>/dev/null`
-else
- pkg_failed=yes
-fi
- else
- pkg_failed=untried
-fi
-
-
-
-if test $pkg_failed = yes; then
-
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
- _pkg_short_errors_supported=yes
-else
- _pkg_short_errors_supported=no
-fi
- if test $_pkg_short_errors_supported = yes; then
- GPOD06_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libgpod-1.0 <= 0.6.0" 2>&1`
- else
- GPOD06_PKG_ERRORS=`$PKG_CONFIG --print-errors "libgpod-1.0 <= 0.6.0" 2>&1`
- fi
- # Put the nasty error message in config.log where it belongs
- echo "$GPOD06_PKG_ERRORS" >&5
-
- { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
- { $as_echo "$as_me:$LINENO: WARNING: Compiling without libgpod 0.6.0 support" >&5
-$as_echo "$as_me: WARNING: Compiling without libgpod 0.6.0 support" >&2;}
-elif test $pkg_failed = untried; then
- { $as_echo "$as_me:$LINENO: WARNING: Compiling without libgpod 0.6.0 support" >&5
-$as_echo "$as_me: WARNING: Compiling without libgpod 0.6.0 support" >&2;}
-else
- GPOD06_CFLAGS=$pkg_cv_GPOD06_CFLAGS
- GPOD06_LIBS=$pkg_cv_GPOD06_LIBS
- { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
- GPOD_DEFINES="-DHAVE_GPOD -DGPOD_06"
-cat >>confdefs.h <<\_ACEOF
-#define GPOD_ENABLED 1
-_ACEOF
-
-fi
-
-
-
-
-fi
-
-
-if test "x$with_libgpod" != xno; then
-
-pkg_failed=no
{ $as_echo "$as_me:$LINENO: checking for GPOD07" >&5
$as_echo_n "checking for GPOD07... " >&6; }
@@ -9817,8 +9729,8 @@ fi
fi
-GPOD_CFLAGS="$GPOD06_CFLAGS $GPOD07_CFLAGS"
-GPOD_LIBS="$GPOD06_LIBS $GPOD07_LIBS"
+GPOD_CFLAGS="$GPOD07_CFLAGS"
+GPOD_LIBS="$GPOD07_LIBS"

View File

@ -0,0 +1,27 @@
$OpenBSD: patch-gnome-mplayer_schemas_in,v 1.1 2009/10/31 12:26:25 edd Exp $
set some sane defaults:
use mplayer's software volume control (see pkg/MESSAGE)
disable bar animation in full screen
--- gnome-mplayer.schemas.in.orig Wed Aug 26 21:26:18 2009
+++ gnome-mplayer.schemas.in Sat Oct 17 17:54:29 2009
@@ -222,7 +222,7 @@
<applyto>/apps/gnome-mplayer/preferences/disable_animation</applyto>
<owner>gnome-mplayer</owner>
<type>bool</type>
- <default>FALSE</default>
+ <default>TRUE</default>
<locale name="C">
<short>Disable Animation</short>
<long>Disable animation of fullscreen control bar sliding away</long>
@@ -270,7 +270,7 @@
<applyto>/apps/gnome-mplayer/preferences/softvol</applyto>
<owner>gnome-mplayer</owner>
<type>bool</type>
- <default>FALSE</default>
+ <default>TRUE</default>
<locale name="C">
<short>Have mplayer use the softvol option</short>
<long>When set to TRUE the softvol option is passed to mplayer, useful for machines without pulseaudio</long>

View File

@ -1,34 +1,109 @@
$OpenBSD: patch-src_gui_c,v 1.3 2009/04/14 09:38:39 ajacoutot Exp $
--- src/gui.c.orig Sun Mar 8 01:29:15 2009
+++ src/gui.c Mon Apr 13 17:41:59 2009
@@ -3550,7 +3550,7 @@ void menuitem_details_callback(GtkMenuItem * menuitem,
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0);
gtk_misc_set_padding(GTK_MISC(label), 12, 0);
gtk_table_attach_defaults(GTK_TABLE(details_table), label, 0, 1, i, i + 1);
- buf = g_strdup_printf("%i Kb/s", (gint) (g_strtod(idle->video_bitrate, NULL) / 1024));
+ buf = g_strdup_printf("%i Kb/s", (gint) (g_strtod(idle->video_bitrate, NULL) / 1000));
label = gtk_label_new(buf);
g_free(buf);
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0);
@@ -3621,7 +3621,7 @@ void menuitem_details_callback(GtkMenuItem * menuitem,
gtk_table_attach_defaults(GTK_TABLE(details_table), label, 0, 1, i, i + 1);
if (idle != NULL) {
buf =
- g_strdup_printf("%i Kb/s", (gint) (g_strtod(idle->audio_bitrate, NULL) / 1024));
+ g_strdup_printf("%i Kb/s", (gint) (g_strtod(idle->audio_bitrate, NULL) / 1000));
label = gtk_label_new(buf);
g_free(buf);
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0);
@@ -3636,7 +3636,7 @@ void menuitem_details_callback(GtkMenuItem * menuitem,
if (idle != NULL) {
buf =
g_strdup_printf("%i Kb/s",
- (gint) (g_strtod(idle->audio_samplerate, NULL) / 1024));
+ (gint) (g_strtod(idle->audio_samplerate, NULL) / 1000));
label = gtk_label_new(buf);
g_free(buf);
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0);
@@ -4104,32 +4104,41 @@ void menuitem_config_callback(GtkMenuItem * menuitem,
$OpenBSD: patch-src_gui_c,v 1.4 2009/10/31 12:26:25 edd Exp $
fixes from upstream svn:
add disable_animation config option
fix hidden cursor over menus
add sun, sndio and rtunes to available audio backends
--- src/gui.c.orig Thu Sep 17 18:05:35 2009
+++ src/gui.c Sun Oct 18 17:51:31 2009
@@ -94,7 +94,9 @@ static void drawing_area_realized(GtkWidget * widget,
* onwards, requesting the native window in a thread causes a BadWindowID,
* so we need to request it now. We could call gdk_window_ensure_native(),
* but that would mean we require GTK+ 2.18, so instead we call this */
+#ifdef GTK2_14_ENABLED
GDK_WINDOW_XID(gtk_widget_get_window(GTK_WIDGET(widget)));
+#endif
}
gint get_player_window()
@@ -435,7 +437,7 @@ gboolean set_progress_value(void *data)
}
if (idle->cachepercent < 1.0 && state == PAUSED) {
text =
- g_strdup_printf(_("Paused | %2i%% \342\226\274"),
+ g_strdup_printf(_("Paused | %2i%%"),
(gint) (idle->cachepercent * 100));
gmtk_media_tracker_set_text(tracker, text);
g_free(text);
@@ -561,7 +563,7 @@ gboolean set_progress_time(void *data)
if (idle->cachepercent > 0 && idle->cachepercent < 1.0 && !(playlist) && !forcecache
&& !idle->streaming) {
- g_snprintf(idle->progress_text, 128, "%s | %2i%% \342\226\274", text,
+ g_snprintf(idle->progress_text, 128, "%s | %2i%%", text,
(int) (idle->cachepercent * 100));
} else {
g_snprintf(idle->progress_text, 128, "%s", text);
@@ -2427,23 +2429,33 @@ gboolean make_panel_and_mouse_invisible(gpointer data)
g_get_current_time(&currenttime);
g_time_val_add(&currenttime, -auto_hide_timeout * G_USEC_PER_SEC);
- if (last_movement_time > 0 && currenttime.tv_sec > last_movement_time) {
- cursor_source = gdk_pixmap_new(NULL, 1, 1, 1);
- cursor =
- gdk_cursor_new_from_pixmap(cursor_source, cursor_source, &cursor_color,
- &cursor_color, 0, 0);
- gdk_pixmap_unref(cursor_source);
- gdk_window_set_cursor(window->window, cursor);
- gdk_cursor_unref(cursor);
+ if (GTK_WIDGET_VISIBLE(menu_file)
+ || GTK_WIDGET_VISIBLE(menu_edit)
+ || GTK_WIDGET_VISIBLE(menu_view)
+ || GTK_WIDGET_VISIBLE(menu_help)) {
+
+ gdk_window_set_cursor(window->window, NULL);
+
+ } else {
+
+ if (last_movement_time > 0 && currenttime.tv_sec > last_movement_time) {
+ cursor_source = gdk_pixmap_new(NULL, 1, 1, 1);
+ cursor =
+ gdk_cursor_new_from_pixmap(cursor_source, cursor_source, &cursor_color,
+ &cursor_color, 0, 0);
+ gdk_pixmap_unref(cursor_source);
+ gdk_window_set_cursor(window->window, cursor);
+ gdk_cursor_unref(cursor);
- if (use_pulse_flat_volume && !softvol) {
- if (idledata->mplayer_volume != idledata->volume) {
- idledata->volume = idledata->mplayer_volume;
- set_volume(idledata);
- }
- }
- }
-
+ if (use_pulse_flat_volume && !softvol) {
+ if (idledata->mplayer_volume != idledata->volume) {
+ idledata->volume = idledata->mplayer_volume;
+ set_volume(idledata);
+ }
+ }
+ }
+ }
+
return FALSE;
}
@@ -3671,6 +3683,8 @@ void config_apply(GtkWidget * widget, void *data)
!(gboolean) gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(config_embeddedfonts));
disable_pause_on_click =
!(gboolean) gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(config_pause_on_click));
+ disable_animation =
+ (gboolean) gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(config_disable_animation));
oldosd = osdlevel;
osdlevel = (gint) gtk_range_get_value(GTK_RANGE(config_osdlevel));
pplevel = (gint) gtk_range_get_value(GTK_RANGE(config_pplevel));
@@ -3774,6 +3788,7 @@ void config_apply(GtkWidget * widget, void *data)
gm_pref_store_set_boolean(gm_store, DISABLEDEINTERLACE, disable_deinterlace);
gm_pref_store_set_boolean(gm_store, DISABLEFRAMEDROP, disable_framedrop);
gm_pref_store_set_boolean(gm_store, DISABLEPAUSEONCLICK, disable_pause_on_click);
+ gm_pref_store_set_boolean(gm_store, DISABLEANIMATION, disable_animation);
gm_pref_store_set_boolean(gm_store, SHOWPLAYLIST, playlist_visible);
gm_pref_store_set_boolean(gm_store, SHOWDETAILS, details_visible);
gm_pref_store_set_boolean(gm_store, USE_MEDIAKEYS, use_mediakeys);
@@ -4697,32 +4712,41 @@ void menuitem_config_callback(GtkMenuItem * menuitem,
tooltip = gtk_tooltips_new();
gtk_tooltips_set_tip(tooltip, config_ao,
_
@ -77,3 +152,16 @@ $OpenBSD: patch-src_gui_c,v 1.3 2009/04/14 09:38:39 ajacoutot Exp $
}
}
}
@@ -5308,6 +5332,12 @@ void menuitem_config_callback(GtkMenuItem * menuitem,
config_pause_on_click = gtk_check_button_new_with_label(_("Pause playback on mouse click"));
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(config_pause_on_click), !disable_pause_on_click);
gtk_table_attach(GTK_TABLE(conf_table), config_pause_on_click, 0, 2, i, i + 1, GTK_FILL,
+ GTK_SHRINK, 0, 0);
+ i++;
+
+ config_disable_animation = gtk_check_button_new_with_label(_("Disable Fullscreen Control Bar Animation"));
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(config_disable_animation), disable_animation);
+ gtk_table_attach(GTK_TABLE(conf_table), config_disable_animation, 0, 2, i, i + 1, GTK_FILL,
GTK_SHRINK, 0, 0);
i++;

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-src_gui_h,v 1.1 2009/10/31 12:26:25 edd Exp $
fix from upstream svn (config_disable_animation)
--- src/gui.h.orig Sun Oct 18 17:35:23 2009
+++ src/gui.h Sun Oct 18 17:36:11 2009
@@ -253,6 +253,7 @@ GtkWidget *config_show_notification;
GtkWidget *config_thumb_position;
GtkWidget *config_use_mediakeys;
GtkWidget *config_use_defaultpl;
+GtkWidget *config_disable_animation;
GtkWidget *config_alang;
GtkWidget *config_slang;

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-src_libgmlib_gm_parse_c,v 1.1 2009/10/31 12:26:25 edd Exp $
fix from upstream svn: missing declaration
--- src/libgmlib/gm_parse.c.orig Sun Oct 11 05:20:52 2009
+++ src/libgmlib/gm_parse.c Sun Oct 11 05:22:10 2009
@@ -159,6 +159,7 @@ gboolean gm_parse_asx_is_asx(const gchar *uri)
#else
FILE *fp;
+ gchar **parse;
gchar *file = NULL;
file = g_strndup(uri, 4);

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-src_libgmlib_gm_parse_h,v 1.1 2009/10/31 12:26:25 edd Exp $
fix from upstream svn: missing include
--- src/libgmlib/gm_parse.h.orig Sun Oct 11 05:20:54 2009
+++ src/libgmlib/gm_parse.h Sun Oct 11 05:23:57 2009
@@ -29,6 +29,7 @@
#else
#include <stdio.h>
#endif
+#include <string.h>
#ifdef __cplusplus
extern "C" {

View File

@ -1,12 +1,27 @@
$OpenBSD: patch-src_main_c,v 1.1 2009/04/14 09:38:39 ajacoutot Exp $
--- src/main.c.orig Mon Apr 13 18:04:28 2009
+++ src/main.c Mon Apr 13 18:06:07 2009
@@ -599,7 +599,7 @@ int main(int argc, char *argv[])
disable_embeddedfonts = read_preference_bool(DISABLEEMBEDDEDFONTS);
disable_pause_on_click = read_preference_bool(DISABLEPAUSEONCLICK);
disable_animation = read_preference_bool(DISABLEANIMATION);
- auto_hide_timeout = read_preference_int(AUTOHIDETIMEOUT);
+ auto_hide_timeout = read_preference_int_with_default(AUTOHIDETIMEOUT,auto_hide_timeout);
disable_cover_art_fetch = read_preference_bool(DISABLE_COVER_ART_FETCH);
use_mediakeys = read_preference_bool(USE_MEDIAKEYS);
metadata_codepage = read_preference_string(METADATACODEPAGE);
$OpenBSD: patch-src_main_c,v 1.2 2009/10/31 12:26:25 edd Exp $
set some sane defaults:
use mplayer's software volume control (see pkg/MESSAGE)
disable bar animation in full screen
--- src/main.c.orig Thu Sep 17 17:56:06 2009
+++ src/main.c Sat Oct 17 17:53:22 2009
@@ -699,7 +699,7 @@ int main(int argc, char *argv[])
playlist_visible = FALSE;
disable_fullscreen = FALSE;
disable_framedrop = FALSE;
- softvol = FALSE;
+ softvol = TRUE;
subtitlefont = NULL;
subtitle_codepage = NULL;
subtitle_color = NULL;
@@ -711,7 +711,7 @@ int main(int argc, char *argv[])
reallyverbose = 0;
embedding_disabled = FALSE;
disable_pause_on_click = FALSE;
- disable_animation = FALSE;
+ disable_animation = TRUE;
auto_hide_timeout = 3;
use_mediakeys = TRUE;
use_defaultpl = FALSE;

View File

@ -1,28 +1,166 @@
$OpenBSD: patch-src_support_c,v 1.1 2009/04/14 09:38:39 ajacoutot Exp $
--- src/support.c.orig Mon Apr 13 18:07:53 2009
+++ src/support.c Mon Apr 13 18:12:50 2009
@@ -2061,6 +2061,24 @@ gint read_preference_int(gchar * key)
return value;
}
$OpenBSD: patch-src_support_c,v 1.2 2009/10/31 12:26:25 edd Exp $
fixes from upstream svn:
problem with playlist detection on glib < 2.22
fix mute flag
--- src/support.c.orig Thu Sep 17 09:56:06 2009
+++ src/support.c Fri Oct 16 03:29:51 2009
@@ -39,6 +39,7 @@ gint detect_playlist(gchar * uri)
gchar *coltitle;
gint count;
gchar *path = NULL;
+ gchar *lower;
#ifdef GIO_ENABLED
GFile *file;
GFileInputStream *input;
@@ -75,40 +76,37 @@ gint detect_playlist(gchar * uri)
memset(buffer, 0, sizeof(buffer));
g_input_stream_read((GInputStream *) input, buffer, sizeof(buffer), NULL, NULL);
output = g_strsplit(buffer, "\n", 0);
- if (output[0] != NULL) {
- g_strchomp(output[0]);
- g_strchug(output[0]);
- }
+ lower = g_ascii_strdown(buffer, -1);
// printf("buffer=%s\n",buffer);
- if (strstr(g_strdown(buffer), "[playlist]") != 0) {
+ if (strstr(lower, "[playlist]") != 0) {
playlist = 1;
}
+gint read_preference_int_with_default(gchar * key, gint default_value)
+{
+ gint value = 0;
+#ifdef HAVE_GCONF
+ gchar *full_key = NULL;
+
+ full_key = g_strdup_printf("/apps/gnome-mplayer/preferences/%s", key);
+ value = gconf_client_get_int(gconf, full_key, NULL);
+ g_free(full_key);
+#else
+ if (g_key_file_has_key(config,"gnome-mplayer",key,NULL))
+ value = g_key_file_get_integer(config, "gnome-mplayer", key, NULL);
+ else
+ value = default_value;
+#endif
+ return value;
+}
+
gfloat read_preference_float(gchar * key)
{
gfloat value = 0;
- if (strstr(g_strdown(buffer), "[reference]") != 0) {
+ if (strstr(lower, "[reference]") != 0) {
playlist = 1;
}
- if (strstr(g_strdown(buffer), "<asx") != 0) {
+ if (strstr(lower, "<asx") != 0) {
playlist = 1;
}
- if (strstr(g_strdown(buffer), "<smil>") != 0) {
+ if (strstr(lower, "<smil>") != 0) {
playlist = 1;
}
- if (strstr(g_strdown(buffer), "#extm3u") != 0) {
+ if (strstr(lower, "#extm3u") != 0) {
playlist = 1;
}
- if (strstr(g_strdown(buffer), "http://") != 0) {
+ if (strstr(lower, "http://") != 0) {
playlist = 1;
}
- if (strstr(g_strdown(buffer), "rtsp://") != 0) {
+ if (strstr(lower, "rtsp://") != 0) {
playlist = 1;
}
- if (strstr(g_strdown(buffer), "pnm://") != 0) {
+ if (strstr(lower, "pnm://") != 0) {
playlist = 1;
}
@@ -129,6 +127,7 @@ gint detect_playlist(gchar * uri)
}
g_free(newuri);
}
+ g_free(lower);
g_strfreev(output);
g_input_stream_close((GInputStream *) input, NULL, NULL);
@@ -150,16 +149,12 @@ gint detect_playlist(gchar * uri)
memset(buffer, 0, sizeof(buffer));
size = fread(buffer, 1, sizeof(buffer) - 1, fp);
output = g_strsplit(buffer, "\n", 0);
- if (output[0] != NULL) {
- g_strchomp(output[0]);
- g_strchug(output[0]);
- }
//printf("buffer=%s\n",buffer);
- if (strstr(g_strdown(buffer), "[playlist]") != 0) {
+ if (strstr(lower, "[playlist]") != 0) {
playlist = 1;
}
- if (strstr(g_strdown(buffer), "[reference]") != 0) {
+ if (strstr(lower, "[reference]") != 0) {
playlist = 1;
}
@@ -167,19 +162,19 @@ gint detect_playlist(gchar * uri)
playlist = 1;
}
- if (strstr(g_strdown(buffer), "<asx") != 0) {
+ if (strstr(lower, "<asx") != 0) {
playlist = 1;
}
- if (strstr(g_strdown(buffer), "http://") != 0) {
+ if (strstr(lower, "http://") != 0) {
playlist = 1;
}
- if (strstr(g_strdown(buffer), "rtsp://") != 0) {
+ if (strstr(lower, "rtsp://") != 0) {
playlist = 1;
}
- if (strstr(g_strdown(buffer), "pnm://") != 0) {
+ if (strstr(lower, "pnm://") != 0) {
playlist = 1;
}
if (output[0] != NULL && g_file_test(output[0], G_FILE_TEST_EXISTS)) {
@@ -193,7 +188,7 @@ gint detect_playlist(gchar * uri)
}
g_free(file);
}
-
+ g_free(lower);
g_strfreev(output);
}
fclose(fp);
@@ -1431,7 +1426,7 @@ MetaData *get_metadata(gchar * uri)
if (strstr(lower, "=title") != NULL || strstr(lower, "=name") != NULL) {
localtitle = strstr(output[ac + 1], "=") + 1;
if (localtitle)
- title = g_strstrip(metadata_to_utf8(localtitle));
+ title = metadata_to_utf8(localtitle);
else
title = NULL;
@@ -2253,9 +2248,13 @@ gdouble get_alsa_volume(gboolean show_details)
if (playback == 1) {
vol = (gdouble) ((get_vol - pmin) * f_multi);
} else {
- idledata->mute = TRUE;
vol = 0;
}
+ if (vol == 0) {
+ idledata->mute = TRUE;
+ } else {
+ idledata->mute = FALSE;
+ }
if (verbose && show_details) {
printf("%s Playback is %i\n", mixer, playback);
printf("%s Range is %li to %li \n", mixer, pmin, pmax);
@@ -2292,9 +2291,13 @@ gdouble get_alsa_volume(gboolean show_details)
if (playback == 1) {
vol = (gdouble) ((get_vol - pmin) * f_multi);
} else {
- idledata->mute = TRUE;
vol = 0;
}
+ if (vol == 0) {
+ idledata->mute = TRUE;
+ } else {
+ idledata->mute = FALSE;
+ }
if (verbose && show_details) {
printf("Master Playback is %i\n", playback);
printf("Master Range is %li to %li \n", pmin, pmax);

View File

@ -1,11 +0,0 @@
$OpenBSD: patch-src_support_h,v 1.1 2009/04/14 09:38:39 ajacoutot Exp $
--- src/support.h.orig Mon Apr 13 18:06:34 2009
+++ src/support.h Mon Apr 13 18:07:39 2009
@@ -87,6 +87,7 @@ gchar *seconds_to_string(gfloat seconds);
void init_preference_store();
gboolean read_preference_bool(gchar * key);
gint read_preference_int(gchar * key);
+gint read_preference_int_with_default(gchar * key, gint default_value);
gfloat read_preference_float(gchar * key);
gchar *read_preference_string(gchar * key);
void write_preference_bool(gchar * key, gboolean value);

View File

@ -0,0 +1,28 @@
$OpenBSD: patch-src_thread_c,v 1.1 2009/10/31 12:26:25 edd Exp $
volume and mute fixes from upstream svn
--- src/thread.c.orig Wed Oct 14 03:38:40 2009
+++ src/thread.c Wed Oct 14 03:45:28 2009
@@ -513,7 +513,12 @@ gboolean thread_reader(GIOChannel * source, GIOConditi
idledata->mplayer_volume = volume;
idledata->mute = (volume > 0);
}
- }
+ } else {
+ if (softvol) {
+ idledata->mplayer_volume = volume;
+ idledata->mute = (volume > 0);
+ }
+ }
}
if (strstr(mplayer_output->str, "ANS_chapters") != 0) {
@@ -844,6 +849,7 @@ gboolean thread_query(gpointer data)
} else {
//send_command("get_time_pos\n");
+ send_command("get_time_length\n", TRUE);
send_command("get_property stream_pos\n", TRUE);
if (threaddata->streaming)
send_command("get_property metadata\n", TRUE);

View File

@ -1,2 +1,9 @@
To prevent errors, the "unclutter" program (from x11/unclutter) must not
be running when using gnome-mplayer.
MPlayer software volume control (softvol) is enabled by default because
there is no volume control in mplayer's sndio backend.
With older (< 2.28.0) versions of the gconf2 package, be sure to kill
any gconfd-2 daemon that may be running before starting gnome-mplayer
for the first time.

View File

@ -1,5 +1,6 @@
@comment $OpenBSD: PLIST,v 1.3 2009/06/07 06:46:37 ajacoutot Exp $
@comment $OpenBSD: PLIST,v 1.4 2009/10/31 12:26:25 edd Exp $
@bin bin/gnome-mplayer
@man man/man1/gnome-mplayer.1
share/applications/gnome-mplayer.desktop
share/doc/gnome-mplayer/
share/doc/gnome-mplayer/AUTHORS
@ -11,14 +12,43 @@ share/doc/gnome-mplayer/README
share/doc/gnome-mplayer/dbus.txt
share/doc/gnome-mplayer/keyboard_shortcuts.txt
share/doc/gnome-mplayer/plugin-interaction.txt
share/icons/
share/icons/hicolor/
share/icons/hicolor/16x16/
share/icons/hicolor/16x16/apps/
share/icons/hicolor/16x16/apps/gnome-mplayer.png
share/icons/hicolor/22x22/
share/icons/hicolor/22x22/apps/
share/icons/hicolor/22x22/apps/gnome-mplayer.png
share/icons/hicolor/24x24/
share/icons/hicolor/24x24/apps/
share/icons/hicolor/24x24/apps/gnome-mplayer.png
share/icons/hicolor/32x32/
share/icons/hicolor/32x32/apps/
share/icons/hicolor/32x32/apps/gnome-mplayer.png
share/icons/hicolor/48x48/
share/icons/hicolor/48x48/apps/
share/icons/hicolor/48x48/apps/gnome-mplayer.png
share/icons/hicolor/scalable/
share/icons/hicolor/scalable/apps/
share/icons/hicolor/scalable/apps/gnome-mplayer.svg
share/locale/bg/LC_MESSAGES/gnome-mplayer.mo
share/locale/cs/LC_MESSAGES/gnome-mplayer.mo
share/locale/de/LC_MESSAGES/gnome-mplayer.mo
share/locale/el/LC_MESSAGES/gnome-mplayer.mo
share/locale/en/LC_MESSAGES/gnome-mplayer.mo
share/locale/en_GB/
share/locale/en_GB/LC_MESSAGES/
share/locale/en_GB/LC_MESSAGES/gnome-mplayer.mo
share/locale/es/LC_MESSAGES/gnome-mplayer.mo
share/locale/fr/LC_MESSAGES/gnome-mplayer.mo
share/locale/it/LC_MESSAGES/gnome-mplayer.mo
share/locale/ja/LC_MESSAGES/gnome-mplayer.mo
share/locale/ko/LC_MESSAGES/gnome-mplayer.mo
share/locale/lt/
share/locale/lt/LC_MESSAGES/
share/locale/lt/LC_MESSAGES/gnome-mplayer.mo
share/locale/nl/LC_MESSAGES/gnome-mplayer.mo
share/locale/pl/LC_MESSAGES/gnome-mplayer.mo
share/locale/pt_BR/LC_MESSAGES/gnome-mplayer.mo
share/locale/ro/LC_MESSAGES/gnome-mplayer.mo
@ -32,10 +62,11 @@ share/locale/tr/LC_MESSAGES/gnome-mplayer.mo
share/locale/zh_CN/LC_MESSAGES/gnome-mplayer.mo
share/locale/zh_HK/LC_MESSAGES/gnome-mplayer.mo
share/locale/zh_TW/LC_MESSAGES/gnome-mplayer.mo
share/pixmaps/gnome-mplayer.png
@unexec GCONF_CONFIG_SOURCE=`%D/bin/gconftool-2 --get-default-source` %D/bin/gconftool-2 --makefile-uninstall-rule %D/${SCHEMAS_INSTDIR}/*.schemas > /dev/null
${SCHEMAS_INSTDIR}/
${SCHEMAS_INSTDIR}/gnome-mplayer.schemas
@exec GCONF_CONFIG_SOURCE=`%D/bin/gconftool-2 --get-default-source` %D/bin/gconftool-2 --makefile-install-rule %D/${SCHEMAS_INSTDIR}/*.schemas > /dev/null
@exec %D/bin/update-desktop-database
@unexec %D/bin/update-desktop-database
@exec %D/bin/gtk-update-icon-cache -q -f -t %D/share/icons/hicolor 2> /dev/null || true
@unexec %D/bin/gtk-update-icon-cache -q -f -t %D/share/icons/hicolor 2> /dev/null || true