[vdr-plugin-xineliboutput] 02/05: Imported Upstream version 1.1.0+cvs20150211

Tobias Grimm tiber-guest at moszumanska.debian.org
Wed Feb 11 21:45:55 UTC 2015


This is an automated email from the git hooks/post-receive script.

tiber-guest pushed a commit to branch master
in repository vdr-plugin-xineliboutput.

commit f47553b9a0ef68a2f7e1144bd35887cacf04d21f
Author: etobi <git at e-tobi.net>
Date:   Wed Feb 11 21:53:06 2015 +0100

    Imported Upstream version 1.1.0+cvs20150211
---
 HISTORY                                   |   5 +
 Makefile                                  | 175 +++----
 config.c                                  |   7 +-
 config.h                                  |   3 +-
 configure                                 |  14 +-
 device.c                                  | 215 +--------
 device.h                                  |  20 +-
 frontend_svr.c                            |  10 +-
 media_player.c                            |   6 +-
 menu.c                                    |   6 +-
 osd.c                                     |  49 +-
 po/cs_CZ.po                               |   5 +-
 po/de_DE.po                               |   5 +-
 po/et_EE.po                               |   5 +-
 po/fi_FI.po                               |   5 +-
 po/it_IT.po                               |   5 +-
 po/pl_PL.po                               | 774 ++++++++++++++++++++++++++++++
 po/ru_RU.po                               |   5 +-
 po/{cs_CZ.po => sk_SK.po}                 | 392 +++++++--------
 po/uk_UA.po                               |   5 +-
 po/zh_CN.po                               |   5 +-
 po/zh_TW.po                               |   5 +-
 setup_menu.c                              |   5 +-
 tools/gnome_screensaver.c                 |   4 +
 xine_osd_command.h => tools/osd_command.h |  15 +-
 tools/rle.c                               |  50 +-
 tools/rle.h                               |  28 +-
 tools/udp_pes_scheduler.c                 |   9 +-
 xine/osd_manager.c                        |  20 +-
 xine/ts2es.c                              |  10 +-
 xine/vo_osdscaler.c                       |   6 +-
 xine_frontend.c                           |   4 +-
 xine_frontend.h                           |   3 +-
 xine_frontend_cec.c                       | 498 +++++++++++++++++++
 xine_frontend_cec.h                       |  19 +
 xine_frontend_main.c                      |  30 +-
 xine_input_vdr.c                          |  14 +-
 xine_sxfe_frontend.c                      | 112 ++++-
 xineliboutput.c                           |  35 +-
 39 files changed, 1925 insertions(+), 658 deletions(-)

diff --git a/HISTORY b/HISTORY
index 00f38c9..7214079 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,6 +1,11 @@
 VDR Plugin 'xineliboutput' Revision History
 -------------------------------------------
 
+????-??-??: Version 2.0.0
+
+- Support for cDevice::ScaleVideo()
+- Dropped support for vdr < 2.0
+
 2013-08-20: Version 1.1.0
 
 - Added simple touchscreen remote controller to vdr-sxfe
diff --git a/Makefile b/Makefile
index 4295189..1788c7f 100644
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@
 # See the main source file 'xineliboutput.c' for copyright information and
 # how to reach the author.
 #
-# $Id: Makefile,v 1.110 2012/07/29 08:55:00 phintuka Exp $
+# $Id: Makefile,v 1.119 2014/06/17 11:22:15 phintuka Exp $
 #
 
 # The official name of this plugin.
@@ -15,6 +15,7 @@ PLUGIN = xineliboutput
 
 _default: all
 
+# Keep VDR Makefile happy - it requires $(LIBDIR)/.$(APIVERSION) somewhere in this file ...
 
 # check for Apple Darwin
 ARCH_APPLE_DARWIN = no
@@ -61,22 +62,22 @@ endif
 ### The directory environment:
 ###
 
-VDRDIR  ?= ../../..
-LIBDIR  ?= ../../lib
+# Use package data if installed...otherwise assume we're under the VDR source directory:
+PKGCFG = $(if $(VDRDIR),$(shell pkg-config --variable=$(1) $(VDRDIR)/vdr.pc),$(shell PKG_CONFIG_PATH="$$PKG_CONFIG_PATH:../../.." pkg-config --variable=$(1) vdr))
+LIBDIR = $(call PKGCFG,libdir)
+LOCDIR = $(call PKGCFG,locdir)
+PLGCFG = $(call PKGCFG,plgcfg)
+VIDEODIR = $(call PKGCFG,videodir)
+
 TMPDIR  ?= /tmp
 BINDIR  ?= /usr/bin
-#DESTDIR ?= /
 
 INSTALL ?= install
 
-VDRINCDIR ?= $(VDRDIR)/include
-
 ###
 ### Allow user defined options to overwrite defaults:
 ###
 
--include $(VDRDIR)/Make.global
--include $(VDRDIR)/Make.config
 -include Make.config
 
 
@@ -84,38 +85,28 @@ VDRINCDIR ?= $(VDRDIR)/include
 ### check for VDR
 ###
 
-ifeq ($(ARCH_APPLE_DARWIN), yes)
-    VDRVERSION = $(shell sed -ne '/define VDRVERSION/s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h)
-    APIVERSION = $(shell sed -ne '/define APIVERSION/s/^.*"\(.*\)".*$$/\1/p' $(VDRDIR)/config.h)
-else
-    VDRVERSION = $(shell sed -ne '/define VDRVERSION/ { s/^.*"\(.*\)".*$$/\1/; p }' $(VDRDIR)/config.h)
-    APIVERSION = $(shell sed -ne '/define APIVERSION/ { s/^.*"\(.*\)".*$$/\1/; p }' $(VDRDIR)/config.h)
-endif
+APIVERSION = $(call PKGCFG,apiversion)
 
 VDR_TREE = no
-ifeq ($(strip $(VDRVERSION)),)
+ifeq ($(strip $(APIVERSION)),)
     $(warning ********************************************************)
     $(warning VDR not detected ! VDR plugins will not be compiled.    )
     $(warning ********************************************************)
     CONFIGURE_OPTS += --disable-vdr
 else
-    ifeq ($(strip $(APIVERSION)),)
-        $(warning VDR APIVERSION missing, using VDRVERSION $(VDRVERSION) )
-        APIVERSION = $(VDRVERSION)
-    endif
-    CONFIGURE_OPTS += --add-cflags=-I$(VDRDIR)
+    export CFLAGS   = $(call PKGCFG,cflags)
+    export CXXFLAGS = $(call PKGCFG,cxxflags)
 
-    ifeq ($(VDRDIR), ../../..)
+    ifeq ($(VDRDIR),)
+        $(warning Building outside VDR source tree)
+    else
         $(warning Building inside VDR source tree)
         VDR_TREE = yes
-    else
-        $(warning ********************************************************)
-        $(warning VDR source tree not detected !                          )
-        $(warning VDR plugins will not be installed.                      )
-        $(warning ********************************************************)
     endif
 endif
 
+### Allow user defined options to overwrite defaults:
+-include $(PLGCFG)
 
 ###
 ### run configure script
@@ -179,8 +170,6 @@ endif
 ### Includes and Defines (add further entries here):
 ###
 
-INCLUDES  += -I$(VDRINCDIR)
-
 ifeq ($(ARCH_APPLE_DARWIN), yes)
     INCLUDES  += -I/sw/include
     LIBDIRS   += -L/sw/lib
@@ -191,7 +180,7 @@ endif
 
 DEFINES   += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"' \
              -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \
-	     -DXINELIBOUTPUT_VERSION='"$(VERSION)"'
+	     -DVIDEODIR='"$(VIDEODIR)"' -DXINELIBOUTPUT_VERSION='"$(VERSION)"'
 
 ifdef NOSIGNAL_IMAGE_FILE
   DEFINES += -DNOSIGNAL_IMAGE_FILE='"$(NOSIGNAL_IMAGE_FILE)"'
@@ -222,8 +211,10 @@ OBJS_FE_SO = xine_frontend.o logdefs.o \
              xine/post.o xine/vo_hook.o xine/vo_osdscaler.o xine/vo_osdreorder.o xine/vo_lastpts.o \
              xine/vo_frameoutput.o \
              tools/rle.o
-OBJS_FE    = $(OBJS_FE_SO) tools/vdrdiscovery.o xine_frontend_main.o xine_frontend_lirc.o xine_frontend_kbd.o
-
+OBJS_FE    = $(OBJS_FE_SO) \
+             xine_frontend_main.o \
+             xine_frontend_lirc.o xine_frontend_kbd.o xine_frontend_cec.o \
+             tools/vdrdiscovery.o
 OBJS_SXFE_SO = xine_sxfe_frontend.o $(OBJS_FE_SO)
 OBJS_SXFE    = xine_sxfe_frontend.o $(OBJS_FE)
 OBJS_FBFE_SO = xine_fbfe_frontend.o $(OBJS_FE_SO)
@@ -259,7 +250,7 @@ DEPFILE = .dependencies
 $(DEPFILE): Makefile config.mak
 	@rm -f $@
 	@for i in $(OBJS:%.o=%.c) $(OBJS_SXFE:%.o=%.c) $(OBJS_FBFE:%.o=%.c) $(OBJS_XINE:%.o=%.c) ; do \
-	  $(MAKEDEP) $(DEFINES) $(INCLUDES) -MT "`dirname $$i`/`basename $$i .c`.o" $$i >>$@ ; \
+	  $(MAKEDEP) $(CXXFLAGS) $(DEFINES) $(INCLUDES) -MT "`dirname $$i`/`basename $$i .c`.o" $$i >>$@ ; \
 	done
 
 -include $(DEPFILE)
@@ -283,36 +274,36 @@ vdrlogo_720x576.c: mpg2c vdrlogo_720x576.mpg
 	@./mpg2c vdrlogo vdrlogo_720x576.mpg vdrlogo_720x576.c
 
 # C code (xine plugins and frontends)
-$(sort $(OBJS_SXFE) $(OBJS_FBFE) $(OBJS_XINE)):
+$(sort $(OBJS_SXFE) $(OBJS_FBFE) $(OBJS_XINE)): %.o: %.c
 	$(CC) $(CFLAGS) -c $(DEFINES) $(INCLUDES) $(CFLAGS_X11) $(CFLAGS_AVUTIL) $(OPTFLAGS) -o $@ $<
 
 ### Internationalization (I18N):
-ifeq ($(HAVE_I18N), yes)
-ifeq ($(XINELIBOUTPUT_VDRPLUGIN), yes)
 PODIR     = po
-LOCALEDIR ?= $(DESTDIR)$(VDRDIR)/locale
 I18Npo    = $(wildcard $(PODIR)/*.po)
-I18Nmsgs  = $(addprefix $(LOCALEDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file))))))
+I18Nmo    = $(addsuffix .mo, $(foreach file, $(I18Npo), $(basename $(file))))
+I18Nmsgs  = $(addprefix $(DESTDIR)$(LOCDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file))))))
 I18Npot   = $(PODIR)/$(PLUGIN).pot
 
 %.mo: %.po
 	msgfmt -c -o $@ $<
 
 $(I18Npot): $(wildcard *.c)
-	xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --msgid-bugs-address='<phintuka at users.sourceforge.net>' -o $@ $^
+	xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --package-name=vdr-$(PLUGIN) --package-version=$(VERSION) --msgid-bugs-address='<phintuka at users.sourceforge.net>' -o $@ $^
 
 %.po: $(I18Npot)
-	msgmerge -U --no-wrap --no-location --backup=none -q $@ $<
+	msgmerge -U --no-wrap --no-location --backup=none -q -N $@ $<
 	@touch $@
 
-$(I18Nmsgs): $(LOCALEDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo
-	@mkdir -p $(dir $@)
-	cp $< $@
-endif
+$(I18Nmsgs): $(DESTDIR)$(LOCDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo
+ifeq ($(XINELIBOUTPUT_VDRPLUGIN), yes)
+	@echo Installing $^
+	install -D -m644 $< $@
 endif
 
 .PHONY: i18n
-i18n: $(I18Nmsgs)
+i18n: $(I18Nmo) $(I18Npot)
+
+install-i18n: $(I18Nmsgs)
 
 ###
 ### targets
@@ -344,12 +335,18 @@ config: config.mak
 #
 
 $(VDRPLUGIN): $(OBJS) $(OBJS_MPG)
-	$(CXX) $(CXXFLAGS) $(LDFLAGS_SO) $(LDFLAGS) $(OBJS) $(OBJS_MPG) $(LIBS) $(LIBS_VDR) -o $@
+	$(CXX) $(CXXFLAGS) $(LDFLAGS_SO) $(LDFLAGS) -shared $(OBJS) $(OBJS_MPG) $(LIBS) $(LIBS_VDR) -o $@
 ifeq ($(VDR_TREE), yes)
-	@-rm -rf $(LIBDIR)/$@
-	@cp $@ $(LIBDIR)/$@
+	$(INSTALL) $@ $(LIBDIR)/
+endif
+
+install-lib: $(TARGETS_VDR)
+ifeq ($(XINELIBOUTPUT_VDRPLUGIN), yes)
+	@echo Installing $^
+	install -D $^ $(DESTDIR)$(LIBDIR)/
 endif
-# Keep VDR Makefile happy - it requires $(LIBDIR)/.$(APIVERSION) somewhere in this file ...
+
+install: install-lib install-i18n
 
 #
 # vdr-sxfe
@@ -358,11 +355,10 @@ endif
 $(VDRPLUGIN_SXFE): $(OBJS_SXFE_SO)
 	$(CC) $(CFLAGS) $(LDFLAGS_SO) $(LDFLAGS) $(OBJS_SXFE_SO) $(LIBS_X11) $(LIBS_XINE) $(LIBS_JPEG) -o $@
 ifeq ($(VDR_TREE), yes)
-	@-rm -rf $(LIBDIR)/$(VDRPLUGIN_SXFE)
-	@cp $@ $(LIBDIR)/$(VDRPLUGIN_SXFE)
+	$(INSTALL) $@ $(LIBDIR)/
 endif
 $(VDRSXFE): $(OBJS_SXFE)
-	$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS_SXFE) $(LIBS_X11) $(LIBS_XINE) $(LIBS_JPEG) $(LIBS_PTHREAD) -o $@
+	$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS_SXFE) $(LIBS_X11) $(LIBS_XINE) $(LIBS_JPEG) $(LIBS_CEC) $(LIBS_PTHREAD) -o $@
 
 #
 # vdr-fbfe
@@ -371,11 +367,10 @@ $(VDRSXFE): $(OBJS_SXFE)
 $(VDRPLUGIN_FBFE): $(OBJS_FBFE_SO)
 	$(CC) $(CFLAGS) $(LDFLAGS_SO) $(LDFLAGS) $(OBJS_FBFE_SO) $(LIBS_XINE) $(LIBS_JPEG) -o $@
 ifeq ($(VDR_TREE), yes)
-	@-rm -rf $(LIBDIR)/$(VDRPLUGIN_FBFE)
-	@cp $@ $(LIBDIR)/$(VDRPLUGIN_FBFE)
+	$(INSTALL) $@ $(LIBDIR)/
 endif
 $(VDRFBFE): $(OBJS_FBFE)
-	$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS_FBFE) $(LIBS_XINE) $(LIBS_JPEG) $(LIBS_PTHREAD) -o $@
+	$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS_FBFE) $(LIBS_XINE) $(LIBS_JPEG) $(LIBS_CEC) $(LIBS_PTHREAD) -o $@
 
 #
 # xine plugins
@@ -396,58 +391,34 @@ $(XINEPOSTAUDIOCHANNEL): xine_post_audiochannel.o
 
 install: all
 ifeq ($(XINELIBOUTPUT_XINEPLUGIN), yes)
-	@mkdir -p $(DESTDIR)/$(XINEPLUGINDIR)/post
-	@echo Installing $(DESTDIR)/$(XINEPLUGINDIR)/$(XINEINPUTVDR)
-	@-rm -rf $(DESTDIR)/$(XINEPLUGINDIR)/$(XINEINPUTVDR)
-	@$(INSTALL) -m 0644 $(XINEINPUTVDR) $(DESTDIR)/$(XINEPLUGINDIR)/$(XINEINPUTVDR)
-	@echo Installing $(DESTDIR)/$(XINEPLUGINDIR)/post/$(XINEPOSTAUTOCROP)
-	@-rm -rf $(DESTDIR)/$(XINEPLUGINDIR)/post/$(XINEPOSTAUTOCROP)
-	@$(INSTALL) -m 0644 $(XINEPOSTAUTOCROP) $(DESTDIR)/$(XINEPLUGINDIR)/post/$(XINEPOSTAUTOCROP)
-	@echo Installing $(DESTDIR)/$(XINEPLUGINDIR)/post/$(XINEPOSTSWSCALE)
-	@-rm -rf $(DESTDIR)/$(XINEPLUGINDIR)/post/$(XINEPOSTSWSCALE)
-	@$(INSTALL) -m 0644 $(XINEPOSTSWSCALE) $(DESTDIR)/$(XINEPLUGINDIR)/post/$(XINEPOSTSWSCALE)
-	@echo Installing $(DESTDIR)/$(XINEPLUGINDIR)/post/$(XINEPOSTAUDIOCHANNEL)
-	@-rm -rf $(DESTDIR)/$(XINEPLUGINDIR)/post/$(XINEPOSTAUDIOCHANNEL)
-	@$(INSTALL) -m 0644 $(XINEPOSTAUDIOCHANNEL) $(DESTDIR)/$(XINEPLUGINDIR)/post/$(XINEPOSTAUDIOCHANNEL)
-endif
-ifeq ($(XINELIBOUTPUT_VDRPLUGIN), yes)
-  ifeq ($(VDR_TREE), no)
-	@echo Installing $(DESTDIR)$(LIBDIR)/$(VDRPLUGIN)
-	@mkdir -p $(DESTDIR)$(LIBDIR)
-	@-rm -rf $(DESTDIR)$(LIBDIR)/$(VDRPLUGIN)
-	@$(INSTALL) -D -m 0755 $(VDRPLUGIN) $(DESTDIR)$(LIBDIR)/$(VDRPLUGIN)
-  endif
+	@mkdir -p $(DESTDIR)$(XINEPLUGINDIR)/post
+	@echo Installing $(DESTDIR)$(XINEPLUGINDIR)/$(XINEINPUTVDR)
+	@-rm -rf $(DESTDIR)$(XINEPLUGINDIR)/$(XINEINPUTVDR)
+	@$(INSTALL) -m 0644 $(XINEINPUTVDR) $(DESTDIR)$(XINEPLUGINDIR)/$(XINEINPUTVDR)
+	@echo Installing $(DESTDIR)$(XINEPLUGINDIR)/post/$(XINEPOSTAUTOCROP)
+	@-rm -rf $(DESTDIR)$(XINEPLUGINDIR)/post/$(XINEPOSTAUTOCROP)
+	@$(INSTALL) -m 0644 $(XINEPOSTAUTOCROP) $(DESTDIR)$(XINEPLUGINDIR)/post/$(XINEPOSTAUTOCROP)
+	@echo Installing $(DESTDIR)$(XINEPLUGINDIR)/post/$(XINEPOSTSWSCALE)
+	@-rm -rf $(DESTDIR)$(XINEPLUGINDIR)/post/$(XINEPOSTSWSCALE)
+	@$(INSTALL) -m 0644 $(XINEPOSTSWSCALE) $(DESTDIR)$(XINEPLUGINDIR)/post/$(XINEPOSTSWSCALE)
+	@echo Installing $(DESTDIR)$(XINEPLUGINDIR)/post/$(XINEPOSTAUDIOCHANNEL)
+	@-rm -rf $(DESTDIR)$(XINEPLUGINDIR)/post/$(XINEPOSTAUDIOCHANNEL)
+	@$(INSTALL) -m 0644 $(XINEPOSTAUDIOCHANNEL) $(DESTDIR)$(XINEPLUGINDIR)/post/$(XINEPOSTAUDIOCHANNEL)
 endif
 ifeq ($(XINELIBOUTPUT_FB), yes)
-	@echo Installing $(DESTDIR)/$(BINDIR)/vdr-fbfe
-	@mkdir -p $(DESTDIR)/$(BINDIR)
-	@-rm -rf $(DESTDIR)/$(BINDIR)/vdr-fbfe
-	@$(INSTALL) -m 0755 vdr-fbfe $(DESTDIR)/$(BINDIR)/vdr-fbfe
-  ifeq ($(XINELIBOUTPUT_VDRPLUGIN), yes)
-    ifeq ($(VDR_TREE), no)
-	@echo Installing $(DESTDIR)$(LIBDIR)/$(VDRPLUGIN_FBFE)
-	@mkdir -p $(DESTDIR)$(LIBDIR)
-	@-rm -rf $(DESTDIR)$(LIBDIR)/$(VDRPLUGIN_FBFE)
-	@$(INSTALL) -m 0755 $(VDRPLUGIN_FBFE) $(DESTDIR)$(LIBDIR)/$(VDRPLUGIN_FBFE)
-    endif
-  endif
+	@echo Installing $(DESTDIR)$(BINDIR)/vdr-fbfe
+	@mkdir -p $(DESTDIR)$(BINDIR)
+	@-rm -rf $(DESTDIR)$(BINDIR)/vdr-fbfe
+	@$(INSTALL) -m 0755 vdr-fbfe $(DESTDIR)$(BINDIR)/vdr-fbfe
 endif
 ifeq ($(XINELIBOUTPUT_X11), yes)
-	@echo Installing $(DESTDIR)/$(BINDIR)/vdr-sxfe
-	@mkdir -p $(DESTDIR)/$(BINDIR)
-	@-rm -rf $(DESTDIR)/$(BINDIR)/vdr-sxfe
-	@$(INSTALL) -m 0755 vdr-sxfe $(DESTDIR)/$(BINDIR)/vdr-sxfe
-  ifeq ($(XINELIBOUTPUT_VDRPLUGIN), yes)
-    ifeq ($(VDR_TREE), no)
-	@echo Installing $(DESTDIR)$(LIBDIR)/$(VDRPLUGIN_SXFE)
-	@mkdir -p $(DESTDIR)$(LIBDIR)
-	@-rm -rf $(DESTDIR)$(LIBDIR)/$(VDRPLUGIN_SXFE)
-	@$(INSTALL) -m 0755 $(VDRPLUGIN_SXFE) $(DESTDIR)$(LIBDIR)/$(VDRPLUGIN_SXFE)
-    endif
-  endif
+	@echo Installing $(DESTDIR)$(BINDIR)/vdr-sxfe
+	@mkdir -p $(DESTDIR)$(BINDIR)
+	@-rm -rf $(DESTDIR)$(BINDIR)/vdr-sxfe
+	@$(INSTALL) -m 0755 vdr-sxfe $(DESTDIR)$(BINDIR)/vdr-sxfe
 endif
 
-dist: clean
+dist: $(I18Npo) clean
 	@-rm -rf $(TMPDIR)/$(ARCHIVE)
 	@mkdir $(TMPDIR)/$(ARCHIVE)
 	@cp -a * $(TMPDIR)/$(ARCHIVE)
@@ -462,6 +433,4 @@ clean:
 		xine/*.flc $(VDR_FBFE) $(VDR_SXFE) mpg2c black_720x576.c \
 		nosignal_720x576.c vdrlogo_720x576.c vdr-sxfe vdr-fbfe \
 		features.h config.mak configure.log
-ifeq ($(HAVE_I18N), yes)
 	@-rm -f $(PODIR)/*.mo $(PODIR)/*.pot
-endif
diff --git a/config.c b/config.c
index 78d609f..f9ce147 100644
--- a/config.c
+++ b/config.c
@@ -4,7 +4,7 @@
  * See the main source file 'xineliboutput.c' for copyright information and
  * how to reach the author.
  *
- * $Id: config.c,v 1.115 2012/03/19 11:38:43 phintuka Exp $
+ * $Id: config.c,v 1.118 2013/10/28 15:31:45 rofafor Exp $
  *
  */
 
@@ -703,6 +703,9 @@ config_t::config_t() {
   ff_h264_skip_loop_filter     = FF_H264_SKIP_LOOPFILTER_auto;
 
   strn0cpy(media_root_dir,    "/",            sizeof(media_root_dir));
+#if defined(APIVERSNUM) && (APIVERSNUM >= 20102)
+  const char *VideoDirectory = cVideoDirectory::Name() ? cVideoDirectory::Name() : VIDEODIR;
+#endif
   strn0cpy(browse_files_dir,  VideoDirectory, sizeof(browse_files_dir));
   strn0cpy(browse_music_dir,  VideoDirectory, sizeof(browse_music_dir));
   strn0cpy(browse_images_dir, VideoDirectory, sizeof(browse_images_dir));
@@ -712,6 +715,7 @@ config_t::config_t() {
   dvd_arrow_keys_control_playback = 1;
   media_menu_items = ~0;
   media_enable_delete = 0;
+  media_enable_resume = 1;
 
   main_menu_mode = ShowMenu;
   last_hotkey = -1;//kNone;
@@ -1031,6 +1035,7 @@ bool config_t::SetupParse(const char *Name, const char *Value)
   else if (!strcasecmp(Name, "Media.DVD.ArrowKeysControlPlayback")) dvd_arrow_keys_control_playback = atoi(Value);
   else if (!strcasecmp(Name, "Media.MenuItems"))         media_menu_items = atoi(Value);
   else if (!strcasecmp(Name, "Media.EnableDelete"))      media_enable_delete = atoi(Value);
+  else if (!strcasecmp(Name, "Media.EnableResume"))      media_enable_resume = atoi(Value);
 
   else if (!strcasecmp(Name, "Playlist.Tracknumber")) playlist_tracknumber = atoi(Value);
   else if (!strcasecmp(Name, "Playlist.Artist"))      playlist_artist = atoi(Value);
diff --git a/config.h b/config.h
index 1347035..347846a 100644
--- a/config.h
+++ b/config.h
@@ -4,7 +4,7 @@
  * See the main source file 'xineliboutput.c' for copyright information and
  * how to reach the author.
  *
- * $Id: config.h,v 1.90 2012/03/19 11:38:43 phintuka Exp $
+ * $Id: config.h,v 1.91 2013/10/28 09:14:47 phintuka Exp $
  *
  */
 
@@ -354,6 +354,7 @@ class config_t {
     int  dvd_arrow_keys_control_playback;
     uint media_menu_items;         // enabled items in media player menu (bitmask)
     int  media_enable_delete;      // enable Delete in file browser
+    int  media_enable_resume;
 
     // deinterlacing post plugin
     char deinterlace_method[32];
diff --git a/configure b/configure
index f94bfb8..55c165c 100755
--- a/configure
+++ b/configure
@@ -7,7 +7,7 @@
 # See the main source file 'xineliboutput.c' for copyright information and
 # how to reach the author.
 #
-# * $Id: configure,v 1.43 2013/08/15 10:12:27 phintuka Exp $
+# * $Id: configure,v 1.45 2014/01/14 08:21:33 phintuka Exp $
 #
 
 PKG_CONFIG="pkg-config"
@@ -231,6 +231,7 @@ FEATURES="
   xshm
   xdpms
   xinerama
+  xrandr
   xrender
   xshape
   opengl
@@ -240,6 +241,7 @@ FEATURES="
   i18n
   libcap
   libbluray
+  libcec
   mce-dbus-names
 "
 
@@ -267,11 +269,13 @@ show_help(){
   echo
   echo "  --disable-libextractor disable libextractor support (media file metainfo) [no]"
   echo "  --disable-libbluray    disable libbluray support (BluRay metainfo) [no]"
+  echo "  --disable-libcec       disable libcec support (HDMI-CEC remote control) [no]"
   echo "  --disable-libjpeg      disable libjpeg support [no]"
   echo "  --disable-dbus-glib-1  disable dbus-glib support [no]"
   echo "  --disable-xshm         disable XShm support [no]"
   echo "  --disable-xdpms        disable Xdpms support [no]"
   echo "  --disable-xinerama     disable Xinerama support [no]"
+  echo "  --disable-xrandr       disable Xrandr support [no]"
   echo "  --disable-xrender      disable Xrender support (HUD OSD) [no]"
   echo "  --disable-xshape       disable Xshape support (non-transparent HUD OSD without composite manager) [no]"
   echo "  --disable-opengl       disable OpenGL support (transparent HUD OSD without composite manager) [no]"
@@ -330,8 +334,8 @@ done
 #
 
 check_deps(){
-  disabled libxine && disable x11 fb libavutil libjpeg
-  disabled x11     && disable dbus-glib-1 xshm xrender xshape opengl xdpms xinerama vdpau
+  disabled libxine && disable x11 fb libavutil libjpeg libcec
+  disabled x11     && disable dbus-glib-1 xshm xrandr xrender xshape opengl xdpms xinerama vdpau
   disabled vdr     && disable libextractor libcap libbluray
   disabled dlfcn   && disable opengl
   disabled pthread && disable opengl
@@ -370,9 +374,11 @@ if enabled libxine; then
   test_library   JPEG    libjpeg      "jpeglib.h"              "-ljpeg"      "jpeg_create_compress(0)"
   test_library   X11     x11          "X11/X.h"                "-lX11"       "XInitThreads()"
   test_library   PTHREAD pthread      "pthread.h"              "-lpthread"   "pthread_create(0,0,0,0)"
+  test_library   CEC     libcec       "libcec/cecc.h"          "-lcec"       "cec_initialize(0)"
   if enabled x11; then
     test_library X11  xext         "X11/extensions/Xext.h"     "-lXext"      ""
     test_library X11  xshm         "X11/extensions/XShm.h"     "-lXext"      "XShmQueryExtension(0)"
+    test_library X11  xrandr       "X11/extensions/Xrandr.h"   "-lXrandr"    "XRRGetScreenInfo(0,0)"
     test_library X11  xrender      "X11/extensions/Xrender.h"  "-lXrender"   "XRenderQueryFormats(0)"
     test_library X11  xshape       "X11/extensions/shape.h"    "-lXext"      "XShapeQueryExtension(0,0,0)"
     test_library X11  xdpms        "X11/extensions/dpms.h"     "-lXext"      "DPMSDisable(0)"
@@ -476,4 +482,4 @@ echo "LIBS_AVUTIL += $LIBS_AVUTIL">>$makefile
 echo "LIBS_PTHREAD += $LIBS_PTHREAD">>$makefile
 echo "LIBS_VDR    += $LIBS_VDR">>$makefile
 echo "LIBS_X11    += $LIBS_X11">>$makefile
-
+echo "LIBS_CEC    += $LIBS_CEC">>$makefile
diff --git a/device.c b/device.c
index c182ce9..edb9357 100644
--- a/device.c
+++ b/device.c
@@ -4,7 +4,7 @@
  * See the main source file 'xineliboutput.c' for copyright information and
  * how to reach the author.
  *
- * $Id: device.c,v 1.125 2013/08/20 09:33:43 phintuka Exp $
+ * $Id: device.c,v 1.127 2013/08/21 09:40:22 phintuka Exp $
  *
  */
 
@@ -47,10 +47,6 @@
 #define LOCAL_INIT_TIMEOUT        20  // seconds
 #define SERVER_INIT_TIMEOUT       5   // seconds
 
-#if (VDRVERSNUM > 10700) && (VDRVERSNUM < 10711)
-# error VDR versions 1.7.1 ... 1.7.10 are not supported !
-#endif
-
 #ifdef LOG_TRICKSPEED
 #  define LOGTRICKSPEED(x...) LOGMSG("trs: " x)
 #else
@@ -77,12 +73,8 @@ class cXinelibStatusMonitor : public cStatus
     };
 
   protected:
-#if VDRVERSNUM < 10726
-    virtual void ChannelSwitch(const cDevice *Device, int ChannelNumber);
-#else
     virtual void ChannelSwitch(const cDevice *Device, int ChannelNumber, bool LiveView);
-#endif
-    virtual void Replaying(const cControl *Control, const char *Name, 
+    virtual void Replaying(const cControl *Control, const char *Name,
 			   const char *FileName, bool On);
 
     cXinelibDevice& m_Device;
@@ -115,12 +107,8 @@ class cXinelibStatusMonitor : public cStatus
 #endif
 };
 
-void cXinelibStatusMonitor::ChannelSwitch(const cDevice *Device, 
-#if VDRVERSNUM < 10726
-					  int ChannelNumber) 
-#else
-					  int ChannelNumber, bool LiveView) 
-#endif
+void cXinelibStatusMonitor::ChannelSwitch(const cDevice *Device,
+					  int ChannelNumber, bool LiveView)
 {
   TRACEF("cXinelibStatusMonitor::ChannelSwitch");
   TRACK_TIME(200);
@@ -208,10 +196,6 @@ cXinelibDevice::cXinelibDevice()
   m_liveMode    = true;
   m_TrickSpeed  = -1;
   m_TrickSpeedMode = 0;
-#if VDRVERSNUM < 10705
-  m_TrickSpeedPts = 0;
-  m_TrickSpeedDelay = 0;
-#endif
   m_SkipAudio   = false;
   m_PlayingFile = pmNone;
   m_StreamStart = true;
@@ -691,12 +675,7 @@ bool cXinelibDevice::SetPlayMode(ePlayMode PlayMode)
 #define trs_IPB_frames 0x01  // stream has all frame types
 #define trs_I_frames   0x02  // stream has only I-frames
 #define trs_NoAudio    0x08  // no audio in trick speed mode
-#if VDRVERSNUM < 10705
-#define trs_PTS_recalc 0x10  // PTS must be re-calculated
-#define trs_PTS_check  0x20  // detect in PlayVideo if PTS must be recalculated
-#else
 #define trs_Backward   0x40  // palying backwards -- same as regen pts ???
-#endif
 
 void cXinelibDevice::TrickSpeed(int Speed) 
 {
@@ -707,10 +686,6 @@ void cXinelibDevice::TrickSpeed(int Speed)
     LOGTRICKSPEED("TrickSpeed changed from %d to %d [%d]", m_TrickSpeed, Speed, RealSpeed);
 
     m_TrickSpeed = Speed;
-#if VDRVERSNUM < 10705
-    m_TrickSpeedPts = 0;
-    m_TrickSpeedDelay = 0;
-#endif
 
     //  Possible transitions:
     //     fast <-> play
@@ -741,16 +716,8 @@ void cXinelibDevice::TrickSpeed(int Speed)
       //  ForEach(m_clients, &cXinelibThread::Clear);
       //}
 
-#if VDRVERSNUM < 10705
-      // only I-frames, backwards, pts must be re-generated
-      m_TrickSpeedMode = trs_I_frames | trs_PTS_recalc | trs_NoAudio;
-
-      // change decoder and UDP/RTP scheduler clock rates
-      ForEach(m_clients, &cXinelibThread::TrickSpeed, RealSpeed);
-#else
       m_TrickSpeedMode = trs_I_frames | trs_Backward | trs_NoAudio;
       ForEach(m_clients, &cXinelibThread::TrickSpeed, RealSpeed, true);
-#endif
     }
 
     else if(Speed == 6 || Speed == 3 || Speed == 1) {
@@ -766,17 +733,6 @@ void cXinelibDevice::TrickSpeed(int Speed)
 	LOGTRICKSPEED("    Trick speed limited to %dx speed", RealSpeed);
       }
 
-#if VDRVERSNUM < 10705
-      /* only I-frames, backwards, pts must be re-generated if playing backwards */
-      m_TrickSpeedMode |= trs_PTS_check;
-
-      /* backward/forward state is unknown until first PTS is seen 
-	 so, clear() must be done in PlayVideo. */
-      /* previous trick speed state is not overwritten yet ... ! */
-
-      // change decoder and UDP/RTP scheduler clock rates
-      ForEach(m_clients, &cXinelibThread::TrickSpeed, -RealSpeed);
-#else
       if (m_StreamStart || (m_TrickSpeedMode & trs_Backward)) {
         m_TrickSpeedMode |= trs_I_frames | trs_Backward | trs_NoAudio;
 
@@ -788,7 +744,6 @@ void cXinelibDevice::TrickSpeed(int Speed)
 
         ForEach(m_clients, &cXinelibThread::TrickSpeed, -RealSpeed);
       }
-#endif
     }
 
     else if(Speed==-1 || Speed == 0) {
@@ -960,124 +915,6 @@ bool cXinelibDevice::PlayFile(const char *FileName, int Position,
 // Data stream handling
 //
 
-int cXinelibDevice::PlayTrickSpeed(const uchar *buf, int length) 
-{
-#if VDRVERSNUM < 10705
-  if(abs(m_TrickSpeed) > 1 && (m_TrickSpeedMode & trs_I_frames)) {
-    uint8_t PictureType = pes_get_picture_type(buf, length);
-#ifdef LOG_TRICKSPEED
-      if(PictureType != NO_PICTURE && PES_HAS_PTS(buf)) {
-	int64_t pts = pes_get_pts(buf, length);
-	LOGMSG("    TrickSpeed: frame %s pts %"PRId64, picture_type_str[PictureType], pts);
-      }
-#endif
-
-#if 1
-    // limit I-frame rate
-    if(PictureType == I_FRAME) {
-      static int64_t t0 = 0;
-      int64_t t1 = cTimeMs::Now();
-      if((t1 - t0) < 1000) {
-	int fdelay = 40*12; // = 480 ms, time of one GOP in normal speed
-	switch(m_TrickSpeed) {
-	  case  6: /*   2x ff  */ fdelay /= min( 2, xc.max_trickspeed); break;
-	  case  3: /*   4x ff  */ fdelay /= min( 4, xc.max_trickspeed); break;
-	  case  1: /*  12x ff  */ fdelay /= min(12, xc.max_trickspeed); break;
-	  case 63: /* 1/6x rew */ fdelay *= 6; break;
-	  case 48: /* 1/4x rew */ fdelay *= 4; break;
-	  case 24: /* 1/2x rew */ fdelay *= 2; break;
-	  default: break;
-	}
-	/* wait if data is coming in too fast */
-	if(fdelay - (t1-t0) >= 40) {
-	  m_TrickSpeedDelay = 40;
-	  return -1;
-	}
-	
-	t0 += fdelay;
-
-	pes_change_pts((uchar*)buf, length, INT64_C(0));
-      } else {
-	t0 = t1;
-      }
-    }
-#endif
-  }
-
-  //
-  // detecting trick speed mode ?
-  //
-  if( m_TrickSpeed > 0 && (m_TrickSpeedMode & trs_PTS_check) && IS_VIDEO_PACKET(buf)) {
-    int64_t pts;
-    if (PES_HAS_PTS(buf) && (pts = pes_get_pts(buf, length)) > 0) {
-      uint8_t PictureType = pes_get_picture_type(buf, length);
-      if(PictureType != I_FRAME && PictureType != NO_PICTURE) {
-	// --> must be fast worward with IBP frames.
-	// --> PTS check does not work (frames are sent in decoder order) ! */
-	m_TrickSpeedPts = pts - 1;
-	LOGTRICKSPEED("    Detected fast forward mode, using IBP frames");
-      }
-      if(m_TrickSpeedPts == 0) {
-	m_TrickSpeedMode |= trs_NoAudio;
-	m_TrickSpeedPts = pts;
-	LOGTRICKSPEED("    Seen video pts = %"PRId64, pts);
-      } else {
-	if(pts < m_TrickSpeedPts) {
-	  /* -> playing fast backwards */
-	  LOGTRICKSPEED("    Detected fast backward mode. last %"PRId64" now %"PRId64, 
-			m_TrickSpeedPts, pts);
-	  //if(!(m_TrickSpeedMode & trs_PTS_recalc))
-	  //  ForEach(m_clients, &cXinelibThread::Clear);
-	  m_TrickSpeedMode = trs_I_frames | trs_PTS_recalc | trs_NoAudio;	  
-	} else {
-	  LOGTRICKSPEED("    Detected fast forward mode");
-          if(xc.ibp_trickspeed)
-            m_TrickSpeedMode = trs_IPB_frames;
-          else
-            m_TrickSpeedMode = trs_I_frames;
-	}
-      }
-    }
-  }
-
-  //
-  // Trick speed mode with PTS re-calc
-  //
-  if( m_TrickSpeed > 0 && (m_TrickSpeedMode & trs_PTS_recalc) && 
-      IS_VIDEO_PACKET(buf) && PES_HAS_PTS(buf)) {
-    int64_t pts = pes_get_pts(buf, length);
-    if (pts > 0) {
-      
-      /* m_TrickSpeedPts could be 0 in case of slow backwards */
-      if(m_TrickSpeedPts == 0)
-	m_TrickSpeedPts = pts;
-
-      LOGTRICKSPEED("    pts %"PRId64" -> %"PRId64" (diff %"PRId64")  %"PRId64"", pts, 
-		    m_TrickSpeedPts + 40*12*90, m_TrickSpeedPts + 40*12*90 - pts,
-		    (m_TrickSpeedPts + 40*12*90)^0x80000000);
-      pts = m_TrickSpeedPts = m_TrickSpeedPts + 40*12*90; /* 12 frames * 40ms -> pts units */
-      pts ^= 0x80000000; /* discontinuity (when mode changes) forces re-syncing of all clocks */
-      pes_change_pts((uchar*)buf, length, pts);
-    }
-  }
-
-#if 1
-  else if (m_TrickSpeedMode & trs_I_frames) {
-    if (IS_VIDEO_PACKET(buf) && PES_HAS_PTS(buf)) {
-      int64_t pts = pes_get_pts(buf, length);
-      if (pts > 0) {
-	pts ^= 0x80000000; /* discontinuity (when mode changes) forces re-syncing of all clocks */
-	pes_change_pts((uchar*)buf, length, pts);
-      }
-    }
-  }
-#endif
-
-#endif /* VDRVERSNUM < 10705 */
-
-  return 0;
-}
-
 int cXinelibDevice::PlayAny(const uchar *buf, int length) 
 {
   TRACEF("cXinelibDevice::PlayAny");
@@ -1117,8 +954,6 @@ int cXinelibDevice::PlayAny(const uchar *buf, int length)
   }
 
   if(m_TrickSpeed > 0) {
-    if(PlayTrickSpeed(buf, length) < 0)
-      return 0; /* wait if data is coming in too fast */
   } else if(m_SkipAudio) {
     /* needed for still images when moving cutting marks */
     if (DATA_IS_PES(buf))
@@ -1127,20 +962,19 @@ int cXinelibDevice::PlayAny(const uchar *buf, int length)
   m_FreeBufs --;
 
   if(m_local) {
-    length = (isMpeg1 ? m_local->Play_Mpeg1_PES(buf,length) : 
+    length = (isMpeg1 ? m_local->Play_Mpeg1_PES(buf,length) :
                         m_local->Play(buf, length));
-  } 
+  }
   if(m_server && length > 0) {
-    int length2 = isMpeg1 ? m_server->Play_Mpeg1_PES(buf, length) : 
+    int length2 = isMpeg1 ? m_server->Play_Mpeg1_PES(buf, length) :
                             m_server->Play(buf, length);
     if(!m_local)
       return length2;
   }
-  
+
   return length;
 }
 
-#if VDRVERSNUM >= 10701 || defined(TSPLAY_PATCH_VERSION)
 /*
  * hook to PlayTs() to get PAT and PMT
  */
@@ -1160,11 +994,7 @@ int cXinelibDevice::PlayTs(const uchar *Data, int Length, bool VideoOnly)
   if (TsHasPayload(Data) && TsPayloadOffset(Data) < TS_SIZE) {
 
     int Pid = TsPid(Data);
-#if VDRVERSNUM < 10733
-    if (Pid == 0 || Pid == PatPmtParser()->PmtPid()) {
-#else
     if (Pid == PATPID || PatPmtParser()->IsPmtPid(Pid)) {
-#endif
       if (m_server)
         m_server->SetHeader(Data, Result, Pid == 0);
 
@@ -1284,7 +1114,6 @@ int cXinelibDevice::PlayTsVideo(const uchar *Data, int Length)
 
   return PlayTsAny(Data, Length);
 }
-#endif // VDRVERSNUM >= 10701 || defined(TSPLAY_PATCH_VERSION)
 
 bool cXinelibDevice::AcceptVideoPacket(const uchar *Data, int Length)
 {
@@ -1393,9 +1222,7 @@ void cXinelibDevice::StillPicture(const uchar *Data, int Length)
   bool isPes   = DATA_IS_PES(Data) && ((Data[3] & 0xF0) == 0xE0);
   bool isMpeg1 = isPes && ((Data[6] & 0xC0) != 0x80);
   bool isH264  = isPes && pes_is_frame_h264(Data, Length);
-#if VDRVERSNUM >= 10701 || defined(TSPLAY_PATCH_VERSION)
   bool isTs    = DATA_IS_TS(Data);
-#endif
 
   int i;
 
@@ -1420,7 +1247,6 @@ void cXinelibDevice::StillPicture(const uchar *Data, int Length)
 	      &mmin<int>, Length);
     } else if(isPes) {
       /*cDevice::*/PlayPes(Data, Length, m_SkipAudio);
-#if VDRVERSNUM >= 10701 || defined(TSPLAY_PATCH_VERSION)
     } else if(isTs) {
       int written = 0, total = (Length/TS_SIZE)*TS_SIZE;
       while (written < total) {
@@ -1431,7 +1257,6 @@ void cXinelibDevice::StillPicture(const uchar *Data, int Length)
           cCondWait::SleepMs(5);
       }
       TsBufferFlush();
-#endif
     } else {
       ForEach(m_clients, &cXinelibThread::Play_Mpeg2_ES,
               Data, Length, VIDEO_STREAM, isH264,
@@ -1492,15 +1317,6 @@ bool cXinelibDevice::Poll(cPoller &Poller, int TimeoutMs)
     return true;
   }
 
-#if VDRVERSNUM < 10705
-  if(m_TrickSpeed > 1 && m_TrickSpeedDelay > 20) {
-    LOGTRICKSPEED("    Poll: m_TrickSpeedDelay=%d.", m_TrickSpeedDelay);
-    cCondWait::SleepMs(20);
-    m_TrickSpeedDelay -= 20;
-    return false;
-  }
-#endif
-
   if(m_FreeBufs < 1) {
     int result = DEFAULT_POLL_SIZE;
 
@@ -1631,7 +1447,6 @@ eVideoSystem cXinelibDevice::GetVideoSystem(void)
   return cDevice::GetVideoSystem();
 }
 
-#if VDRVERSNUM >= 10708
 void cXinelibDevice::GetVideoSize(int &Width, int &Height, double &VideoAspect)
 {
   Width  = m_VideoSize->width;
@@ -1642,7 +1457,6 @@ void cXinelibDevice::GetVideoSize(int &Width, int &Height, double &VideoAspect)
     VideoAspect *= (double)Width / (double)Height;
   }
 }
-#endif
 
 void cXinelibDevice::GetOsdSize(int &Width, int &Height, double &PixelAspect)
 {
@@ -1704,6 +1518,19 @@ bool cXinelibDevice::SupportsTrueColorOSD(void)
   return m_server && (m_server->SupportsTrueColorOSD() == 1);
 }
 
+cRect cXinelibDevice::CanScaleVideo(const cRect &Rect, int Alignment)
+{
+  return Rect;
+}
+
+void cXinelibDevice::ScaleVideo(const cRect &Rect)
+{
+  if (m_VideoWindow != Rect) {
+    m_VideoWindow = Rect;
+    cXinelibOsdProvider::RefreshOsd();
+  }
+}
+
 //
 // SPU decoder
 //
diff --git a/device.h b/device.h
index b5681cb..2c6704d 100644
--- a/device.h
+++ b/device.h
@@ -4,7 +4,7 @@
  * See the main source file 'xineliboutput.c' for copyright information and
  * how to reach the author.
  *
- * $Id: device.h,v 1.63 2012/03/17 20:14:41 phintuka Exp $
+ * $Id: device.h,v 1.66 2014/01/07 16:03:54 rofafor Exp $
  *
  */
 
@@ -90,6 +90,7 @@ class cXinelibDevice : public cDevice
     virtual bool HasDecoder(void) const { return true; };
     virtual bool CanReplay(void) const { return true; };
     virtual bool HasIBPTrickSpeed(void) { return xc.ibp_trickspeed; }
+    virtual cRect CanScaleVideo(const cRect &Rect, int Alignment = taCenter);
 
     bool SupportsTrueColorOSD(void);
 
@@ -99,22 +100,23 @@ class cXinelibDevice : public cDevice
     ePlayMode m_PlayMode;
     int       m_TrickSpeed;
     int       m_TrickSpeedMode;
-#if VDRVERSNUM < 10705
-    int64_t   m_TrickSpeedPts;
-    int       m_TrickSpeedDelay;
-#endif
+    cRect     m_VideoWindow;
 
   public:
     virtual bool SetPlayMode(ePlayMode PlayMode);
     ePlayMode GetPlayMode(void) const { return m_PlayMode; };
 
+    const cRect& GetVideoWindow(void) { return m_VideoWindow; }
+
   protected:
     virtual void    Clear(void);
     virtual void    Play(void);
+    virtual void    TrickSpeed(int Speed, bool Forward) { TrickSpeed(Speed); }
     virtual void    TrickSpeed(int Speed);
     virtual void    Freeze(void);
     virtual bool    Flush(int TimeoutMs = 0);
     virtual int64_t GetSTC(void);
+    virtual void    ScaleVideo(const cRect &Rect = cRect::Null);
 
   // Video format facilities
 
@@ -125,9 +127,7 @@ class cXinelibDevice : public cDevice
 
     struct video_size_s *m_VideoSize;
     struct ts_state_s   *m_tssVideoSize;
-#if VDRVERSNUM >= 10708
     virtual void GetVideoSize(int &Width, int &Height, double &VideoAspect);
-#endif
     virtual void GetOsdSize(int &Width, int &Height, double &PixelAspect);
 
   // Track facilities
@@ -237,7 +237,6 @@ class cXinelibDevice : public cDevice
     int  m_FreeBufs;
 
     int PlayAny(const uchar *Data, int Length);
-    int PlayTrickSpeed(const uchar *buf, int length);
 
     bool AcceptVideoPacket(const uchar *Data, int Length);
     bool AcceptAudioPacket(const uchar *Data, int Length);
@@ -253,7 +252,6 @@ class cXinelibDevice : public cDevice
     virtual int  PlayAudio(const uchar *Data, int Length, uchar Id);
     virtual int  PlaySubtitle(const uchar *Data, int Length);
 
-#if VDRVERSNUM >= 10701 || defined(TSPLAY_PATCH_VERSION)
     // join multiple TS packets to xineliboutput transport packet
     cMutex        m_TsBufLock;
     uint8_t       m_TsBuf[4096];
@@ -269,10 +267,6 @@ class cXinelibDevice : public cDevice
     virtual int PlayTsAudio(const uchar *Data, int Length);
     virtual int PlayTsSubtitle(const uchar *Data, int Length);
     virtual int PlayTs(const uchar *Data, int Length, bool VideoOnly = false);
-#else
-    void        TsBufferClear(void) {}
-    void        TsBufferFlush(void) {}
-#endif
 
   // Picture-In-Picture
 
diff --git a/frontend_svr.c b/frontend_svr.c
index 8f7b320..a79b406 100644
--- a/frontend_svr.c
+++ b/frontend_svr.c
@@ -4,7 +4,7 @@
  * See the main source file 'xineliboutput.c' for copyright information and
  * how to reach the author.
  *
- * $Id: frontend_svr.c,v 1.107 2012/03/18 12:22:25 phintuka Exp $
+ * $Id: frontend_svr.c,v 1.109 2014/06/23 12:20:28 phintuka Exp $
  *
  */
 
@@ -34,8 +34,8 @@
 #include "config.h"
 
 #include "xine_input_vdr_net.h"   // stream header(s)
-#include "xine_osd_command.h"     // osd commands
 
+#include "tools/osd_command.h"     // osd commands
 #include "tools/cxsocket.h"
 #include "tools/future.h"
 #include "tools/backgroundwriter.h"
@@ -255,7 +255,7 @@ static int write_osd_command(cxSocket& s, osd_command_t *cmd)
   ssize_t max  = s.tx_buffer_free();
   ssize_t size = (ssize_t)8 +
                  (ssize_t)(sizeof(osd_command_t)) +
-                 (ssize_t)(sizeof(xine_clut_t) * ntohl(cmd->colors)) +
+                 (ssize_t)(sizeof(osd_clut_t) * ntohl(cmd->colors)) +
                  (ssize_t)(ntohl(cmd->datalen));
 
   if(max > 0 && max < MIN(size, 1024)) {
@@ -279,8 +279,8 @@ static int write_osd_command(cxSocket& s, osd_command_t *cmd)
     return -1;
   }
   if(cmd->palette && cmd->colors &&
-     (ssize_t)(sizeof(xine_clut_t)*ntohl(cmd->colors)) !=
-     s.write(cmd->palette, sizeof(xine_clut_t)*ntohl(cmd->colors), 100)) {
+     (ssize_t)(sizeof(osd_clut_t)*ntohl(cmd->colors)) !=
+     s.write(cmd->palette, sizeof(osd_clut_t)*ntohl(cmd->colors), 100)) {
     LOGDBG("write_osd_command: write (palette) failed");
     return -1;
   }
diff --git a/media_player.c b/media_player.c
index 00e018a..0b9b8ca 100644
--- a/media_player.c
+++ b/media_player.c
@@ -4,7 +4,7 @@
  * See the main source file 'xineliboutput.c' for copyright information and
  * how to reach the author.
  *
- * $Id: media_player.c,v 1.94 2012/08/29 19:25:14 phintuka Exp $
+ * $Id: media_player.c,v 1.95 2013/10/28 09:14:47 phintuka Exp $
  *
  */
 
@@ -96,7 +96,7 @@ class cXinelibPlayer : public cPlayer
 cXinelibPlayer::cXinelibPlayer(cXinelibDevice *Dev, const char *File, bool Queue, const char *SubFile)
 {
   m_ResumeFile = NULL;
-  m_UseResumeFile = true;
+  m_UseResumeFile = xc.media_enable_resume;
   m_Error = false;
   m_Speed = 1;
   m_Dev = Dev;
@@ -547,7 +547,7 @@ cXinelibPlayerControl::cXinelibPlayerControl(cXinelibDevice *Dev, eMainMenuMode
   number = 0;
   lastTime.Set();
 
-  m_Player->UseResumeFile( (Mode==ShowFiles) );
+  m_Player->UseResumeFile( (Mode==ShowFiles) && xc.media_enable_resume);
 
   MsgReplaying(*m_Player->Playlist().Current()->Title, *m_Player->File());
 }
diff --git a/menu.c b/menu.c
index 4defe82..62046cd 100644
--- a/menu.c
+++ b/menu.c
@@ -4,7 +4,7 @@
  * See the main source file 'xineliboutput.c' for copyright information and
  * how to reach the author.
  *
- * $Id: menu.c,v 1.96 2012/03/19 11:29:14 phintuka Exp $
+ * $Id: menu.c,v 1.97 2013/10/25 17:22:38 rofafor Exp $
  *
  */
 
@@ -220,7 +220,11 @@ void cMenuBrowseFiles::Set(void)
   }
 
   if (m_CurrentDir[0] != '/') {
+#if defined(APIVERSNUM) && (APIVERSNUM < 20102)
     m_CurrentDir = VideoDirectory;
+#else
+    m_CurrentDir = cVideoDirectory::Name();
+#endif
   }
 
   // find deepest accessible directory from path
diff --git a/osd.c b/osd.c
index 90756b4..dbbb90c 100644
--- a/osd.c
+++ b/osd.c
@@ -4,7 +4,7 @@
  * See the main source file 'xineliboutput.c' for copyright information and
  * how to reach the author.
  *
- * $Id: osd.c,v 1.48 2011/03/20 23:04:47 phintuka Exp $
+ * $Id: osd.c,v 1.52 2014/06/23 12:20:28 phintuka Exp $
  *
  */
 
@@ -15,7 +15,8 @@
 #include "logdefs.h"
 #include "config.h"
 #include "device.h"
-#include "xine_osd_command.h"
+
+#include "tools/osd_command.h"
 
 #include "osd.h"
 
@@ -36,7 +37,7 @@ static inline int saturate(int x, int min, int max)
   return x < min ? min : (x > max ? max : x);
 }
 
-static inline void prepare_palette(xine_clut_t *clut, const unsigned int *palette, int colors, bool top, bool rgb)
+static inline void prepare_palette(osd_clut_t *clut, const unsigned int *palette, int colors, bool top, bool rgb)
 {
   if (colors) {
     int c;
@@ -251,7 +252,7 @@ void cXinelibOsd::CmdPalette(int Wnd, int Colors, unsigned int *Palette)
   TRACEF("cXinelibOsd::CmdPalette");
 
   if (m_Device) {
-    xine_clut_t   clut[Colors];
+    osd_clut_t    clut[Colors];
     osd_command_t osdcmd = {0};
 
     osdcmd.cmd     = OSD_SetPalette;
@@ -310,8 +311,7 @@ void cXinelibOsd::SetCmdFlags(osd_command_t& cmd)
 
   cmd.scaling = xc.osd_scaling;
 
-  if ((VDRVERSNUM < 10717 && m_Layer == OSD_LEVEL_SUBTITLES) ||
-      (                      m_Layer == OSD_LEVEL_TTXTSUBS))
+  if (m_Layer == OSD_LEVEL_TTXTSUBS)
     cmd.scaling = xc.osd_spu_scaling;
 }
 
@@ -354,7 +354,7 @@ void cXinelibOsd::CmdLut8(int Wnd, int X0, int Y0,
 
   if (m_Device) {
 
-    xine_clut_t   clut[Colors];
+    osd_clut_t    clut[Colors];
     osd_command_t osdcmd = {0};
 
     osdcmd.cmd   = OSD_Set_LUT8;
@@ -434,10 +434,7 @@ eOsdError cXinelibOsd::SetAreas(const tArea *Areas, int NumAreas)
     return oeTooManyAreas;
   }
 
-#if VDRVERSNUM >= 10708
-  if (xc.osd_spu_scaling &&
-      ((VDRVERSNUM < 10717 && m_Layer == OSD_LEVEL_SUBTITLES) ||
-       (                      m_Layer == OSD_LEVEL_TTXTSUBS))) {
+  if (xc.osd_spu_scaling && m_Layer == OSD_LEVEL_TTXTSUBS) {
     m_ExtentWidth  = 720;
     m_ExtentHeight = 576;
   } else {
@@ -448,22 +445,6 @@ eOsdError cXinelibOsd::SetAreas(const tArea *Areas, int NumAreas)
     m_ExtentHeight = H;
   }
 
-#else
-
-  // Detect full OSD area size
-  if(Left() + Width() > 720 || Top() + Height() > 576) {
-    m_ExtentWidth  = Setup.OSDWidth  + 2 * Setup.OSDLeft;
-    m_ExtentHeight = Setup.OSDHeight + 2 * Setup.OSDTop;
-    LOGDBG("Detected HD OSD, size > %dx%d, using setup values %dx%d",
-           2*Left() + Width(), 2*Top() + Height(),
-           m_ExtentWidth, m_ExtentHeight);
-  } else {
-    m_ExtentWidth  = 720;
-    m_ExtentHeight = 576;
-  }
-
-#endif
-
   CmdSize(m_ExtentWidth, m_ExtentHeight);
 
   return Result;
@@ -526,12 +507,11 @@ void cXinelibOsd::Flush(void)
   if(!m_IsVisible)
     return;
 
-#ifdef YAEPGHDVERSNUM
-  if (vidWin.bpp)
-    CmdVideoWindow(vidWin.x1, vidWin.y1, vidWin.Width(), vidWin.Height());
-#endif
+  const cRect& videoWindow = m_Device->GetVideoWindow();
+  if (videoWindow != cRect::Null) {
+    CmdVideoWindow(videoWindow.X(), videoWindow.Y(), videoWindow.Width(), videoWindow.Height());
+  }
 
-#if VDRVERSNUM >= 10717
   if (IsTrueColor()) {
 
     LOCK_PIXMAPS;
@@ -545,13 +525,10 @@ void cXinelibOsd::Flush(void)
 
     return;
   }
-#endif
 
   int SendDone = 0, XOffset = 0, YOffset = 0;
 
-  if (!xc.osd_spu_scaling &&
-      ((VDRVERSNUM < 10717 && m_Layer == OSD_LEVEL_SUBTITLES) ||
-       (                      m_Layer == OSD_LEVEL_TTXTSUBS))) {
+  if (!xc.osd_spu_scaling && m_Layer == OSD_LEVEL_TTXTSUBS) {
     double Aspect;
     int    W, H;
     m_Device->GetOsdSize(W, H, Aspect);
diff --git a/po/cs_CZ.po b/po/cs_CZ.po
index 7df54fe..492dda2 100644
--- a/po/cs_CZ.po
+++ b/po/cs_CZ.po
@@ -6,7 +6,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: Xineliboutput 1.1.0\n"
 "Report-Msgid-Bugs-To: <phintuka at users.sourceforge.net>\n"
-"POT-Creation-Date: 2012-03-13 13:13+0200\n"
+"POT-Creation-Date: 2013-10-29 10:29+0200\n"
 "PO-Revision-Date: 2008-03-20 23:57+0100\n"
 "Last-Translator: Maya <maja373 at gmail.com>\n"
 "Language-Team: Czech <vdr at linuxtv.org>\n"
@@ -708,6 +708,9 @@ msgstr ""
 msgid "Allow removing files"
 msgstr ""
 
+msgid "Remember last playback position"
+msgstr ""
+
 msgid "Media Player"
 msgstr "Přehrávač médií"
 
diff --git a/po/de_DE.po b/po/de_DE.po
index 467a4f5..884abe8 100644
--- a/po/de_DE.po
+++ b/po/de_DE.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: Xineliboutput 1.1.0\n"
 "Report-Msgid-Bugs-To: <phintuka at users.sourceforge.net>\n"
-"POT-Creation-Date: 2012-03-13 13:13+0200\n"
+"POT-Creation-Date: 2013-10-29 10:29+0200\n"
 "PO-Revision-Date: 2007-11-23 10:17+0200\n"
 "Last-Translator: Udo Richter\n"
 "Language-Team: German <vdr at linuxtv.org>\n"
@@ -707,6 +707,9 @@ msgstr ""
 msgid "Allow removing files"
 msgstr ""
 
+msgid "Remember last playback position"
+msgstr ""
+
 msgid "Media Player"
 msgstr "Medien..."
 
diff --git a/po/et_EE.po b/po/et_EE.po
index 27f2f20..97ad3cb 100644
--- a/po/et_EE.po
+++ b/po/et_EE.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: Xineliboutput 1.1.0\n"
 "Report-Msgid-Bugs-To: <phintuka at users.sourceforge.net>\n"
-"POT-Creation-Date: 2012-03-13 13:13+0200\n"
+"POT-Creation-Date: 2013-10-29 10:29+0200\n"
 "PO-Revision-Date: 2008-10-06 11:19+0200\n"
 "Last-Translator: Arthur Konovalov\n"
 "Language-Team: Estonian <vdr at linuxtv.org>\n"
@@ -707,6 +707,9 @@ msgstr ""
 msgid "Allow removing files"
 msgstr ""
 
+msgid "Remember last playback position"
+msgstr ""
+
 msgid "Media Player"
 msgstr "Meediapleier"
 
diff --git a/po/fi_FI.po b/po/fi_FI.po
index 05eda75..4a8f746 100644
--- a/po/fi_FI.po
+++ b/po/fi_FI.po
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: Xineliboutput 1.1.0\n"
 "Report-Msgid-Bugs-To: <phintuka at users.sourceforge.net>\n"
-"POT-Creation-Date: 2012-03-13 13:13+0200\n"
+"POT-Creation-Date: 2013-10-29 10:29+0200\n"
 "PO-Revision-Date: 2008-10-06 11:19+0200\n"
 "Last-Translator: Rolf Ahrenberg\n"
 "Language-Team: Finnish <vdr at linuxtv.org>\n"
@@ -708,6 +708,9 @@ msgstr "Näytä piilotiedostot"
 msgid "Allow removing files"
 msgstr "Salli tiedostojen poistaminen"
 
+msgid "Remember last playback position"
+msgstr "Muista edellinen toistokohta"
+
 msgid "Media Player"
 msgstr "Mediasoitin"
 
diff --git a/po/it_IT.po b/po/it_IT.po
index 13c8bd9..4df1aba 100644
--- a/po/it_IT.po
+++ b/po/it_IT.po
@@ -6,7 +6,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: Xineliboutput 1.1.0\n"
 "Report-Msgid-Bugs-To: <phintuka at users.sourceforge.net>\n"
-"POT-Creation-Date: 2012-03-13 13:13+0200\n"
+"POT-Creation-Date: 2013-10-29 10:29+0200\n"
 "PO-Revision-Date: 2011-07-10 02:27+0100\n"
 "Last-Translator: Diego Pierotto <vdr-italian at tiscali.it>\n"
 "Language-Team: Italian <vdr at linuxtv.org>\n"
@@ -709,6 +709,9 @@ msgstr ""
 msgid "Allow removing files"
 msgstr ""
 
+msgid "Remember last playback position"
+msgstr ""
+
 msgid "Media Player"
 msgstr "Lettore multimediale"
 
diff --git a/po/pl_PL.po b/po/pl_PL.po
new file mode 100644
index 0000000..9371d2d
--- /dev/null
+++ b/po/pl_PL.po
@@ -0,0 +1,774 @@
+# VDR plugin language source file.
+# Copyright (C) 2007 Klaus Schmidinger <kls at cadsoft.de>
+# This file is distributed under the same license as the VDR package.
+# Tomasz Maciej Nowak, 2014
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Xineliboutput 1.1.0\n"
+"Report-Msgid-Bugs-To: <phintuka at users.sourceforge.net>\n"
+"POT-Creation-Date: 2013-10-29 10:29+0200\n"
+"PO-Revision-Date: 2014-11-16 20:03+0100\n"
+"Last-Translator: Tomasz Maciej Nowak <tomek_n at o2.pl>\n"
+"Language-Team: Polish <vdr at linuxtv.org>\n"
+"Language: pl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Poedit 1.6.10\n"
+
+msgid "custom"
+msgstr "własny"
+
+msgid "tiny"
+msgstr "tycie"
+
+msgid "small"
+msgstr "małe"
+
+msgid "medium"
+msgstr "średnie"
+
+msgid "large"
+msgstr "duże"
+
+msgid "huge"
+msgstr "ogromne"
+
+msgid "automatic"
+msgstr "automatyczne"
+
+msgid "default"
+msgstr "standardowe"
+
+msgid "Pan&Scan"
+msgstr "Pan&Scan"
+
+msgid "CenterCutOut"
+msgstr "CenterCutOut"
+
+msgid "square"
+msgstr "kwadratowe"
+
+msgid "anamorphic"
+msgstr "anamorficzne"
+
+msgid "DVB"
+msgstr "DVB"
+
+msgid "off"
+msgstr "wyłączone"
+
+msgid "no audio"
+msgstr "brak dźwięku"
+
+msgid "no video"
+msgstr "brak obrazu"
+
+msgid "Off"
+msgstr "Wyłączone"
+
+msgid "Goom"
+msgstr "Goom"
+
+msgid "Oscilloscope"
+msgstr "Oscyloskop"
+
+msgid "FFT Scope"
+msgstr "Spektrum FFT"
+
+msgid "FFT Graph"
+msgstr "Graficzne FFT"
+
+msgid "Image"
+msgstr "Zdjęcie"
+
+msgid "Mono 1.0"
+msgstr "Mono 1.0"
+
+msgid "Stereo 2.0"
+msgstr "Stereo 2.0"
+
+msgid "Headphones 2.0"
+msgstr "Słuchawki 2.0"
+
+msgid "Stereo 2.1"
+msgstr "Stereo 2.1"
+
+msgid "Surround 3.0"
+msgstr "Surround 3.0"
+
+msgid "Surround 4.0"
+msgstr "Surround 4.0"
+
+msgid "Surround 4.1"
+msgstr "Surround 4.1"
+
+msgid "Surround 5.0"
+msgstr "Surround 5.0"
+
+msgid "Surround 5.1"
+msgstr "Surround 5.1"
+
+msgid "Surround 6.0"
+msgstr "Surround 6.0"
+
+msgid "Surround 6.1"
+msgstr "Surround 6.1"
+
+msgid "Surround 7.1"
+msgstr "Surround 7.1"
+
+msgid "Pass Through"
+msgstr "Przekaż dźwięk dalej"
+
+msgid "very large"
+msgstr "bardzo duże"
+
+msgid "Software"
+msgstr "Programowo"
+
+msgid "Hardware"
+msgstr "Sprzętowo"
+
+msgid "no"
+msgstr "nie"
+
+msgid "grayscale"
+msgstr "odcień szarości"
+
+msgid "transparent"
+msgstr "przeźroczyste"
+
+msgid "transparent grayscale"
+msgstr "przeźroczyste z odcieniem szarości"
+
+msgid "yes"
+msgstr "tak"
+
+msgid "nearest"
+msgstr "najbliższe"
+
+msgid "bilinear"
+msgstr "dwuliniowe"
+
+msgid "LUT8"
+msgstr "LUT8"
+
+msgid "TrueColor"
+msgstr "TrueColor"
+
+msgid "video stream"
+msgstr "strumień wideo"
+
+msgid "none"
+msgstr "żadne"
+
+msgid "nonref"
+msgstr "bez referencji"
+
+#, fuzzy
+msgid "bidir"
+msgstr "tylko ramki B"
+
+msgid "nonkey"
+msgstr "bez klucza"
+
+msgid "all"
+msgstr "wszystko"
+
+msgid "Frontend initialization failed"
+msgstr "Inicjalizacja klienta nie powiodła się"
+
+msgid "Server initialization failed"
+msgstr "Inicjalizacja serwera nie powiodła się"
+
+msgid "Playlist"
+msgstr "Lista odtwarzania"
+
+msgid "Button$Random"
+msgstr "Losowo"
+
+msgid "Button$Normal"
+msgstr "Standardowe"
+
+msgid "Button$Add files"
+msgstr "Dodaj pliki"
+
+msgid "Button$Remove"
+msgstr "Usuń"
+
+msgid "Button$Mark"
+msgstr "Zaznacz"
+
+msgid "Queued to playlist"
+msgstr "Dodane do listy odtwarzania"
+
+msgid "Random play"
+msgstr "Odtwarzanie losowe"
+
+msgid "Normal play"
+msgstr "Odtwarzanie"
+
+msgid "DVD Menu"
+msgstr "Menu DVD"
+
+msgid "Exit DVD menu"
+msgstr "Wyjdź z menu DVD"
+
+msgid "DVD Root menu"
+msgstr "Menu główne DVD"
+
+msgid "DVD Title menu"
+msgstr "Menu tytułów DVD"
+
+msgid "DVD SPU menu"
+msgstr "Menu SPU DVD"
+
+msgid "DVD Audio menu"
+msgstr "Menu dźwięku DVD"
+
+msgid "Close menu"
+msgstr "Zamknij menu"
+
+msgid "BluRay Top menu"
+msgstr "Menu główne BluRay"
+
+msgid "Toggle Pop-Up menu"
+msgstr "Przełącz na menu Pop-Up"
+
+msgid "Next title"
+msgstr "Następny tytuł"
+
+msgid "Previous title"
+msgstr "Poprzedni tytuł"
+
+msgid "Delete image ?"
+msgstr "Usunąć zdjęcie?"
+
+msgid "Play movie title"
+msgstr "Odtwarzaj film"
+
+msgid "Play disc"
+msgstr "Odtwarzaj dysk"
+
+msgid "Images"
+msgstr "Zdjęcia"
+
+msgid "Play music"
+msgstr "Odtwarzaj muzykę"
+
+msgid "Add to playlist"
+msgstr "Dodaj do listy odtwarzania"
+
+msgid "Play file"
+msgstr "Odtwarzaj plik"
+
+msgid "Button$Queue"
+msgstr "Zakolejkuj"
+
+msgid "Media"
+msgstr "Media"
+
+msgid "View images"
+msgstr "Wyświetlaj zdjęcia"
+
+msgid "Play DVD disc"
+msgstr "Odtwarzaj DVD"
+
+msgid "Play BluRay disc"
+msgstr "Odtwarzaj BluRay"
+
+msgid "Play audio CD"
+msgstr "Odtwarzaj CD"
+
+msgid "Video settings"
+msgstr "Ustawienia obrazu"
+
+msgid "Play only audio"
+msgstr "Odtwarzaj tylko dźwięk"
+
+msgid "Crop letterbox 4:3 to 16:9"
+msgstr "Przytnij letterbox z 4:3 na 16:9"
+
+msgid "Overscan (crop image borders)"
+msgstr "Przycięcie krawędzi obrazu"
+
+msgid "Audio settings"
+msgstr "Ustawienia dźwięku"
+
+msgid "Audio Compression"
+msgstr "Kompresja dźwięku"
+
+msgid "Audio equalizer"
+msgstr "Equalizer dźwięku"
+
+msgid "Local Frontend"
+msgstr "Klienci lokalni"
+
+msgid "Aspect ratio"
+msgstr "Proporcje obrazu"
+
+msgid "Video aspect ratio"
+msgstr "Proporcje obrazu wideo"
+
+msgid "On"
+msgstr "Włączone"
+
+msgid "Deinterlacing"
+msgstr "Usuwanie przeplotu"
+
+msgid "Upmix stereo to 5.1"
+msgstr "Miksuj stereo do 5.1"
+
+msgid "Downmix AC3 to surround"
+msgstr "Miksuj AC3 do Surround"
+
+msgid "Default playlist not found"
+msgstr "Nie odnaleziono standardowej listy odtwarzania"
+
+msgid "Default playlist is not symlink"
+msgstr "Standardowa lista odtwarzania to nie symlink"
+
+msgid "Default playlist not defined"
+msgstr "Nie zdefiniowano standardowej listy odtwarzania"
+
+msgid "Delay"
+msgstr "Opóźnienie"
+
+msgid "ms"
+msgstr "ms"
+
+#, c-format
+msgid "xineliboutput: hotkey %s not binded"
+msgstr "xineliboutput: klawisz %s nie jest przypisany"
+
+msgid "Audio"
+msgstr "Dźwięk"
+
+msgid "Volume control"
+msgstr "Kontrola głośności"
+
+msgid "Mix to headphones"
+msgstr "Przełącz na słuchawki"
+
+msgid "Visualization"
+msgstr "Wizualizacja"
+
+msgid "Width"
+msgstr "Szerokość"
+
+msgid "px"
+msgstr "px"
+
+msgid "Height"
+msgstr "Wysokość"
+
+msgid "Speed"
+msgstr "Prędkość"
+
+msgid "fps"
+msgstr "fps"
+
+msgid "Background image MRL"
+msgstr "MRL obrazu tła"
+
+msgid "Audio Equalizer"
+msgstr "Equalizer dźwięku"
+
+msgid "Use Video-Out Driver"
+msgstr "Użyj wyjścia Video-Out"
+
+msgid "vector"
+msgstr "wektor"
+
+msgid "full"
+msgstr "pełne"
+
+msgid "half (top)"
+msgstr "połowa (góra)"
+
+msgid "half (bottom)"
+msgstr "połowa (dół)"
+
+msgid "Video"
+msgstr "Obraz"
+
+msgid "Use driver crop"
+msgstr "Użyj przycięcia"
+
+msgid "Autodetect letterbox"
+msgstr "Automatyczne wykrywanie Letterbox"
+
+msgid "Crop to"
+msgstr "Przytnij do"
+
+msgid "Autodetect rate"
+msgstr "Wykrywanie szybkości"
+
+msgid "Stabilize time"
+msgstr "Czas stabilizacji"
+
+msgid "Maximum logo width [%]"
+msgstr "Maksymalna szerokość loga [%]"
+
+msgid "Overscan compensate [%1000]"
+msgstr "Wyrównanie powiększenia [%1000]"
+
+msgid "Soft start"
+msgstr "Łagodny start"
+
+msgid "Soft start step"
+msgstr "Łagodny start przy przeskoku"
+
+msgid "Detect subtitles"
+msgstr "Wykryj napisy"
+
+#, fuzzy
+msgid "Subs detect stabilize time"
+msgstr "Czas stabilizacji napisów"
+
+#, fuzzy
+msgid "Subs detect lifetime"
+msgstr "Długość życia napisów"
+
+msgid "Use avards analysis"
+msgstr "Użyj analizy AVARDS"
+
+#, fuzzy
+msgid "Bar tone tolerance"
+msgstr "Tolerowanie kaszet"
+
+msgid "Software scaling"
+msgstr "Skalowanie programowe"
+
+msgid "Change aspect ratio"
+msgstr "Zmień proporcje"
+
+msgid "Change video size"
+msgstr "Zmień rozmiar obrazu"
+
+msgid "Allow downscaling"
+msgstr "Pozwól na zmniejszenie"
+
+msgid "Post processing (ffmpeg)"
+msgstr "Przetwarzanie końcowe (ffmpeg)"
+
+msgid "Quality"
+msgstr "Jakość"
+
+msgid "Mode"
+msgstr "Tryb"
+
+msgid "Method"
+msgstr "Metoda"
+
+msgid "Cheap mode"
+msgstr "Tanie"
+
+msgid "Pulldown"
+msgstr "Przez podział"
+
+msgid "Frame rate"
+msgstr "Zmiana ilości klatek na sekundę"
+
+msgid "Judder Correction"
+msgstr "Korekcja przesunięcia"
+
+msgid "Use progressive frame flag"
+msgstr "Użycie następnej flagi klatki"
+
+msgid "Chroma Filter"
+msgstr "Filter chrominancji"
+
+msgid "Sharpen / Blur"
+msgstr "Wyostrz / Rozmyj"
+
+msgid "Width of the luma matrix"
+msgstr "Szerokość matrycy luma"
+
+msgid "Height of the luma matrix"
+msgstr "Wysokość matrycy luma"
+
+msgid "Amount of luma sharpness/blur"
+msgstr "Suma wyostrzeń/rozmyć lumy"
+
+msgid "Width of the chroma matrix"
+msgstr "Szerokość matrycy chroma"
+
+msgid "Height of the chroma matrix"
+msgstr "Wysokość matrycy chroma"
+
+msgid "Amount of chroma sharpness/blur"
+msgstr "Suma wyostrzeń/rozmyć chromy"
+
+msgid "3D Denoiser"
+msgstr "Odszumiacz 3D"
+
+msgid "Spatial luma strength"
+msgstr "Przestrzenna siła lumy"
+
+msgid "Spatial chroma strength"
+msgstr "Przestrzenna siła chromy"
+
+msgid "Temporal strength"
+msgstr "Siła czasowego"
+
+msgid "HUE"
+msgstr "Ton kolorów"
+
+msgid "Saturation"
+msgstr "Nasycenie"
+
+msgid "Contrast"
+msgstr "Kontrast"
+
+msgid "Brightness"
+msgstr "Jasność"
+
+msgid "Sharpness"
+msgstr "Ostrość"
+
+msgid "Noise Reduction"
+msgstr "Redukcja szumu"
+
+msgid "Smooth fast forward"
+msgstr "Płynne przewijanie do przodu"
+
+#, fuzzy
+msgid "Fastest trick speed"
+msgstr "Prędkość postępu"
+
+msgid "On-Screen Display"
+msgstr "On-Screen Display"
+
+msgid "Hide main menu"
+msgstr "Ukryj pozycję w głównym menu"
+
+msgid "Resolution"
+msgstr "Rozdzielczość"
+
+msgid "Color depth"
+msgstr "Głębia koloru"
+
+msgid "Blending method"
+msgstr "Metoda wygładzania"
+
+msgid "Use hardware for low-res video"
+msgstr "Użyj sprzętu dla obrazu o niskiej jakości"
+
+msgid "Scaling method"
+msgstr "Metoda skalowania"
+
+msgid "Scale subtitles"
+msgstr "Skaluj napisy"
+
+msgid "Show all layers"
+msgstr "Pokaż wszystkie warstwy"
+
+msgid "Dynamic transparency correction"
+msgstr "Dynamiczna korekcja przeźroczystości"
+
+msgid "Static transparency correction"
+msgstr "Statyczna korekcja przeźroczystości"
+
+msgid "External subtitle size"
+msgstr "Rozmiar zewnętrznych napisów"
+
+msgid "DVB subtitle decoder"
+msgstr "Dekoder napisów DVB"
+
+msgid "Decoder"
+msgstr "Dekoder"
+
+msgid "Buffer size"
+msgstr "Rozmiar bufora"
+
+msgid "Number of PES packets"
+msgstr "Liczba pakietów PES"
+
+msgid "Local Display Frontend"
+msgstr "Lokalny klient emisji"
+
+msgid "Use keyboard"
+msgstr "Używaj klawiatury"
+
+msgid "Driver"
+msgstr "Sterownik"
+
+msgid "Display address"
+msgstr "Adres wyświetlacza"
+
+msgid "Framebuffer device"
+msgstr "Urządzenie Framebuffer"
+
+msgid "Fullscreen mode"
+msgstr "Pełny ekran"
+
+msgid "Window width"
+msgstr "Szerokość okna"
+
+msgid "Window height"
+msgstr "Wysokość okna"
+
+msgid "Window aspect"
+msgstr "Proporcje okna"
+
+msgid "Scale to window size"
+msgstr "Skaluj do rozmiaru okna"
+
+msgid "Port"
+msgstr "Port"
+
+msgid "Speakers"
+msgstr "Głośniki"
+
+msgid "Remote Clients"
+msgstr "Zdalni klienci"
+
+msgid "Allow remote clients"
+msgstr "Zezwól na zdalnych klientów"
+
+msgid "Listen port (TCP and broadcast)"
+msgstr "Port nasłuchu (TCP i rozgłaszanie)"
+
+msgid "Listen address"
+msgstr "Adres nasłuchiwania"
+
+msgid "Remote keyboard"
+msgstr "Zdalna klawiatura"
+
+msgid "Max number of clients"
+msgstr "Maksymalna liczba klientów"
+
+msgid "PIPE transport"
+msgstr "Transport PIPE"
+
+msgid "TCP transport"
+msgstr "Transport TCP"
+
+msgid "UDP transport"
+msgstr "Transport UDP"
+
+msgid "RTP (multicast) transport"
+msgstr "Transport RTP (multicast)"
+
+msgid "Address"
+msgstr "Adres (multicast)"
+
+msgid "TTL"
+msgstr "TTL (multicast)"
+
+msgid "Transmit always on"
+msgstr "Ciągła transmisja"
+
+msgid "SAP announcements"
+msgstr "Obwieszczenie SAP"
+
+msgid "Server announce broadcasts"
+msgstr "Serwer obwieszcza nadawanie"
+
+msgid "HTTP transport for media files"
+msgstr "Transport HTTP dla multimediów"
+
+msgid "Additional network services"
+msgstr "Dodatkowe serwisy sieciowe"
+
+msgid "HTTP server"
+msgstr "Serwer HTTP"
+
+msgid "HTTP clients can control VDR"
+msgstr "Klienci HTTP mogą kontrolować VDR"
+
+msgid "RTSP server"
+msgstr "Serwer RTSP"
+
+msgid "RTSP clients can control VDR"
+msgstr "Klienci RTSP mogą kontrolować VDR"
+
+msgid "Playlist settings"
+msgstr "Ustawienia listy odtwarzania"
+
+msgid "Show the track number"
+msgstr "Pokaż numer ścieżki"
+
+msgid "Show the name of the artist"
+msgstr "Pokaż nazwę artysty"
+
+msgid "Show the name of the album"
+msgstr "Pokaż nazwę albumu"
+
+msgid "Scan for metainfo"
+msgstr "Skanuj informacje meta"
+
+msgid "Cache metainfo"
+msgstr "Buforuj informacje meta"
+
+msgid "Arrow keys control DVD playback"
+msgstr "Strzałki kontrolują odtwarzanie DVD"
+
+msgid "Show hidden files"
+msgstr "Pokazuj ukryte pliki"
+
+msgid "Allow removing files"
+msgstr "Pozwól na usuwanie plików"
+
+msgid "Remember last playback position"
+msgstr "Pamiętaj miejsce zatrzymania odtwarzania"
+
+msgid "Media Player"
+msgstr "Odtwarzacz multimediów"
+
+msgid "Grayscale"
+msgstr "Odcień szarości"
+
+msgid "Bitmap"
+msgstr "Bitmapa"
+
+msgid "OSD"
+msgstr "OSD"
+
+msgid "Test Images"
+msgstr "Obrazy testowe"
+
+msgid "X11/xine-lib output plugin"
+msgstr "Emisja poprzez X11/xine-lib"
+
+#~ msgid "normal"
+#~ msgstr "Normalne"
+
+#~ msgid "inverted"
+#~ msgstr "Przestawny"
+
+#~ msgid "Interlaced Field Order"
+#~ msgstr "Interlaced Halbbild-Reihenfolge"
+
+#~ msgid "Button$Sort"
+#~ msgstr "Sortuj"
+
+#~ msgid "Play file >>"
+#~ msgstr "Odtwarzaj plik >>"
+
+#~ msgid "Play music >>"
+#~ msgstr "Odtwarzaj muzykę >>"
+
+#~ msgid "View images >>"
+#~ msgstr "Wyświetlaj zdjęcia >>"
+
+#~ msgid "Play DVD disc >>"
+#~ msgstr "Odtwarzaj DVD >>"
+
+#~ msgid "Play audio CD >>"
+#~ msgstr "Odtwarzaj CD >>"
+
+#~ msgid "Play BluRay disc >>"
+#~ msgstr "Odtwarzaj BluRay >>"
+
+#~ msgid "Play remote DVD >>"
+#~ msgstr "Odtwarzaj zdalnie DVD >>"
+
+#~ msgid "Play remote CD >>"
+#~ msgstr "Odtwarzaj CD >>"
+
+#~ msgid "Audio equalizer >>"
+#~ msgstr "Equalizer dźwięku >>"
diff --git a/po/ru_RU.po b/po/ru_RU.po
index 410ff49..e07feec 100644
--- a/po/ru_RU.po
+++ b/po/ru_RU.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: Xineliboutput 1.1.0\n"
 "Report-Msgid-Bugs-To: <phintuka at users.sourceforge.net>\n"
-"POT-Creation-Date: 2012-03-13 13:13+0200\n"
+"POT-Creation-Date: 2013-10-29 10:29+0200\n"
 "PO-Revision-Date: 2007-11-23 10:17+0200\n"
 "Last-Translator: Vladimir Monchenko\n"
 "Language-Team: Russian <vdr at linuxtv.org>\n"
@@ -707,6 +707,9 @@ msgstr ""
 msgid "Allow removing files"
 msgstr ""
 
+msgid "Remember last playback position"
+msgstr ""
+
 msgid "Media Player"
 msgstr "Xine-lib"
 
diff --git a/po/cs_CZ.po b/po/sk_SK.po
similarity index 56%
copy from po/cs_CZ.po
copy to po/sk_SK.po
index 7df54fe..d9a5083 100644
--- a/po/cs_CZ.po
+++ b/po/sk_SK.po
@@ -6,58 +6,57 @@ msgid ""
 msgstr ""
 "Project-Id-Version: Xineliboutput 1.1.0\n"
 "Report-Msgid-Bugs-To: <phintuka at users.sourceforge.net>\n"
-"POT-Creation-Date: 2012-03-13 13:13+0200\n"
-"PO-Revision-Date: 2008-03-20 23:57+0100\n"
-"Last-Translator: Maya <maja373 at gmail.com>\n"
-"Language-Team: Czech <vdr at linuxtv.org>\n"
-"Language: cs\n"
+"POT-Creation-Date: 2013-10-29 10:29+0200\n"
+"PO-Revision-Date: 2014-02-05 11:12+0100\n"
+"Last-Translator: Milan Hrala <hrala.milan at gmail.com>\n"
+"Language-Team: Slovak <vdr at linuxtv.org>\n"
+"Language: sk\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"X-Poedit-Language: Czech\n"
-"X-Poedit-Country: CZECH REPUBLIC\n"
+"X-Generator: Poedit 1.5.4\n"
 
 msgid "custom"
-msgstr "uživatelský"
+msgstr "užívateľské"
 
 msgid "tiny"
-msgstr "nejmenší"
+msgstr "najmenší"
 
 msgid "small"
 msgstr "malý"
 
 msgid "medium"
-msgstr "střední"
+msgstr "stredný"
 
 msgid "large"
-msgstr "velký"
+msgstr "veľký"
 
 msgid "huge"
-msgstr "největší"
+msgstr "najväčší"
 
 msgid "automatic"
 msgstr "automaticky"
 
 msgid "default"
-msgstr "výchozí"
+msgstr "predvolený"
 
 msgid "Pan&Scan"
 msgstr "Pan&Scan"
 
 msgid "CenterCutOut"
-msgstr ""
+msgstr "CenterCutOut"
 
 msgid "square"
-msgstr "čtvercový"
+msgstr "do štvorca"
 
 msgid "anamorphic"
-msgstr "anamorfní"
+msgstr "neforemne"
 
 msgid "DVB"
 msgstr "DVB"
 
 msgid "off"
-msgstr "vypnuto"
+msgstr "vypnuté"
 
 msgid "no audio"
 msgstr "bez zvuku"
@@ -66,10 +65,10 @@ msgid "no video"
 msgstr "bez obrazu"
 
 msgid "Off"
-msgstr "vypnuto"
+msgstr "Vypnuté"
 
 msgid "Goom"
-msgstr "Soutěska"
+msgstr "Goom"
 
 msgid "Oscilloscope"
 msgstr "Osciloskop"
@@ -81,7 +80,7 @@ msgid "FFT Graph"
 msgstr "FFT graf"
 
 msgid "Image"
-msgstr ""
+msgstr "Obrázok"
 
 msgid "Mono 1.0"
 msgstr "Mono 1.0"
@@ -120,332 +119,332 @@ msgid "Surround 7.1"
 msgstr "Surround 7.1"
 
 msgid "Pass Through"
-msgstr "Průchozí"
+msgstr "Pass Through"
 
 msgid "very large"
-msgstr "velmi velký"
+msgstr "veľmi veľký"
 
 msgid "Software"
-msgstr "softwarové"
+msgstr "Softwarové"
 
 msgid "Hardware"
-msgstr "hardwarové"
+msgstr "Hardwarové"
 
 msgid "no"
-msgstr "ne"
+msgstr "nie"
 
 msgid "grayscale"
-msgstr "odstíny šedi"
+msgstr "odtiene šedej"
 
 msgid "transparent"
-msgstr "průhledný"
+msgstr "priehľadný"
 
 msgid "transparent grayscale"
-msgstr ""
+msgstr "transparentné odtiene šedej"
 
 msgid "yes"
-msgstr "ano"
+msgstr "áno"
 
 msgid "nearest"
-msgstr ""
+msgstr "najbližší"
 
 msgid "bilinear"
-msgstr ""
+msgstr "bi-lineárne"
 
 msgid "LUT8"
-msgstr ""
+msgstr "LUT8"
 
 msgid "TrueColor"
-msgstr ""
+msgstr "Plná farebnosť"
 
 msgid "video stream"
-msgstr ""
+msgstr "ako video-obraz"
 
 msgid "none"
-msgstr ""
+msgstr "žiadny"
 
 msgid "nonref"
-msgstr ""
+msgstr "bez referencií"
 
 msgid "bidir"
-msgstr ""
+msgstr "iba B-snímky"
 
 msgid "nonkey"
-msgstr ""
+msgstr "žiadne kľúčové snímky"
 
 msgid "all"
-msgstr ""
+msgstr "všetko"
 
 msgid "Frontend initialization failed"
-msgstr "Inicializace rozhraní selhala"
+msgstr "Inicializácia rozhrania zlyhala"
 
 msgid "Server initialization failed"
-msgstr "Inicializace serveru selhala"
+msgstr "Inicializácia serveru zlyhala"
 
 msgid "Playlist"
-msgstr "Seznam stop"
+msgstr "Zoznam stôp"
 
 msgid "Button$Random"
 msgstr "Náhodné"
 
 msgid "Button$Normal"
-msgstr "Normální"
+msgstr "Normálne"
 
 msgid "Button$Add files"
-msgstr "Přidat soubory"
+msgstr "Pridať súbory"
 
 msgid "Button$Remove"
-msgstr "Odstranit"
+msgstr "Odstrániť"
 
 msgid "Button$Mark"
-msgstr ""
+msgstr "Značka"
 
 msgid "Queued to playlist"
-msgstr "Přidáno do seznamu stop"
+msgstr "Pridaný do zoznamu skladieb"
 
 msgid "Random play"
-msgstr "Náhodné přehrávání"
+msgstr "Náhodné prehrávanie"
 
 msgid "Normal play"
-msgstr "Normální přehrávání"
+msgstr "Normálne prehrávanie"
 
 msgid "DVD Menu"
-msgstr ""
+msgstr "DVD Menu"
 
 msgid "Exit DVD menu"
-msgstr ""
+msgstr "Opustiť DVD menu"
 
 msgid "DVD Root menu"
-msgstr ""
+msgstr "Hlavné DVD menu"
 
 msgid "DVD Title menu"
-msgstr ""
+msgstr "DVD menu titulov"
 
 msgid "DVD SPU menu"
-msgstr ""
+msgstr "DVD SPU menu"
 
 msgid "DVD Audio menu"
-msgstr ""
+msgstr "Zvukové menu DVD"
 
 msgid "Close menu"
-msgstr ""
+msgstr "Zavrieť menu"
 
 msgid "BluRay Top menu"
-msgstr ""
+msgstr "BluRay hlavné menu"
 
 msgid "Toggle Pop-Up menu"
-msgstr ""
+msgstr "Prepínač kontextového menu"
 
 msgid "Next title"
-msgstr ""
+msgstr "Ďalší titul"
 
 msgid "Previous title"
-msgstr ""
+msgstr "Predchádzajúci titul"
 
 msgid "Delete image ?"
-msgstr "Smazat obrázek ?"
+msgstr "Zmazať obrázok ?"
 
 msgid "Play movie title"
-msgstr ""
+msgstr "Prehrať titul filmu"
 
 msgid "Play disc"
-msgstr ""
+msgstr "Prehrať disk"
 
 msgid "Images"
 msgstr "Obrázky"
 
 msgid "Play music"
-msgstr "Přehrát hudbu"
+msgstr "Prehrať hudbu"
 
 msgid "Add to playlist"
-msgstr "Přidat do seznamu stop"
+msgstr "Pridať do zoznamu stôp"
 
 msgid "Play file"
-msgstr "Přehrát soubor"
+msgstr "Prehrať súbor"
 
 msgid "Button$Queue"
-msgstr "Fronta"
+msgstr "Zoznam"
 
 msgid "Media"
 msgstr "Média"
 
 msgid "View images"
-msgstr "Prohlížet obrázky"
+msgstr "Prehliadať obrázky"
 
 msgid "Play DVD disc"
-msgstr "Přehrát DVD"
+msgstr "Prehrať DVD"
 
 msgid "Play BluRay disc"
-msgstr "Přehrát BluRay"
+msgstr "Prehrať BluRay"
 
 msgid "Play audio CD"
-msgstr "Přehrát zvukové CD"
+msgstr "Prehrať zvukové CD"
 
 msgid "Video settings"
-msgstr "Nastavení obrazu"
+msgstr "Nastavenie obrazu"
 
 msgid "Play only audio"
-msgstr "Přehrávat pouze zvuk"
+msgstr "Prehrávať iba zvuk"
 
 msgid "Crop letterbox 4:3 to 16:9"
-msgstr "Oříznout letterbox 4:3 na 16:9"
+msgstr "Orezať letterbox 4:3 na 16:9"
 
 msgid "Overscan (crop image borders)"
-msgstr "Overscan (ořez okrajů obrazu)"
+msgstr "Overscan (orezať okraje obrazu)"
 
 msgid "Audio settings"
-msgstr "Nastavení zvuku"
+msgstr "Nastavenie zvuku"
 
 msgid "Audio Compression"
-msgstr ""
+msgstr "Kompresia zvuku"
 
 msgid "Audio equalizer"
-msgstr "Korekce zvuku (ekvalizér)"
+msgstr "Korekcia zvuku (ekvalizér)"
 
 msgid "Local Frontend"
-msgstr "Lokální rozhraní"
+msgstr "Lokálne rozhranie"
 
 msgid "Aspect ratio"
-msgstr "Poměr stran"
+msgstr "Pomer strán"
 
 msgid "Video aspect ratio"
-msgstr "Poměr stran obrazu"
+msgstr "Pomer strán obrazu"
 
 msgid "On"
-msgstr "zapnuto"
+msgstr "Zapnuté"
 
 msgid "Deinterlacing"
-msgstr "Odstranění prokládání"
+msgstr "Odstraňovanie prekladania"
 
 msgid "Upmix stereo to 5.1"
-msgstr "Převzorkovat stereo na 5.1"
+msgstr "Prevzorkovať stereo na 5.1"
 
 msgid "Downmix AC3 to surround"
-msgstr "Převzorkovat AC3 na surround"
+msgstr "Prevzorkovať AC3 na surround"
 
 msgid "Default playlist not found"
-msgstr "Výchozí seznam stop nenalezen"
+msgstr "Východzí zoznam stôp sa nenašiel"
 
 msgid "Default playlist is not symlink"
-msgstr "Výchozí seznam stop není symbolický odkaz"
+msgstr "Predvolený zoznam stôp nie je symbolický odkaz"
 
 msgid "Default playlist not defined"
-msgstr "Výchozí seznam stop není definován"
+msgstr "Predvolený zoznam stôp nie je určený"
 
 msgid "Delay"
-msgstr "Zpoždění"
+msgstr "Omeškanie"
 
 msgid "ms"
 msgstr "ms"
 
 #, c-format
 msgid "xineliboutput: hotkey %s not binded"
-msgstr "xineliboutput:  horká klávesa %s není přiřazena"
+msgstr "xineliboutput:  klávesová skratka %s nie je priradená"
 
 msgid "Audio"
 msgstr "Zvuk"
 
 msgid "Volume control"
-msgstr "Ovládání hlasitosti"
+msgstr "Ovládanie hlasitosti"
 
 msgid "Mix to headphones"
-msgstr ""
+msgstr "Miešať zvuk pre slúchadlá"
 
 msgid "Visualization"
-msgstr "Vizualizace"
+msgstr "Vizualizácia"
 
 msgid "Width"
-msgstr "Šířka"
+msgstr "Šírka"
 
 msgid "px"
-msgstr "bodů"
+msgstr "bodov"
 
 msgid "Height"
 msgstr "Výška"
 
 msgid "Speed"
-msgstr "Rychlost"
+msgstr "Rýchlosť"
 
 msgid "fps"
-msgstr "snímků/sek."
+msgstr "snímkov/sek."
 
 msgid "Background image MRL"
-msgstr ""
+msgstr "Obrázok na pozadí MRL"
 
 msgid "Audio Equalizer"
-msgstr "Korekce zvuku"
+msgstr "Zvukový equalizér"
 
 msgid "Use Video-Out Driver"
-msgstr ""
+msgstr "Použiť video-výstupný ovládač"
 
 msgid "vector"
-msgstr ""
+msgstr "vektor"
 
 msgid "full"
-msgstr ""
+msgstr "plný"
 
 msgid "half (top)"
-msgstr ""
+msgstr "polovičný (na vrchu)"
 
 msgid "half (bottom)"
-msgstr ""
+msgstr "polovičný (na spodku)"
 
 msgid "Video"
 msgstr "Obraz"
 
 msgid "Use driver crop"
-msgstr ""
+msgstr "Použiť ovládač orezania"
 
 msgid "Autodetect letterbox"
-msgstr "Automaticky detekovat letterbox"
+msgstr "Automaticky identifikovať letterbox"
 
 msgid "Crop to"
-msgstr "Oříznout na"
+msgstr "Orezať na"
 
 msgid "Autodetect rate"
-msgstr ""
+msgstr "Detekčná rýchlosť"
 
 msgid "Stabilize time"
-msgstr ""
+msgstr "Stabilizovať čas"
 
 msgid "Maximum logo width [%]"
-msgstr ""
+msgstr "Maximálna šírka loga [%]"
 
 msgid "Overscan compensate [%1000]"
-msgstr ""
+msgstr "Kompenzácia prevzorkovania [%1000]"
 
 msgid "Soft start"
-msgstr "Postupné zvětšení"
+msgstr "Progresívne spustenie"
 
 msgid "Soft start step"
-msgstr ""
+msgstr "Krok progresívneho spustenia"
 
 msgid "Detect subtitles"
-msgstr "Detekovat titulky"
+msgstr "Zisťovať titulky"
 
 msgid "Subs detect stabilize time"
-msgstr ""
+msgstr "Stabilizačný čas odhalenia"
 
 msgid "Subs detect lifetime"
-msgstr ""
+msgstr "Životnosť odhalenia"
 
 msgid "Use avards analysis"
-msgstr ""
+msgstr "Pomocou analýzy Avards"
 
 msgid "Bar tone tolerance"
-msgstr ""
+msgstr "Tolerancia ladenia odtieňa"
 
 msgid "Software scaling"
-msgstr "Softwarové škálování"
+msgstr "Softvérová zmena obrazu"
 
 msgid "Change aspect ratio"
-msgstr "Změna poměru stran obrazu"
+msgstr "Zmena pomeru strán obrazu"
 
 msgid "Change video size"
-msgstr "Změnit velikost obrazu"
+msgstr "Zmeniť veľkosť obrazu"
 
 msgid "Allow downscaling"
-msgstr "Povolit zmenšení"
+msgstr "Povoliť zmenšiť"
 
 msgid "Post processing (ffmpeg)"
 msgstr "Post processing (ffmpeg)"
@@ -457,64 +456,64 @@ msgid "Mode"
 msgstr "Mód"
 
 msgid "Method"
-msgstr "Metoda"
+msgstr "Metóda"
 
 msgid "Cheap mode"
 msgstr "Zjednodušený mód"
 
 msgid "Pulldown"
-msgstr ""
+msgstr "Pulldown"
 
 msgid "Frame rate"
-msgstr "Snímková rychlost"
+msgstr "Snímková rýchlosť"
 
 msgid "Judder Correction"
-msgstr "Korekce chvění"
+msgstr "Korekcia chvenia"
 
 msgid "Use progressive frame flag"
-msgstr ""
+msgstr "Použiť progresívny obraz"
 
 msgid "Chroma Filter"
-msgstr ""
+msgstr "Filter farebnosti"
 
 msgid "Sharpen / Blur"
-msgstr "Zaostření / rozmazání"
+msgstr "Zaostrenie / rozmazanie"
 
 msgid "Width of the luma matrix"
-msgstr ""
+msgstr "Šírka matice jasu"
 
 msgid "Height of the luma matrix"
-msgstr ""
+msgstr "Výška matice jasu"
 
 msgid "Amount of luma sharpness/blur"
-msgstr ""
+msgstr "Množstvo jasu zaostriť/rozmazať"
 
 msgid "Width of the chroma matrix"
-msgstr ""
+msgstr "Šírka matice farebnosti"
 
 msgid "Height of the chroma matrix"
-msgstr ""
+msgstr "Výška matice farebnosti"
 
 msgid "Amount of chroma sharpness/blur"
-msgstr ""
+msgstr "Množstvo farebnosti zaostriť/rozmazať"
 
 msgid "3D Denoiser"
-msgstr "3D odstranění šumu"
+msgstr "3D redukcia šumu"
 
 msgid "Spatial luma strength"
-msgstr ""
+msgstr "Priestorová intenzita jasu"
 
 msgid "Spatial chroma strength"
-msgstr ""
+msgstr "Dispozičná farebná pestrosť"
 
 msgid "Temporal strength"
-msgstr ""
+msgstr "Časová náročnosť"
 
 msgid "HUE"
-msgstr ""
+msgstr "Odtieň"
 
 msgid "Saturation"
-msgstr ""
+msgstr "Sýtosť farby"
 
 msgid "Contrast"
 msgstr "Kontrast"
@@ -523,94 +522,94 @@ msgid "Brightness"
 msgstr "Jas"
 
 msgid "Sharpness"
-msgstr ""
+msgstr "Ostrosť"
 
 msgid "Noise Reduction"
-msgstr ""
+msgstr "Redukcia šumu"
 
 msgid "Smooth fast forward"
-msgstr "Plynulé přetáčení"
+msgstr "Plynulé pretáčanie"
 
 msgid "Fastest trick speed"
-msgstr ""
+msgstr "Rýchlejší trik"
 
 msgid "On-Screen Display"
 msgstr "Obrazovkové menu"
 
 msgid "Hide main menu"
-msgstr "Nezobrazovat v hlavním menu"
+msgstr "Nezobrazovať v hlavnom menu"
 
 msgid "Resolution"
-msgstr ""
+msgstr "Rozlíšenie"
 
 msgid "Color depth"
-msgstr ""
+msgstr "Farebná hĺbka"
 
 msgid "Blending method"
-msgstr ""
+msgstr "Spôsob miešania"
 
 msgid "Use hardware for low-res video"
-msgstr ""
+msgstr "Použite hardware pre malé rozlíšenie videa"
 
 msgid "Scaling method"
-msgstr ""
+msgstr "Spôsob úpravy mierky"
 
 msgid "Scale subtitles"
-msgstr ""
+msgstr "Zväčšiť titulky"
 
 msgid "Show all layers"
-msgstr "Zobrazit všechny vrstvy"
+msgstr "Zobraziť všetky vrstvy"
 
 msgid "Dynamic transparency correction"
-msgstr "Úprava dynamické průhlednosti"
+msgstr "Úprava dynamické priehľadnosti"
 
 msgid "Static transparency correction"
-msgstr "Úprava statické průhlednosti"
+msgstr "Úprava statické priehľadnosti"
 
 msgid "External subtitle size"
-msgstr "Velikost externích titulků"
+msgstr "Veľkosť externých titulkov"
 
 msgid "DVB subtitle decoder"
-msgstr ""
+msgstr "Použitý dekóder titulok"
 
 msgid "Decoder"
 msgstr "Dekodér"
 
 msgid "Buffer size"
-msgstr "Velikost vyrovnávací paměti"
+msgstr "Veľkosť vyrovnávacej pamäte"
 
 msgid "Number of PES packets"
-msgstr "Počet PES paketů"
+msgstr "Počet PES paketov"
 
 msgid "Local Display Frontend"
-msgstr "Lokální zobrazovací rozhraní"
+msgstr "Lokálne zobrazovacie rozhranie"
 
 msgid "Use keyboard"
-msgstr "Používat klávesnici"
+msgstr "Používať klávesnicu"
 
 msgid "Driver"
-msgstr "Ovladač"
+msgstr "Ovládač"
 
 msgid "Display address"
-msgstr ""
+msgstr "Adresa obrazovky"
 
 msgid "Framebuffer device"
-msgstr ""
+msgstr "Framebuffer zariadenie"
 
 msgid "Fullscreen mode"
-msgstr "Celoobrazovkový režim"
+msgstr "Celo obrazovkový režim"
 
 msgid "Window width"
-msgstr "Šířka okna"
+msgstr "Šírka okna"
 
 msgid "Window height"
 msgstr "Výška okna"
 
 msgid "Window aspect"
-msgstr "Poměr stran okna"
+msgstr "Pomer strán okna"
 
 msgid "Scale to window size"
-msgstr "Škálovat do velikosti okna"
+msgstr "Škálovať do velikosti okna"
 
 msgid "Port"
 msgstr "Port"
@@ -619,22 +618,22 @@ msgid "Speakers"
 msgstr "Reproduktory"
 
 msgid "Remote Clients"
-msgstr "Vzdálení klienti"
+msgstr "Vzdialení klienti"
 
 msgid "Allow remote clients"
-msgstr "Povolit vzdálené klienty"
+msgstr "Povoliť vzdialených klientov"
 
 msgid "Listen port (TCP and broadcast)"
-msgstr ""
+msgstr "Počúvať port (TCP a vysielanie)"
 
 msgid "Listen address"
-msgstr ""
+msgstr "Počúvať adresu"
 
 msgid "Remote keyboard"
-msgstr ""
+msgstr "Vzdialená klávesnica"
 
 msgid "Max number of clients"
-msgstr ""
+msgstr "Max počet klientov"
 
 msgid "PIPE transport"
 msgstr "PIPE transport"
@@ -652,67 +651,70 @@ msgid "Address"
 msgstr "Adresa"
 
 msgid "TTL"
-msgstr ""
+msgstr "TTL"
 
 msgid "Transmit always on"
-msgstr "Přenos stále zapnut"
+msgstr "Prenos vždy zapnutý"
 
 msgid "SAP announcements"
-msgstr ""
+msgstr "SAP oznámenia"
 
 msgid "Server announce broadcasts"
-msgstr ""
+msgstr "Server oznamuje vysielanie"
 
 msgid "HTTP transport for media files"
-msgstr "HTTP transport pro média"
+msgstr "HTTP transport pre média"
 
 msgid "Additional network services"
-msgstr "Další síťové služby"
+msgstr "Ďalšie sieťové služby"
 
 msgid "HTTP server"
 msgstr "HTTP server"
 
 msgid "HTTP clients can control VDR"
-msgstr "HTTP klienti mohou ovládat VDR"
+msgstr "HTTP klienti môžu ovládať VDR"
 
 msgid "RTSP server"
 msgstr "RTSP server"
 
 msgid "RTSP clients can control VDR"
-msgstr "RTSP klienti mohou ovládat VDR"
+msgstr "RTSP klienti môžu ovládať VDR"
 
 msgid "Playlist settings"
-msgstr "Nastavení seznamu stop"
+msgstr "Nastavenie zoznamu stop"
 
 msgid "Show the track number"
-msgstr "Zobrazovat číslo stopy"
+msgstr "Zobrazovať číslo stopy"
 
 msgid "Show the name of the artist"
-msgstr "Zobrazovat jméno autora"
+msgstr "Zobrazovať meno autora"
 
 msgid "Show the name of the album"
-msgstr "Zobrazovat název alba"
+msgstr "Zobrazovať názov albumu"
 
 msgid "Scan for metainfo"
-msgstr "Vyhledávat metainfo"
+msgstr "Vyhľadávať metainfo"
 
 msgid "Cache metainfo"
-msgstr "Uchovávat metainfo"
+msgstr "Uchovávať metainfo"
 
 msgid "Arrow keys control DVD playback"
-msgstr ""
+msgstr "Šipkami ovládať prehrávanie DVD"
 
 msgid "Show hidden files"
-msgstr ""
+msgstr "Zobraziť skryté súbory"
 
 msgid "Allow removing files"
-msgstr ""
+msgstr "Povoliť zmazať súbory"
+
+msgid "Remember last playback position"
+msgstr "Pamätať si poslednú pozíciu prehrávania"
 
 msgid "Media Player"
-msgstr "Přehrávač médií"
+msgstr "Prehrávač médií"
 
 msgid "Grayscale"
-msgstr "Odstíny šedi"
+msgstr "Odtiene šedej"
 
 msgid "Bitmap"
 msgstr "Rastr"
@@ -721,10 +723,10 @@ msgid "OSD"
 msgstr "OSD"
 
 msgid "Test Images"
-msgstr "Zkušební obrazce"
+msgstr "Skúšobné obrazce"
 
 msgid "X11/xine-lib output plugin"
-msgstr "X11/xine-lib výstupní plugin"
+msgstr "X11/xine-lib výstupný modul"
 
 #~ msgid "normal"
 #~ msgstr "normální"
diff --git a/po/uk_UA.po b/po/uk_UA.po
index 2129608..11f6c79 100644
--- a/po/uk_UA.po
+++ b/po/uk_UA.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: Xineliboutput 1.1.0\n"
 "Report-Msgid-Bugs-To: <phintuka at users.sourceforge.net>\n"
-"POT-Creation-Date: 2012-12-12 12:39+0200\n"
+"POT-Creation-Date: 2013-10-29 10:29+0200\n"
 "PO-Revision-Date: 2012-11-29 13:34+0100\n"
 "Last-Translator: Yarema aka Knedlyk <yupadmin at gmail.com>\n"
 "Language-Team: Ukrainian <vdr at linuxtv.org>\n"
@@ -708,6 +708,9 @@ msgstr "Показати приховані файли"
 msgid "Allow removing files"
 msgstr "Дозволяти вилучати файли"
 
+msgid "Remember last playback position"
+msgstr ""
+
 msgid "Media Player"
 msgstr "Програвач медіа"
 
diff --git a/po/zh_CN.po b/po/zh_CN.po
index 6fb6420..32d95d3 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: Xineliboutput 1.1.0\n"
 "Report-Msgid-Bugs-To: <phintuka at users.sourceforge.net>\n"
-"POT-Creation-Date: 2012-03-13 13:13+0200\n"
+"POT-Creation-Date: 2013-10-29 10:29+0200\n"
 "PO-Revision-Date: 2009-09-21 23:32+0800\n"
 "Last-Translator: NanFeng <nfgx at 21cn.com>\n"
 "Language-Team: Chinese (simplified) <vdr at linuxtv.org>\n"
@@ -707,6 +707,9 @@ msgstr ""
 msgid "Allow removing files"
 msgstr ""
 
+msgid "Remember last playback position"
+msgstr ""
+
 msgid "Media Player"
 msgstr "媒体播放器"
 
diff --git a/po/zh_TW.po b/po/zh_TW.po
index da8f998..06be7d7 100644
--- a/po/zh_TW.po
+++ b/po/zh_TW.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: Xineliboutput 1.1.0\n"
 "Report-Msgid-Bugs-To: <phintuka at users.sourceforge.net>\n"
-"POT-Creation-Date: 2012-03-13 13:13+0200\n"
+"POT-Creation-Date: 2013-10-29 10:29+0200\n"
 "PO-Revision-Date: 2009-09-21 23:32+0800\n"
 "Last-Translator: NanFeng <nfgx at 21cn.com>\n"
 "Language-Team: Chinese (traditional) <vdr at linuxtv.org>\n"
@@ -752,6 +752,9 @@ msgstr ""
 msgid "Allow removing files"
 msgstr ""
 
+msgid "Remember last playback position"
+msgstr ""
+
 msgid "Media Player"
 msgstr "媒體播放器"
 
diff --git a/setup_menu.c b/setup_menu.c
index 716b3bb..84c56d1 100644
--- a/setup_menu.c
+++ b/setup_menu.c
@@ -4,7 +4,7 @@
  * See the main source file 'xineliboutput.c' for copyright information and
  * how to reach the author.
  *
- * $Id: setup_menu.c,v 1.88 2012/03/19 09:53:14 phintuka Exp $
+ * $Id: setup_menu.c,v 1.89 2013/10/28 09:14:47 phintuka Exp $
  *
  */
 
@@ -1761,6 +1761,8 @@ void cMenuSetupMediaPlayer::Set(void)
                             &newconfig.show_hidden_files));
   Add(new cMenuEditBoolItem(tr("Allow removing files"),
                             &newconfig.media_enable_delete));
+  Add(new cMenuEditBoolItem(tr("Remember last playback position"),
+                            &newconfig.media_enable_resume));
 
   Add(SeparatorItem(tr("Media Player")));
   Add(new cMenuEditBitItem(tr("Play file"),        &newconfig.media_menu_items, MEDIA_MENU_FILES));
@@ -1796,6 +1798,7 @@ void cMenuSetupMediaPlayer::Store(void)
   SetupStore("Media.MenuItems", xc.media_menu_items);
   SetupStore("Media.ShowHiddenFiles", xc.show_hidden_files);
   SetupStore("Media.EnableDelete", xc.media_enable_delete);
+  SetupStore("Media.EnableResume", xc.media_enable_resume);
 
   Setup.Save();
 }
diff --git a/tools/gnome_screensaver.c b/tools/gnome_screensaver.c
index 8168510..e57609b 100644
--- a/tools/gnome_screensaver.c
+++ b/tools/gnome_screensaver.c
@@ -159,7 +159,11 @@ void gnome_screensaver_control(int enable)
   DBusGProxy *proxy;
   gboolean ret;
 
+#ifdef GLIB_CHECK_VERSION
+#if !GLIB_CHECK_VERSION(2,35,0)
   g_type_init();
+#endif
+#endif
 
 #ifdef HAVE_MCE_DBUS_NAMES
   error = NULL;
diff --git a/xine_osd_command.h b/tools/osd_command.h
similarity index 93%
rename from xine_osd_command.h
rename to tools/osd_command.h
index 1c8d1ee..5dffda6 100644
--- a/xine_osd_command.h
+++ b/tools/osd_command.h
@@ -4,7 +4,7 @@
  * See the main source file 'xineliboutput.c' for copyright information and
  * how to reach the author.
  *
- * $Id: xine_osd_command.h,v 1.17 2011/03/05 13:52:43 phintuka Exp $
+ * $Id: osd_command.h,v 1.1 2014/06/23 12:20:28 phintuka Exp $
  *
  */
 
@@ -47,7 +47,7 @@ typedef enum  {
 
 #define OSDFLAG_TOP_LAYER       0x10 /* window is part of top layer OSD */
 
-typedef struct xine_clut_s {
+typedef struct osd_clut_s {
   union {
     uint8_t cb  /*: 8*/;
     uint8_t g;
@@ -61,12 +61,12 @@ typedef struct xine_clut_s {
     uint8_t r;
   };
   uint8_t alpha /*: 8*/;
-} PACKED xine_clut_t; /* from xine, alphablend.h */
+} PACKED osd_clut_t; /* from xine, alphablend.h */
 
-typedef struct xine_rle_elem_s {
+typedef struct osd_rle_elem_s {
   uint16_t len;
   uint16_t color;
-} PACKED xine_rle_elem_t; /* from xine */
+} PACKED osd_rle_elem_t; /* from xine */
 
 typedef struct osd_rect_s {
   uint16_t x1;
@@ -94,13 +94,13 @@ typedef struct osd_command_s {
   uint32_t datalen;   /* size of image data, in bytes */
   uint32_t num_rle;
   union {
-    xine_rle_elem_t *data; /* RLE compressed image */
+    osd_rle_elem_t  *data; /* RLE compressed image */
     uint8_t         *raw_data;
     uint64_t         dummy01;
   };
   uint32_t colors;         /* palette size */
   union {
-    xine_clut_t     *palette;  /* palette (YCrCb) */
+    osd_clut_t      *palette;  /* palette (YCrCb) */
     uint64_t         dummy02;
   };
 
@@ -155,7 +155,6 @@ typedef struct osd_command_s {
 #  error __BYTE_ORDER undefined !
 #endif
 
-
 #if defined __cplusplus
 }
 #endif
diff --git a/tools/rle.c b/tools/rle.c
index dfc3d1e..3d7094c 100644
--- a/tools/rle.c
+++ b/tools/rle.c
@@ -4,7 +4,7 @@
  * See the main source file 'xineliboutput.c' for copyright information and
  * how to reach the author.
  *
- * $Id: rle.c,v 1.10 2012/01/24 11:23:10 phintuka Exp $
+ * $Id: rle.c,v 1.12 2014/06/23 12:20:28 phintuka Exp $
  *
  */
 
@@ -14,7 +14,7 @@
 #include <sys/types.h>
 #endif
 
-#include "../xine_osd_command.h"
+#include "osd_command.h"
 
 #include "rle.h"
 
@@ -26,13 +26,13 @@
  * rle_compress()
  *
  */
-uint rle_compress(xine_rle_elem_t **rle_data, const uint8_t *data, uint w, uint h)
+uint rle_compress(osd_rle_elem_t **rle_data, const uint8_t *data, uint w, uint h)
 {
-  xine_rle_elem_t rle, *rle_p = 0, *rle_base;
+  osd_rle_elem_t rle, *rle_p = 0, *rle_base;
   uint x, y, num_rle = 0, rle_size = 8128;
   const uint8_t *c;
 
-  rle_p = (xine_rle_elem_t*)malloc(4*rle_size);
+  rle_p = (osd_rle_elem_t*)malloc(4*rle_size);
   rle_base = rle_p;
 
   for (y = 0; y < h; y++) {
@@ -44,7 +44,7 @@ uint rle_compress(xine_rle_elem_t **rle_data, const uint8_t *data, uint w, uint
         if (rle.len) {
           if ( (num_rle + h-y+1) > rle_size ) {
             rle_size *= 2;
-            rle_base = (xine_rle_elem_t*)realloc( rle_base, 4*rle_size );
+            rle_base = (osd_rle_elem_t*)realloc( rle_base, 4*rle_size );
             rle_p = rle_base + num_rle;
           }
           *rle_p++ = rle;
@@ -66,8 +66,8 @@ uint rle_compress(xine_rle_elem_t **rle_data, const uint8_t *data, uint w, uint
 
 uint rle_compress_net(uint8_t **rle_data, uint *elems, const uint8_t *data, uint w, uint h)
 {
-  *elems = rle_compress((xine_rle_elem_t**)rle_data, data, w, h);
-  return rle_recompress_net(*rle_data, *(xine_rle_elem_t **)rle_data, *elems);
+  *elems = rle_compress((osd_rle_elem_t**)rle_data, data, w, h);
+  return rle_recompress_net(*rle_data, *(osd_rle_elem_t **)rle_data, *elems);
 }
 
 /*
@@ -75,7 +75,7 @@ uint rle_compress_net(uint8_t **rle_data, uint *elems, const uint8_t *data, uint
  *
  * recompress RLE-compressed OSD using variable sized RLE codewords
 */
-uint rle_recompress_net(uint8_t *raw, xine_rle_elem_t *data, uint elems)
+uint rle_recompress_net(uint8_t *raw, osd_rle_elem_t *data, uint elems)
 {
   uint8_t *raw0 = raw;
   uint i;
@@ -101,7 +101,7 @@ uint rle_recompress_net(uint8_t *raw, xine_rle_elem_t *data, uint elems)
  * - Simple nearest-neighbour scaling for RLE-compressed image
  * - fast scaling in compressed form without decompression
  */
-xine_rle_elem_t *rle_scale_nearest(const xine_rle_elem_t *old_rle, int *rle_elems,
+osd_rle_elem_t *rle_scale_nearest(const osd_rle_elem_t *old_rle, int *rle_elems,
                                    uint w, uint h, uint new_w, uint new_h)
 {
   #define FACTORBASE      0x100
@@ -115,8 +115,8 @@ xine_rle_elem_t *rle_scale_nearest(const xine_rle_elem_t *old_rle, int *rle_elem
   uint factor_y = FACTORBASE*new_h/old_h;
   uint rle_size = MAX(8128, *rle_elems * new_h/h ); /* guess ... */
   uint num_rle  = 0;
-  xine_rle_elem_t *new_rle = (xine_rle_elem_t*)malloc(sizeof(xine_rle_elem_t)*rle_size);
-  xine_rle_elem_t *new_rle_start = new_rle;
+  osd_rle_elem_t *new_rle = (osd_rle_elem_t*)malloc(sizeof(osd_rle_elem_t)*rle_size);
+  osd_rle_elem_t *new_rle_start = new_rle;
 
   /* we assume rle elements are breaked at end of line */
   while (old_y < old_h) {
@@ -145,7 +145,7 @@ xine_rle_elem_t *rle_scale_nearest(const xine_rle_elem_t *old_rle, int *rle_elem
 
         if ( (num_rle + 1) >= rle_size ) {
           rle_size *= 2;
-          new_rle_start = (xine_rle_elem_t*)realloc( new_rle_start, 4*rle_size);
+          new_rle_start = (osd_rle_elem_t*)realloc( new_rle_start, 4*rle_size);
           new_rle = new_rle_start + num_rle;
         }
       }
@@ -164,11 +164,11 @@ xine_rle_elem_t *rle_scale_nearest(const xine_rle_elem_t *old_rle, int *rle_elem
         dup = new_h - new_y - 1;
 
       while (dup-- && (new_y+1<new_h)) {
-        xine_rle_elem_t *prevline;
+        osd_rle_elem_t *prevline;
         uint n;
         if ( (num_rle + elems_current_line + 1) >= rle_size ) {
           rle_size *= 2;
-          new_rle_start = (xine_rle_elem_t*)realloc( new_rle_start, 4*rle_size);
+          new_rle_start = (osd_rle_elem_t*)realloc( new_rle_start, 4*rle_size);
           new_rle = new_rle_start + num_rle;
         }
 
@@ -295,12 +295,12 @@ size_t rle_compress_hdmv(uint8_t **rle_data, const uint8_t *data, uint w, uint h
 }
 
 
-int rle_uncompress_hdmv(xine_rle_elem_t **data,
+int rle_uncompress_hdmv(osd_rle_elem_t **data,
                         uint w, uint h,
                         const uint8_t *rle_data, uint num_rle, size_t rle_size)
 {
   uint rle_count = 0, x = 0, y = 0;
-  xine_rle_elem_t *rlep = calloc(2*num_rle, sizeof(xine_rle_elem_t));
+  osd_rle_elem_t *rlep = calloc(2*num_rle, sizeof(osd_rle_elem_t));
   const uint8_t *end = rle_data + rle_size;
 
   *data = rlep;
@@ -371,7 +371,7 @@ int rle_uncompress_hdmv(xine_rle_elem_t **data,
 
 void rle_uncompress_lut8(uint8_t *dst,
                          uint w, uint h, uint stride,
-                         const struct xine_rle_elem_s *rle_data, uint num_rle)
+                         const struct osd_rle_elem_s *rle_data, uint num_rle)
 {
   uint i, pixelcounter = 0;
   uint idx = 0, line = 0;
@@ -395,7 +395,7 @@ void rle_uncompress_lut8(uint8_t *dst,
   }
 }
 
-void rle_palette_to_argb(uint32_t *argb, const struct xine_clut_s *palette, uint entries)
+void rle_palette_to_argb(uint32_t *argb, const struct osd_clut_s *palette, uint entries)
 {
   uint i;
   for (i = 0; i < entries; i++) {
@@ -406,7 +406,7 @@ void rle_palette_to_argb(uint32_t *argb, const struct xine_clut_s *palette, uint
   }
 }
 
-void rle_palette_to_rgba(uint32_t *rgba, const struct xine_clut_s *palette, uint entries)
+void rle_palette_to_rgba(uint32_t *rgba, const struct osd_clut_s *palette, uint entries)
 {
   uint i;
   for (i = 0; i < entries; i++) {
@@ -419,7 +419,7 @@ void rle_palette_to_rgba(uint32_t *rgba, const struct xine_clut_s *palette, uint
 
 static void rle_uncompress_u32(uint32_t *dst,
                                uint w, uint h, uint stride,
-                               const struct xine_rle_elem_s *rle_data, uint num_rle,
+                               const struct osd_rle_elem_s *rle_data, uint num_rle,
                                uint32_t *lut)
 {
   uint i, pixelcounter = 0;
@@ -446,8 +446,8 @@ static void rle_uncompress_u32(uint32_t *dst,
 
 void rle_uncompress_argb(uint32_t *dst,
                          uint w, uint h, uint stride,
-                         const struct xine_rle_elem_s *rle_data, uint num_rle,
-                         const struct xine_clut_s *palette, uint palette_entries)
+                         const struct osd_rle_elem_s *rle_data, uint num_rle,
+                         const struct osd_clut_s *palette, uint palette_entries)
 {
   uint32_t lut[256] = {0};
 
@@ -461,8 +461,8 @@ void rle_uncompress_argb(uint32_t *dst,
 
 void rle_uncompress_rgba(uint32_t *dst,
                          uint w, uint h, uint stride,
-                         const struct xine_rle_elem_s *rle_data, uint num_rle,
-                         const struct xine_clut_s *palette, uint palette_entries)
+                         const struct osd_rle_elem_s *rle_data, uint num_rle,
+                         const struct osd_clut_s *palette, uint palette_entries)
 {
   uint32_t lut[256] = {0};
 
diff --git a/tools/rle.h b/tools/rle.h
index 4eb57d5..ef36d4c 100644
--- a/tools/rle.h
+++ b/tools/rle.h
@@ -4,7 +4,7 @@
  * See the main source file 'xineliboutput.c' for copyright information and
  * how to reach the author.
  *
- * $Id: rle.h,v 1.7 2012/01/24 11:23:10 phintuka Exp $
+ * $Id: rle.h,v 1.8 2014/06/23 12:14:15 phintuka Exp $
  *
  */
 
@@ -21,28 +21,28 @@ typedef enum {
 } scale_mode_t;
 
 
-struct xine_rle_elem_s;
-struct xine_clut_s;
+struct osd_rle_elem_s;
+struct osd_clut_s;
 
 
-uint rle_compress(struct xine_rle_elem_s **rle_data, const uint8_t *data, uint w, uint h);
+uint rle_compress(struct osd_rle_elem_s **rle_data, const uint8_t *data, uint w, uint h);
 uint rle_compress_net(uint8_t **rle_data, uint *elems, const uint8_t *data, uint w, uint h);
-uint rle_recompress_net(uint8_t *raw, xine_rle_elem_t *data, uint elems);
+uint rle_recompress_net(uint8_t *raw, osd_rle_elem_t *data, uint elems);
 
-void rle_palette_to_argb(uint32_t *argb, const struct xine_clut_s *palette, uint entries);
-void rle_palette_to_rgba(uint32_t *rgba, const struct xine_clut_s *palette, uint entries);
+void rle_palette_to_argb(uint32_t *argb, const struct osd_clut_s *palette, uint entries);
+void rle_palette_to_rgba(uint32_t *rgba, const struct osd_clut_s *palette, uint entries);
 
 void rle_uncompress_lut8(uint8_t *dst,
                          uint w, uint h, uint stride,
-                         const struct xine_rle_elem_s *rle_data, uint num_rle);
+                         const struct osd_rle_elem_s *rle_data, uint num_rle);
 void rle_uncompress_argb(uint32_t *dst,
                          uint w, uint h, uint stride,
-                         const struct xine_rle_elem_s *rle_data, uint num_rle,
-                         const struct xine_clut_s *palette, uint palette_entries);
+                         const struct osd_rle_elem_s *rle_data, uint num_rle,
+                         const struct osd_clut_s *palette, uint palette_entries);
 void rle_uncompress_rgba(uint32_t *dst,
                          uint w, uint h, uint stride,
-                         const struct xine_rle_elem_s *rle_data, uint num_rle,
-                         const struct xine_clut_s *palette, uint palette_entries);
+                         const struct osd_rle_elem_s *rle_data, uint num_rle,
+                         const struct osd_clut_s *palette, uint palette_entries);
 
 /*
  * rle_scale_nearest()
@@ -50,7 +50,7 @@ void rle_uncompress_rgba(uint32_t *dst,
  * - Simple nearest-neighbour scaling for RLE-compressed image
  * - fast scaling in compressed form without decompression
  */
-struct xine_rle_elem_s *rle_scale_nearest(const struct xine_rle_elem_s *old_rle,
+struct osd_rle_elem_s *rle_scale_nearest(const struct osd_rle_elem_s *old_rle,
                                           int *rle_elems,
                                           uint w, uint h, uint new_w, uint new_h);
 
@@ -60,7 +60,7 @@ struct xine_rle_elem_s *rle_scale_nearest(const struct xine_rle_elem_s *old_rle,
  */
 
 size_t rle_compress_hdmv(uint8_t **rle_data, const uint8_t *data, uint w, uint h, int *num_rle);
-int rle_uncompress_hdmv(struct xine_rle_elem_s **data,
+int rle_uncompress_hdmv(struct osd_rle_elem_s **data,
                         uint w, uint h,
                         const uint8_t *rle_data, uint num_rle, size_t rle_size);
 
diff --git a/tools/udp_pes_scheduler.c b/tools/udp_pes_scheduler.c
index c7a289b..fb2e4db 100644
--- a/tools/udp_pes_scheduler.c
+++ b/tools/udp_pes_scheduler.c
@@ -4,7 +4,7 @@
  * See the main source file 'xineliboutput.c' for copyright information and
  * how to reach the author.
  *
- * $Id: udp_pes_scheduler.c,v 1.56 2011/02/28 13:15:08 phintuka Exp $
+ * $Id: udp_pes_scheduler.c,v 1.57 2013/10/25 17:22:38 rofafor Exp $
  *
  */
 
@@ -635,7 +635,12 @@ void cUdpScheduler::Send_SAP(bool Announce)
 #if 1
   /* store copy of SDP data */
   if(m_fd_sap < 0) {
-    cString fname = AddDirectory(VideoDirectory,
+    cString fname = AddDirectory(
+#if defined(APIVERSNUM) && (APIVERSNUM < 20102)
+				 VideoDirectory,
+#else
+				 cVideoDirectory::Name(),
+#endif
 				 cString::sprintf("xineliboutput@%s.sdp",
 						  ip));
     FILE *fp = fopen(fname, "w");
diff --git a/xine/osd_manager.c b/xine/osd_manager.c
index a83cd54..68ed458 100644
--- a/xine/osd_manager.c
+++ b/xine/osd_manager.c
@@ -4,7 +4,7 @@
  * See the main source file 'xineliboutput.c' for copyright information and
  * how to reach the author.
  *
- * $Id: osd_manager.c,v 1.27 2013/01/17 21:05:16 phintuka Exp $
+ * $Id: osd_manager.c,v 1.30 2014/06/23 12:20:28 phintuka Exp $
  *
  */
 
@@ -15,9 +15,9 @@
 #include <xine/xine_internal.h>
 #include <xine/video_out.h>
 
-#include "../xine_osd_command.h"
 #include "../xine_input_vdr.h"
 
+#include "../tools/osd_command.h"
 #include "../tools/rle.h"
 
 #include "vo_props.h"
@@ -156,7 +156,7 @@ video_overlay_manager_t *get_ovl_manager(osd_manager_impl_t *this)
 
 #define saturate(x,min,max) ( (x)<(min) ? (min) : (x)>(max) ? (max) : (x))
 
-static void palette_argb_to_ayuv(xine_clut_t *clut, int colors)
+static void palette_argb_to_ayuv(osd_clut_t *clut, int colors)
 {
   if (clut && colors>0) {
     int c;
@@ -244,10 +244,10 @@ static void osdcmd_scale(osd_manager_impl_t *this, osd_command_t *cmd,
   osd->cmd.datalen = cmd->datalen;
 
   /* scale */
-  int rle_elems = cmd->datalen / sizeof(xine_rle_elem_t);
+  int rle_elems = cmd->datalen / sizeof(osd_rle_elem_t);
   cmd->data = rle_scale_nearest(cmd->data, &rle_elems, cmd->w, cmd->h,
                                 new_w, new_h);
-  cmd->datalen = rle_elems * sizeof(xine_rle_elem_t);
+  cmd->datalen = rle_elems * sizeof(osd_rle_elem_t);
 
   cmd->x = new_x;
   cmd->y = new_y;
@@ -472,7 +472,7 @@ static int exec_osd_set_rle(osd_manager_impl_t *this, osd_command_t *cmd)
       palette_argb_to_ayuv(cmd->palette, cmd->colors);
     cmd->flags |= OSDFLAG_YUV_CLUT;
 
-    osd->cmd.palette = malloc(sizeof(xine_clut_t)*cmd->colors);
+    osd->cmd.palette = malloc(sizeof(osd_clut_t)*cmd->colors);
     memcpy(osd->cmd.palette, cmd->palette, 4*cmd->colors);
     osd->cmd.flags |= OSDFLAG_YUV_CLUT;
   }
@@ -723,9 +723,9 @@ static int exec_osd_set_argb(osd_manager_impl_t *this, osd_command_t *cmd)
 #define MIN(a,b) ((a)<(b)?(a):(b))
 #define MAX(a,b) ((a)>(b)?(a):(b))
   osd->argb_layer->x1 = MIN( osd->argb_layer->x1, cmd->x );
-  osd->argb_layer->x2 = MAX( osd->argb_layer->x2, cmd->x + cmd->w );
+  osd->argb_layer->x2 = MAX( osd->argb_layer->x2, cmd->x + cmd->w - 1);
   osd->argb_layer->y1 = MIN( osd->argb_layer->y1, cmd->y );
-  osd->argb_layer->y2 = MAX( osd->argb_layer->y2, cmd->y + cmd->h );
+  osd->argb_layer->y2 = MAX( osd->argb_layer->y2, cmd->y + cmd->h - 1);
 #endif
 
   /* set buffer (ref-counted) */
@@ -777,8 +777,8 @@ static int exec_osd_set_palette(osd_manager_impl_t *this, osd_command_t *cmd)
   /* replace palette */
   tmp.cmd      = OSD_Set_RLE;
   free(tmp.palette);
-  tmp.palette  = malloc(cmd->colors*sizeof(xine_rle_elem_t));
-  memcpy(tmp.palette, cmd->palette, cmd->colors*sizeof(xine_rle_elem_t));
+  tmp.palette  = malloc(cmd->colors * sizeof(osd_rle_elem_t));
+  memcpy(tmp.palette, cmd->palette, cmd->colors * sizeof(osd_rle_elem_t));
   tmp.colors   = cmd->colors;
   tmp.pts      = cmd->pts;
   tmp.delay_ms = cmd->delay_ms;
diff --git a/xine/ts2es.c b/xine/ts2es.c
index edd2fef..6de24b1 100644
--- a/xine/ts2es.c
+++ b/xine/ts2es.c
@@ -4,7 +4,7 @@
  * See the main source file 'xineliboutput.c' for copyright information and
  * how to reach the author.
  *
- * $Id: ts2es.c,v 1.22 2013/01/07 08:52:16 phintuka Exp $
+ * $Id: ts2es.c,v 1.23 2013/10/28 11:43:43 phintuka Exp $
  *
  */
 
@@ -187,15 +187,19 @@ buf_element_t *ts2es_put(ts2es_t *this, uint8_t *data, fifo_buffer_t *src_fifo)
 
   /* handle new payload unit */
   if (pusi) {
-    this->first_pusi_seen = 1;
 
+    if (this->first_pusi_seen && !this->buf) {
+      this->buf = this->fifo->buffer_pool_alloc(this->fifo);
+      this->buf->type = this->xine_buf_type;
+    }
     if (this->buf) {
-
       this->buf->decoder_flags |= BUF_FLAG_FRAME_END;
 
       result = this->buf;
       this->buf = NULL;
     }
+
+    this->first_pusi_seen = 1;
   }
 
   /* split large packets */
diff --git a/xine/vo_osdscaler.c b/xine/vo_osdscaler.c
index a9f5506..008c0da 100644
--- a/xine/vo_osdscaler.c
+++ b/xine/vo_osdscaler.c
@@ -4,7 +4,7 @@
  * See the main source file 'xineliboutput.c' for copyright information and
  * how to reach the author.
  *
- * $Id: vo_osdscaler.c,v 1.15 2013/08/19 08:20:30 phintuka Exp $
+ * $Id: vo_osdscaler.c,v 1.16 2014/06/23 12:14:16 phintuka Exp $
  *
  */
 
@@ -25,7 +25,7 @@
 /*#define LOGOSD(x...) LOGMSG(x)*/
 #define LOGOSD(x...)
 
-typedef rle_elem_t xine_rle_elem_t;
+typedef rle_elem_t osd_rle_elem_t;
 
 #include "../tools/rle.h"
 
@@ -160,7 +160,7 @@ static osd_data_t *osd_data_init(vo_overlay_t *ovl, osd_data_t *next,
 #endif
 
   data->ovl.rle     = (rle_elem_t*)
-    rle_scale_nearest((struct xine_rle_elem_s*)ovl->rle, &num_rle,
+    rle_scale_nearest((struct osd_rle_elem_s*)ovl->rle, &num_rle,
                       ovl->width, ovl->height,
                       data->ovl.width, data->ovl.height);
   data->ovl.num_rle = num_rle;
diff --git a/xine_frontend.c b/xine_frontend.c
index f752314..d89aee5 100644
--- a/xine_frontend.c
+++ b/xine_frontend.c
@@ -4,7 +4,7 @@
  * See the main source file 'xineliboutput.c' for copyright information and
  * how to reach the author.
  *
- * $Id: xine_frontend.c,v 1.126 2012/03/19 11:51:21 phintuka Exp $
+ * $Id: xine_frontend.c,v 1.127 2013/10/28 07:45:50 phintuka Exp $
  *
  */
 
@@ -1225,8 +1225,6 @@ static void fe_xine_close(frontend_t *this_gen)
 
     fe_xine_stop(this_gen);
 
-    fe_post_unload(this);
-
     xine_close(this->stream);
     if(this->postplugins->pip_stream) 
       xine_close(this->postplugins->pip_stream);
diff --git a/xine_frontend.h b/xine_frontend.h
index 23a5beb..6e40651 100644
--- a/xine_frontend.h
+++ b/xine_frontend.h
@@ -4,7 +4,7 @@
  * See the main source file 'xineliboutput.c' for copyright information and
  * how to reach the author.
  *
- * $Id: xine_frontend.h,v 1.30 2013/08/19 08:50:19 phintuka Exp $
+ * $Id: xine_frontend.h,v 1.31 2014/01/13 09:01:03 phintuka Exp $
  *
  */
 
@@ -89,6 +89,7 @@ struct frontend_s {
                             int fullscreen,
                             int modeswitch, const char *modeline,
                             int aspect, int scale_video);
+  unsigned char * (*fe_display_edid)(frontend_t *, int *size);
   void (*fe_display_close)(frontend_t*);
 
   /* Xine engine */
diff --git a/xine_frontend_cec.c b/xine_frontend_cec.c
new file mode 100644
index 0000000..35ebbce
--- /dev/null
+++ b/xine_frontend_cec.c
@@ -0,0 +1,498 @@
+/*
+ * xine_frontend_cec.c: Forward (local) HDMI-CEC keys to VDR (server)
+ *
+ * See the main source file 'xineliboutput.c' for copyright information and
+ * how to reach the author.
+ *
+ * $Id: xine_frontend_cec.c,v 1.3 2014/04/29 10:21:18 phintuka Exp $
+ *
+ */
+
+#include "features.h"
+
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef __FreeBSD__
+#include <string.h>
+#endif
+#include <pthread.h>
+#include <unistd.h>
+
+#ifdef HAVE_LIBCEC
+#include <libcec/cecc.h>
+#endif
+
+#define LOG_MODULENAME "[hdmi-cec]  "
+#include "logdefs.h"
+
+#include "xine_frontend.h"
+#include "xine_frontend_cec.h"
+
+#ifdef HAVE_LIBCEC
+
+/* static data */
+static volatile int exit_req = 0;
+static pthread_t cec_thread;
+static int cec_hdmi_port = 0;
+static int cec_dev_type = 0; /* 0 - TV, 5 - AVR */
+
+
+static const struct keymap_item {
+  const uint8_t map;
+  const char    key[12];
+} keymap[] = {
+  [CEC_USER_CONTROL_CODE_SELECT]                   = {0, "Ok"},
+  [CEC_USER_CONTROL_CODE_UP]                       = {0, "Up"},
+  [CEC_USER_CONTROL_CODE_DOWN]                     = {0, "Down"},
+  [CEC_USER_CONTROL_CODE_LEFT]                     = {0, "Left"},
+  [CEC_USER_CONTROL_CODE_RIGHT]                    = {0, "Right"},
+  [CEC_USER_CONTROL_CODE_RIGHT_UP]                 = {1, "RIGHT_UP"},
+  [CEC_USER_CONTROL_CODE_RIGHT_DOWN]               = {1, "RIGHT_DOWN"},
+  [CEC_USER_CONTROL_CODE_LEFT_UP]                  = {1, "LEFT_UP"},
+  [CEC_USER_CONTROL_CODE_LEFT_DOWN]                = {1, "LEFT_DOWN"},
+  [CEC_USER_CONTROL_CODE_ROOT_MENU]                = {0, "Menu"},
+  [CEC_USER_CONTROL_CODE_SETUP_MENU]               = {0, "Menu"},
+  [CEC_USER_CONTROL_CODE_CONTENTS_MENU]            = {0, "Recordings"},
+  [CEC_USER_CONTROL_CODE_FAVORITE_MENU]            = {1, "FAVORITE"},
+  [CEC_USER_CONTROL_CODE_EXIT]                     = {0, "Back"},
+  [CEC_USER_CONTROL_CODE_NUMBER0]                  = {0, "0"},
+  [CEC_USER_CONTROL_CODE_NUMBER1]                  = {0, "1"},
+  [CEC_USER_CONTROL_CODE_NUMBER2]                  = {0, "2"},
+  [CEC_USER_CONTROL_CODE_NUMBER3]                  = {0, "3"},
+  [CEC_USER_CONTROL_CODE_NUMBER4]                  = {0, "4"},
+  [CEC_USER_CONTROL_CODE_NUMBER5]                  = {0, "5"},
+  [CEC_USER_CONTROL_CODE_NUMBER6]                  = {0, "6"},
+  [CEC_USER_CONTROL_CODE_NUMBER7]                  = {0, "7"},
+  [CEC_USER_CONTROL_CODE_NUMBER8]                  = {0, "8"},
+  [CEC_USER_CONTROL_CODE_NUMBER9]                  = {0, "9"},
+  [CEC_USER_CONTROL_CODE_DOT]                      = {1, "DOT"},
+  [CEC_USER_CONTROL_CODE_ENTER]                    = {0, "Ok"},
+  [CEC_USER_CONTROL_CODE_CLEAR]                    = {1, "CLEAR"},
+  [CEC_USER_CONTROL_CODE_NEXT_FAVORITE]            = {1, "FAVORITE+"},
+  [CEC_USER_CONTROL_CODE_CHANNEL_UP]               = {0, "Channel+"},
+  [CEC_USER_CONTROL_CODE_CHANNEL_DOWN]             = {0, "Channel-"},
+  [CEC_USER_CONTROL_CODE_PREVIOUS_CHANNEL]         = {0, "Previous"},
+  [CEC_USER_CONTROL_CODE_SOUND_SELECT]             = {0, "Audio"},
+  [CEC_USER_CONTROL_CODE_INPUT_SELECT]             = {1, "INP_SELECT"},
+  [CEC_USER_CONTROL_CODE_DISPLAY_INFORMATION]      = {0, "Info"},
+  [CEC_USER_CONTROL_CODE_HELP]                     = {1, "HELP"},
+  [CEC_USER_CONTROL_CODE_PAGE_UP]                  = {1, "PAGE_UP"},
+  [CEC_USER_CONTROL_CODE_PAGE_DOWN]                = {1, "PAGE_DOWN"},
+  [CEC_USER_CONTROL_CODE_POWER]                    = {0, "Power"},
+  [CEC_USER_CONTROL_CODE_VOLUME_UP]                = {0, "Volume+"},
+  [CEC_USER_CONTROL_CODE_VOLUME_DOWN]              = {0, "Volume-"},
+  [CEC_USER_CONTROL_CODE_MUTE]                     = {0, "Mute"},
+  [CEC_USER_CONTROL_CODE_PLAY]                     = {0, "Play"},
+  [CEC_USER_CONTROL_CODE_STOP]                     = {0, "Stop"},
+  [CEC_USER_CONTROL_CODE_PAUSE]                    = {0, "Pause"},
+  [CEC_USER_CONTROL_CODE_RECORD]                   = {0, "Record"},
+  [CEC_USER_CONTROL_CODE_REWIND]                   = {0, "FastRew"},
+  [CEC_USER_CONTROL_CODE_FAST_FORWARD]             = {0, "FastFwd"},
+  [CEC_USER_CONTROL_CODE_EJECT]                    = {1, "EJECT"},
+  [CEC_USER_CONTROL_CODE_FORWARD]                  = {0, "Next"},
+  [CEC_USER_CONTROL_CODE_BACKWARD]                 = {0, "Previous"},
+  //[CEC_USER_CONTROL_CODE_STOP_RECORD]            = {0, ""}, //0x4D,
+  //[CEC_USER_CONTROL_CODE_PAUSE_RECORD]           = {0, ""}, //0x4E,
+  [CEC_USER_CONTROL_CODE_ANGLE]                    = {1, "ANGLE"},
+  [CEC_USER_CONTROL_CODE_SUB_PICTURE]              = {0, "Subtitles"},
+  //[CEC_USER_CONTROL_CODE_VIDEO_ON_DEMAND]        = {0, ""}, //0x52,
+  [CEC_USER_CONTROL_CODE_ELECTRONIC_PROGRAM_GUIDE] = {0, "Schedule"},
+  [CEC_USER_CONTROL_CODE_TIMER_PROGRAMMING]        = {0, "Timers"},
+  //[CEC_USER_CONTROL_CODE_INITIAL_CONFIGURATION]    = {0, ""},
+  //[CEC_USER_CONTROL_CODE_PLAY_FUNCTION]            = {0, ""},
+  //[CEC_USER_CONTROL_CODE_PAUSE_PLAY_FUNCTION]      = {0, ""},
+  //[CEC_USER_CONTROL_CODE_RECORD_FUNCTION]          = {0, ""},
+  //[CEC_USER_CONTROL_CODE_PAUSE_RECORD_FUNCTION]    = {0, ""},
+  //[CEC_USER_CONTROL_CODE_STOP_FUNCTION]            = {0, ""},
+  //[CEC_USER_CONTROL_CODE_MUTE_FUNCTION]            = {0, ""},
+  //[CEC_USER_CONTROL_CODE_RESTORE_VOLUME_FUNCTION]  = {0, ""},
+  //[CEC_USER_CONTROL_CODE_TUNE_FUNCTION]            = {0, ""},
+  //[CEC_USER_CONTROL_CODE_SELECT_MEDIA_FUNCTION]       = {0, ""},
+  //[CEC_USER_CONTROL_CODE_SELECT_AV_INPUT_FUNCTION]    = {0, ""},
+  [CEC_USER_CONTROL_CODE_SELECT_AUDIO_INPUT_FUNCTION] = {0, "Audio"},
+  [CEC_USER_CONTROL_CODE_POWER_TOGGLE_FUNCTION]       = {0, "Power"},
+  [CEC_USER_CONTROL_CODE_POWER_OFF_FUNCTION]          = {0, "Power"},
+  //[CEC_USER_CONTROL_CODE_POWER_ON_FUNCTION]           = {0, ""},
+  [CEC_USER_CONTROL_CODE_F1_BLUE]                  = {0, "Blue"},
+  [CEC_USER_CONTROL_CODE_F2_RED]                   = {0, "Red"},
+  [CEC_USER_CONTROL_CODE_F3_GREEN]                 = {0, "Green"},
+  [CEC_USER_CONTROL_CODE_F4_YELLOW]                = {0, "Yellow"},
+  [CEC_USER_CONTROL_CODE_F5]                       = {0, "User1"},
+  [CEC_USER_CONTROL_CODE_DATA]                     = {1, "DATA"},
+  //[CEC_USER_CONTROL_CODE_AN_RETURN]              = {0, ""},
+  [CEC_USER_CONTROL_CODE_AN_CHANNELS_LIST]         = {0, "Channels"},
+  [0xff] = {0, ""},
+};
+
+/*
+ * libcec callbacks
+ */
+
+static int cec_config_changed_cb(void *this_gen, const libcec_configuration config)
+{
+  LOGDBG("cec_config_changed");
+  return 1;
+}
+
+static int cec_menu_state_changed_cb(void *this_gen, const cec_menu_state state)
+{
+  LOGDBG("cec_menu_state_changed");
+  return 1;
+}
+
+static void cec_source_activated_cb(void *this_gen, const cec_logical_address address, const uint8_t param)
+{
+  LOGMSG("cec_source_activated: address %d param %d", address, param);
+}
+
+static int cec_log_cb(void *this_gen, const cec_log_message message)
+{
+  if (message.level <= CEC_LOG_ERROR) {
+    errno = 0;
+    LOGERR("%s", message.message);
+  } else if (message.level <= CEC_LOG_NOTICE) {
+    LOGMSG("%s", message.message);
+  } else if (message.level <= CEC_LOG_DEBUG) {
+    LOGDBG("%s", message.message);
+  } else {
+    LOGVERBOSE("%s", message.message);
+  }
+  return 1;
+}
+
+static int cec_keypress_cb(void *this_gen, const cec_keypress keypress)
+{
+  frontend_t *fe = (frontend_t*)this_gen;
+  static int last_key = -1;
+
+  LOGVERBOSE("keypress 0x%x duration %d", keypress.keycode, keypress.duration);
+
+  if (keypress.keycode == last_key && keypress.duration > 0)
+    return 1;
+  else if (keypress.duration > 0)
+    last_key = -1;
+  else
+    last_key = keypress.keycode;
+
+  if (keypress.keycode >= sizeof(keymap) / sizeof(keymap[0]) ||
+      !keymap[keypress.keycode].key[0]) {
+    LOGMSG("unknown keycode 0x%x", keypress.keycode);
+    return 1;
+  }
+
+  LOGDBG("sending key %s%s", keymap[keypress.keycode].map ? "CEC." : "", keymap[keypress.keycode].key);
+
+  alarm(3);
+  fe->send_input_event(fe, keymap[keypress.keycode].map ? "CEC" : NULL,
+		       keymap[keypress.keycode].key, 0, 1);
+  alarm(0);
+
+  return 1;
+}
+
+static int cec_alert_cb(void *this_gen, const libcec_alert type, const libcec_parameter param)
+{
+  switch (type) {
+    case CEC_ALERT_CONNECTION_LOST:
+      LOGMSG("ALERT: CEC connection lost");
+      break;
+    case CEC_ALERT_PERMISSION_ERROR:
+      LOGMSG("ALERT: Permission error");
+      break;
+    case CEC_ALERT_PORT_BUSY:
+      LOGMSG("ALERT: Port busy");
+      break;
+    case CEC_ALERT_PHYSICAL_ADDRESS_ERROR:
+      LOGMSG("ALERT: Physical address error");
+      break;
+    case CEC_ALERT_TV_POLL_FAILED:
+      LOGMSG("ALERT: TV poll failed");
+      break;
+
+    case CEC_ALERT_SERVICE_DEVICE:
+    default:
+      break;
+  }
+  return 0;
+}
+
+static int cec_command_cb(void *this_gen, const cec_command command)
+{
+  LOGMSG("Received command 0x%x from 0x%x", command.opcode, command.initiator);
+
+  switch (command.opcode) {
+    case CEC_OPCODE_STANDBY:
+    case CEC_OPCODE_SET_MENU_LANGUAGE:
+    case CEC_OPCODE_DECK_CONTROL:
+    case CEC_OPCODE_PLAY:
+    default:
+      break;
+  }
+  return 1;
+}
+
+ICECCallbacks callbacks = {
+  .CBCecKeyPress             = cec_keypress_cb,
+  .CBCecCommand              = cec_command_cb,
+  .CBCecLogMessage           = cec_log_cb,
+  .CBCecAlert                = cec_alert_cb,
+  .CBCecConfigurationChanged = cec_config_changed_cb,
+  .CBCecSourceActivated      = cec_source_activated_cb,
+  .CBCecMenuStateChanged     = cec_menu_state_changed_cb,
+};
+
+/*
+ * configuration
+ */
+
+static void libcec_config_clear(libcec_configuration *p)
+{
+  memset(p, 0, sizeof(*p));
+
+  p->iPhysicalAddress = CEC_PHYSICAL_ADDRESS_TV;
+  p->baseDevice = CEC_DEFAULT_BASE_DEVICE;
+  p->iHDMIPort = CEC_DEFAULT_HDMI_PORT;
+  p->tvVendor = CEC_VENDOR_UNKNOWN;
+  p->clientVersion = CEC_CLIENT_VERSION_CURRENT;
+  p->serverVersion = CEC_SERVER_VERSION_CURRENT;
+  p->bAutodetectAddress = CEC_DEFAULT_SETTING_AUTODETECT_ADDRESS;
+  p->bGetSettingsFromROM = CEC_DEFAULT_SETTING_GET_SETTINGS_FROM_ROM;
+  p->bUseTVMenuLanguage = CEC_DEFAULT_SETTING_USE_TV_MENU_LANGUAGE;
+  p->bActivateSource = CEC_DEFAULT_SETTING_ACTIVATE_SOURCE;
+  p->bPowerOffScreensaver = CEC_DEFAULT_SETTING_POWER_OFF_SCREENSAVER;
+  p->bPowerOnScreensaver = CEC_DEFAULT_SETTING_POWER_ON_SCREENSAVER;
+  p->bPowerOffOnStandby = CEC_DEFAULT_SETTING_POWER_OFF_ON_STANDBY;
+  p->bShutdownOnStandby = CEC_DEFAULT_SETTING_SHUTDOWN_ON_STANDBY;
+  p->bSendInactiveSource = CEC_DEFAULT_SETTING_SEND_INACTIVE_SOURCE;
+  p->iFirmwareVersion = CEC_FW_VERSION_UNKNOWN;
+  p->bPowerOffDevicesOnStandby = CEC_DEFAULT_SETTING_POWER_OFF_DEVICES_STANDBY;
+  memcpy(p->strDeviceLanguage, CEC_DEFAULT_DEVICE_LANGUAGE, 3);
+  p->iFirmwareBuildDate = CEC_FW_BUILD_UNKNOWN;
+  p->bMonitorOnly = 0;
+  p->cecVersion = CEC_DEFAULT_SETTING_CEC_VERSION;
+  p->adapterType = ADAPTERTYPE_UNKNOWN;
+  p->iDoubleTapTimeoutMs = CEC_DOUBLE_TAP_TIMEOUT_MS;
+  p->comboKey = CEC_USER_CONTROL_CODE_STOP;
+  p->iComboKeyTimeoutMs = CEC_DEFAULT_COMBO_TIMEOUT_MS;
+
+  memset(p->strDeviceName, 0, sizeof(p->strDeviceName));
+
+  //deviceTypes.Clear();
+  int i;
+  for (i = 0; i < sizeof(p->deviceTypes.types) / sizeof(p->deviceTypes.types[0]); i++)
+    p->deviceTypes.types[i] = CEC_DEVICE_TYPE_RESERVED;
+  //logicalAddresses.Clear();
+  p->logicalAddresses.primary = CECDEVICE_UNREGISTERED;
+  memset(p->logicalAddresses.addresses, 0, sizeof(p->logicalAddresses.addresses));
+  //wakeDevices.Clear();
+  p->wakeDevices.primary = CECDEVICE_UNREGISTERED;
+  memset(p->wakeDevices.addresses, 0, sizeof(p->wakeDevices.addresses));
+  //powerOffDevices.Clear();
+  p->powerOffDevices.primary = CECDEVICE_UNREGISTERED;
+  memset(p->powerOffDevices.addresses, 0, sizeof(p->powerOffDevices.addresses));
+
+  #if CEC_DEFAULT_SETTING_POWER_OFF_SHUTDOWN == 1
+  p->powerOffDevices.primary = CECDEVICE_BROADCAST;
+  #endif
+  #if CEC_DEFAULT_SETTING_ACTIVATE_SOURCE == 1
+  p->wakeDevices.primary = CECDEVICE_TV;
+  #endif
+
+  p->callbackParam = NULL;
+  p->callbacks = NULL;
+}
+
+static int cec_parse_edid(uint8_t *edid, int size)
+{
+  /* get cec physical address from edid vendor-specific block */
+  int i;
+  for (i = 0; i < size; i++) {
+    if (edid[i] == 0x03 && edid[i + 1] == 0x0c && edid[i + 2] == 0x00) {
+      /* hdmi marker found */
+      LOGMSG("Got CEC physical address from edid: %d.%d.%d.%d",
+             edid[i + 3] >> 4 & 0xf,
+             edid[i + 3]      & 0xf,
+             edid[i + 4] >> 4 & 0xf,
+             edid[i + 4]      & 0xf);
+
+      return (edid[i + 3] << 8) | edid[i + 4];
+    }
+  }
+  return -1;
+}
+
+static int detect_hdmi_address(frontend_t *fe_gen)
+{
+  if (cec_hdmi_port <= 0) {
+    frontend_t *fe = (frontend_t*)fe_gen;
+    if (fe->fe_display_edid) {
+      int cec_hdmi_address;
+      int size = 0;
+      uint8_t *edid;
+      edid = fe->fe_display_edid(fe, &size);
+      if (edid) {
+        cec_hdmi_address = cec_parse_edid(edid, size);
+        free(edid);
+
+        if (cec_hdmi_address > 0) {
+          return cec_hdmi_address;
+        }
+      }
+    }
+    LOGMSG("WARNING: CEC HDMI port not given and edid reading/parsing failed");
+  }
+  return 0;
+}
+
+static int libcec_init(void *fe_gen)
+{
+  libcec_configuration config;
+
+  libcec_config_clear(&config);
+
+  config.clientVersion = CEC_CLIENT_VERSION_CURRENT;
+  strncpy(config.strDeviceName, "VDR", sizeof(config.strDeviceName));
+
+  config.iPhysicalAddress = detect_hdmi_address(fe_gen);
+  config.iHDMIPort = cec_hdmi_port;
+  config.baseDevice = cec_dev_type;
+
+  config.bActivateSource = 0;
+  config.callbackParam = fe_gen;
+  config.callbacks = &callbacks;
+
+  config.deviceTypes.types[0] = CEC_DEVICE_TYPE_PLAYBACK_DEVICE;
+  config.deviceTypes.types[1] = CEC_DEVICE_TYPE_RECORDING_DEVICE;
+  config.deviceTypes.types[2] = CEC_DEVICE_TYPE_TUNER;
+  //config.deviceTypes.types[3] = CEC_DEVICE_TYPE_AUDIO_SYSTEM;
+
+  if (!cec_initialise(&config)) {
+    LOGMSG("cec_initialize() failed");
+    return 0;
+  }
+
+  cec_init_video_standalone();
+
+  return 1;
+}
+
+/*
+ *
+ */
+
+static int libcec_open(void)
+{
+  cec_adapter devices[10];
+  int count = cec_find_adapters(devices, 10, NULL);
+  if (count < 1) {
+    LOGMSG("No HDMI-CEC adapters found");
+    return 0;
+  }
+
+  LOGMSG("%d adapters found. Opening %s", count, devices[0].comm);
+
+  if (!cec_open(devices[0].comm, 3000)) {
+    LOGMSG("error opening CEC adapter");
+    return 0;
+  }
+
+  LOGMSG("opened adapter %s", devices[0].comm);
+
+  return 1;
+}
+
+static int libcec_check_device(void)
+{
+  if (!cec_ping_adapters()) {
+    LOGMSG("cec_ping_adapters() failed");
+    return 0;
+  }
+
+  return 1;
+}
+
+static void cleanup(void *p)
+{
+  cec_close();
+  cec_destroy();
+}
+
+static void *cec_receiver_thread(void *fe_gen)
+{
+
+  LOGDBG("started");
+
+  pthread_cleanup_push(cleanup, NULL);
+
+  enum { INIT, WAIT_DEVICE, RUNNING } state = INIT;
+
+  while (!exit_req) {
+
+    pthread_testcancel();
+
+    switch (state) {
+    case INIT:
+      if (!libcec_init(fe_gen)) {
+	return NULL;
+      }
+      state = WAIT_DEVICE;
+      break;
+    case WAIT_DEVICE:
+      if (libcec_open()) {
+	state = RUNNING;
+      }
+      usleep(5000*1000);
+      break;
+    case RUNNING:
+      if (!libcec_check_device()) {
+        state = WAIT_DEVICE;
+      }
+      usleep(1000*1000);
+      break;
+    }
+  }
+
+  pthread_cleanup_pop(1);
+
+  pthread_exit(NULL);
+  return NULL; /* never reached */
+}
+
+#endif /* HAVE_LIBCEC */
+
+/*
+ * interface
+ */
+
+void cec_start(struct frontend_s *fe, int hdmi_port, int dev_type)
+{
+#ifdef HAVE_LIBCEC
+  if (hdmi_port >= 0) {
+    int err;
+
+    exit_req = 0;
+    cec_hdmi_port = hdmi_port;
+    cec_dev_type = dev_type;
+
+    if ((err = pthread_create (&cec_thread,
+                               NULL, cec_receiver_thread,
+                               (void*)fe)) != 0) {
+      fprintf(stderr, "can't create new thread for HDMI-CEC (%s)\n",
+              strerror(err));
+    }
+  }
+#endif /* HAVE_LIBCEC */
+}
+
+void cec_stop(void)
+{
+#ifdef HAVE_LIBCEC
+  if (!exit_req) {
+    void *p;
+    exit_req = 1;
+    pthread_cancel (cec_thread);
+    pthread_join (cec_thread, &p);
+  }
+#endif /* HAVE_LIBCEC */
+}
diff --git a/xine_frontend_cec.h b/xine_frontend_cec.h
new file mode 100644
index 0000000..3fcd2f7
--- /dev/null
+++ b/xine_frontend_cec.h
@@ -0,0 +1,19 @@
+/*
+ * xine_frontend_cec.h:
+ *
+ * See the main source file 'xineliboutput.c' for copyright information and
+ * how to reach the author.
+ *
+ * $Id: xine_frontend_cec.h,v 1.1 2014/01/14 08:21:33 phintuka Exp $
+ *
+ */
+
+#ifndef XINE_FRONTEND_CEC_H
+#define XINE_FRONTEND_CEC_H
+
+struct frontend_s;
+
+void cec_start(struct frontend_s *fe, int hdmi_port, int dev_type);
+void cec_stop(void);
+
+#endif /* XINE_FRONTEND_CEC_H */
diff --git a/xine_frontend_main.c b/xine_frontend_main.c
index 543c139..9293ad8 100644
--- a/xine_frontend_main.c
+++ b/xine_frontend_main.c
@@ -4,7 +4,7 @@
  * See the main source file 'xineliboutput.c' for copyright information and
  * how to reach the author.
  *
- * $Id: xine_frontend_main.c,v 1.104 2013/08/18 07:58:29 phintuka Exp $
+ * $Id: xine_frontend_main.c,v 1.105 2014/01/14 08:21:33 phintuka Exp $
  *
  */
 
@@ -27,6 +27,7 @@
 #include "xine_input_vdr_mrl.h"
 #include "xine_frontend.h"
 #include "tools/vdrdiscovery.h"
+#include "xine_frontend_cec.h"
 #include "xine_frontend_lirc.h"
 #include "xine_frontend_kbd.h"
 
@@ -143,6 +144,12 @@ static const char help_str[] =
     "                                 --post=upmix;tvtime:enabled=1,cheap_mode=1\n"
     "   -L, --lirc[=devicename]       Use lirc input device\n"
     "                                 Optional lirc socket name can be given\n"
+#ifdef HAVE_LIBCEC
+    "   -E, --nocec                   Disable HDMI-CEC input device\n"
+    "   -e, --cec[=port[,type]]       Use HDMI-CEC input device\n"
+    "                                 port: HDMI port number\n"
+    "                                 type: 0 for TV, 5 for AVR\n"
+#endif
     "   -C, --config=file             Use config file (default: ~/.xine/config_xineliboutput).\n"
     "   -v, --verbose                 Verbose debug output\n"
     "   -s, --silent                  Silent mode (report only errors)\n"
@@ -167,7 +174,7 @@ static const char help_str[] =
     "                                 are tried in following order:\n"
     "                                 local pipe, rtp, udp, tcp\n\n";
 
-static const char short_options[] = "HA:V:d:W:a:fg:Dw:h:B:nP:L:C:T:p:vsxlkoObSRtuUr";
+static const char short_options[] = "HA:V:d:W:a:fg:Dw:h:B:nP:L:C:T:p:vsxlkoOeEbSRtuUr";
 
 static const struct option long_options[] = {
   { "help",       no_argument,       NULL, 'H' },
@@ -195,6 +202,10 @@ static const struct option long_options[] = {
   { "noscaling",  no_argument,       NULL, 'n' },
   { "post",       required_argument, NULL, 'P' },
   { "lirc",       optional_argument, NULL, 'L' },
+#ifdef HAVE_LIBCEC
+  { "nocec",      optional_argument, NULL, 'E' },
+  { "cec",        optional_argument, NULL, 'e' },
+#endif
   { "config",     required_argument, NULL, 'C' },
   { "terminal",   required_argument, NULL, 'T' },
   { "shutdown",   required_argument, NULL, 'p' },
@@ -238,6 +249,7 @@ int main(int argc, char *argv[])
   char *audio_driver = NULL;
   char *static_post_plugins = NULL;
   char *lirc_dev = NULL;
+  int   cec_hdmi_port = 0, cec_dev_type = 0;
   char *p;
   const char *audio_device = NULL;
   const char *video_port = NULL;
@@ -412,6 +424,17 @@ int main(int argc, char *argv[])
               PRINTF("LIRC device:  %s%s\n", lirc_dev,
                      repeat_emu?", emulating key repeat":"");
               break;
+    case 'E': cec_hdmi_port = -1;
+              break;
+    case 'e': cec_hdmi_port = 0;
+#ifdef HAVE_LIBCEC
+              if (optarg)
+                sscanf(optarg, "%d,%d", &cec_hdmi_port, &cec_dev_type);
+              PRINTF("HDMI-CEC enabled. Connected to HDMI port %d (type %d)\n", cec_hdmi_port, cec_dev_type);
+#else
+              EXIT("HDMI-CEC support not compiled in\n");
+#endif
+              break;
     case 'v': SysLogLevel = (SysLogLevel<SYSLOGLEVEL_DEBUG) ? SYSLOGLEVEL_DEBUG : SysLogLevel+1;
               PRINTF("Verbose mode\n");
               break;
@@ -625,6 +648,8 @@ int main(int argc, char *argv[])
       /* Start LIRC forwarding */
       lirc_start(fe, lirc_dev, repeat_emu);
 
+      cec_start(fe, cec_hdmi_port, cec_dev_type);
+
       /* Start keyboard listener thread */
       if (!nokbd) {
         PRINTF("\n\nPress Esc to exit\n\n");
@@ -658,6 +683,7 @@ int main(int argc, char *argv[])
 
   /* stop input threads */
   lirc_stop();
+  cec_stop();
   if (!nokbd)
     kbd_stop();
 
diff --git a/xine_input_vdr.c b/xine_input_vdr.c
index a93fc38..7b655d3 100644
--- a/xine_input_vdr.c
+++ b/xine_input_vdr.c
@@ -4,7 +4,7 @@
  * See the main source file 'xineliboutput.c' for copyright information and
  * how to reach the author.
  *
- * $Id: xine_input_vdr.c,v 1.364 2013/01/15 20:33:29 phintuka Exp $
+ * $Id: xine_input_vdr.c,v 1.366 2014/06/23 12:20:28 phintuka Exp $
  *
  */
 
@@ -67,8 +67,8 @@
 
 #include "xine_input_vdr.h"
 #include "xine_input_vdr_net.h"
-#include "xine_osd_command.h"
 
+#include "tools/osd_command.h"
 #include "tools/mpeg.h"
 #include "tools/pes.h"
 #include "tools/ts.h"
@@ -136,7 +136,7 @@ typedef struct {
 #  include <linux/unistd.h> /* syscall(__NR_gettid) */
 #endif
 
-static const char module_revision[] = "$Id: xine_input_vdr.c,v 1.364 2013/01/15 20:33:29 phintuka Exp $";
+static const char module_revision[] = "$Id: xine_input_vdr.c,v 1.366 2014/06/23 12:20:28 phintuka Exp $";
 static const char log_module_input_vdr[] = "[input_vdr] ";
 #define LOG_MODULENAME log_module_input_vdr
 #define SysLogLevel    iSysLogLevel
@@ -1928,9 +1928,9 @@ static input_plugin_t *fifo_class_get_instance (input_class_t *class_gen,
 
 /******************************** OSD ************************************/
 
-static xine_rle_elem_t *uncompress_osd_net(uint8_t *raw, int elems, int datalen)
+static osd_rle_elem_t *uncompress_osd_net(uint8_t *raw, int elems, int datalen)
 {
-  xine_rle_elem_t *data = (xine_rle_elem_t*)malloc(elems*sizeof(xine_rle_elem_t));
+  osd_rle_elem_t *data = (osd_rle_elem_t *)malloc(elems * sizeof(osd_rle_elem_t));
   int i;
 
   /*
@@ -2772,7 +2772,7 @@ static int handle_control_osdcmd(vdr_input_plugin_t *this)
 
   /* read palette */
   if (osdcmd.palette && osdcmd.colors>0) {
-    ssize_t bytes = sizeof(xine_clut_t)*(osdcmd.colors);
+    ssize_t bytes = sizeof(osd_clut_t) * osdcmd.colors;
     osdcmd.palette = malloc(bytes);
     if (read_control(this, (unsigned char *)osdcmd.palette, bytes) != bytes) {
       LOGMSG("control: error reading OSDCMD palette");
@@ -2784,7 +2784,7 @@ static int handle_control_osdcmd(vdr_input_plugin_t *this)
 
   /* read (RLE) data */
   if (err == CONTROL_OK && osdcmd.data && osdcmd.datalen>0) {
-    osdcmd.data = (xine_rle_elem_t*)malloc(osdcmd.datalen);
+    osdcmd.data = (osd_rle_elem_t *)malloc(osdcmd.datalen);
     if(read_control(this, (unsigned char *)osdcmd.data, osdcmd.datalen)
        != (ssize_t)osdcmd.datalen) {
       LOGMSG("control: error reading OSDCMD bitmap");
diff --git a/xine_sxfe_frontend.c b/xine_sxfe_frontend.c
index e525387..dede8d0 100644
--- a/xine_sxfe_frontend.c
+++ b/xine_sxfe_frontend.c
@@ -4,7 +4,7 @@
  * See the main source file 'xineliboutput.c' for copyright information and
  * how to reach the author.
  *
- * $Id: xine_sxfe_frontend.c,v 1.205 2013/08/18 07:58:29 phintuka Exp $
+ * $Id: xine_sxfe_frontend.c,v 1.209 2014/07/01 19:17:14 phintuka Exp $
  *
  */
 
@@ -37,6 +37,9 @@
 #ifdef HAVE_XINERAMA
 #  include <X11/extensions/Xinerama.h>
 #endif
+#ifdef HAVE_XRANDR
+#  include <X11/extensions/Xrandr.h>
+#endif
 
 #ifdef HAVE_OPENGL
 #  include <GL/glx.h>
@@ -53,13 +56,13 @@
 #define LOG_MODULENAME "[vdr-sxfe]  "
 #include "logdefs.h"
 
-#include "xine_osd_command.h"
 #include "xine_frontend_internal.h"
 
 #ifdef HAVE_DBUS_GLIB_1
 #  include "tools/gnome_screensaver.h"
 #endif
 
+#include "tools/osd_command.h"
 #include "tools/rle.h"
 #include "tools/time_ms.h"
 
@@ -2564,6 +2567,90 @@ static void sxfe_toggle_fullscreen(fe_t *this_gen, int fullscreen)
   this->fullscreen_state_forced = !force;
 }
 
+static unsigned char *sxfe_display_edid(frontend_t *this_gen, int *size)
+{
+  sxfe_t *this = (sxfe_t*)this_gen;
+  unsigned char *edid = NULL;
+
+#ifdef HAVE_XRANDR
+
+  XLockDisplay(this->display);
+
+  do {
+    if (!this->display)
+      break;
+
+    int event_base, error_base;
+    int major, minor;
+    if (!XRRQueryExtension(this->display, &event_base, &error_base) ||
+        !XRRQueryVersion(this->display, &major, &minor)) {
+      LOGMSG("edid: RandR extension missing");
+      break;
+    }
+    if (major < 1 || (major == 1 && minor < 2)) {
+      LOGMSG("edid: RandR extension < 1.2");
+      break;
+    }
+
+    XRRScreenResources *res;
+    res = XRRGetScreenResourcesCurrent(this->display, this->root_window);
+    if (!res) {
+      LOGMSG("edid: failed getting screen resources");
+      break;
+    }
+
+    int o;
+    for (o = 0; o < res->noutput && !edid; o++) {
+      XRROutputInfo *output_info = XRRGetOutputInfo(this->display, res, res->outputs[o]);
+      if (!output_info) {
+        LOGMSG("edid: failed getting output %d information", o);
+        continue;
+      }
+      if (output_info->connection != RR_Connected) {
+        LOGDBG("edid: output %s not connected", output_info->name);
+        continue;
+      }
+      LOGDBG("edid: checking connected output %s", output_info->name);
+
+      int nprop, j;
+      Atom *props = XRRListOutputProperties(this->display, res->outputs[o], &nprop);
+      for (j = 0; j < nprop && !edid; j++) {
+        char *atom_name = XGetAtomName(this->display, props[j]);
+
+        if (!strcmp(atom_name, "EDID")) {
+
+          unsigned char *prop;
+          int actual_format;
+          unsigned long nitems, bytes_after;
+          Atom actual_type;
+          XRRGetOutputProperty(this->display, res->outputs[o], props[j],
+                               0, 100, False, False,
+                               AnyPropertyType,
+                               &actual_type, &actual_format,
+                               &nitems, &bytes_after, &prop);
+          if (actual_format == 8 && actual_type == XA_INTEGER) {
+            LOGDBG("edid: Found EDID, %ld bytes", nitems);
+            *size = nitems;
+            edid = malloc(*size);
+            memcpy(edid, prop, *size);
+            break;
+          }
+        }
+      }
+    }
+  } while (0);
+
+  XUnlockDisplay(this->display);
+
+  if (!edid) {
+    LOGMSG("no EDID found");
+  }
+#endif /* HAVE_XRANDR */
+
+  return edid;
+}
+
+
 /*
  *   X event loop
  */
@@ -2699,14 +2786,20 @@ static void XConfigureEvent_handler(sxfe_t *this, XConfigureEvent *cev)
 
   /* update video window size */
   if (this->x.width != cev->width || this->x.height != cev->height) {
-    LOGDBG("Video window size changed from %dx%d to %dx%d", this->x.width, this->x.height, cev->width, cev->height);
-    this->x.width  = cev->width;
-    this->x.height = cev->height;
 
-    /* inform VDR about new size */
-    char str[128];
-    snprintf(str, sizeof(str), "INFO WINDOW %dx%d", this->x.width, this->x.height);
-    this->x.fe.send_event((frontend_t*)this, str);
+    if ( ( this->fullscreen && this->window[1] == cev->window) ||
+         (!this->fullscreen && this->window[0] == cev->window)) {
+
+      LOGDBG("Video window size changed from %dx%d to %dx%d", this->x.width, this->x.height, cev->width, cev->height);
+
+      this->x.width  = cev->width;
+      this->x.height = cev->height;
+
+      /* inform VDR about new size */
+      char str[128];
+      snprintf(str, sizeof(str), "INFO WINDOW %dx%d", this->x.width, this->x.height);
+      this->x.fe.send_event((frontend_t*)this, str);
+    }
   }
 
   if(this->window[0] == cev->window && this->check_move) {
@@ -3099,6 +3192,7 @@ static frontend_t *sxfe_get_frontend(void)
 
   this->fe.fe_display_open   = sxfe_display_open;
   this->fe.fe_display_config = sxfe_display_config;
+  this->fe.fe_display_edid   = sxfe_display_edid;
   this->fe.fe_display_close  = sxfe_display_close;
 
   this->fe.fe_run       = sxfe_run;
diff --git a/xineliboutput.c b/xineliboutput.c
index c285e42..a5c281f 100644
--- a/xineliboutput.c
+++ b/xineliboutput.c
@@ -21,7 +21,7 @@
  *
  * xineliboutput.c: VDR Plugin interface
  *
- * $Id: xineliboutput.c,v 1.58 2013/08/20 09:09:33 phintuka Exp $
+ * $Id: xineliboutput.c,v 1.61 2014/01/31 08:58:30 rofafor Exp $
  *
  */
 
@@ -37,21 +37,22 @@
 #include "menu.h"
 #include "media_player.h"
 
-#if defined(APIVERSNUM) && (APIVERSNUM < 10600)
-# error VDR API versions < 1.6.0 are not supported !
+#if defined(APIVERSNUM) && (APIVERSNUM < 10733)
+# error VDR API versions < 1.7.33 are not supported !
 #endif
 
 //---------------------------------plugin-------------------------------------
 
-static const char *VERSION        = "1.1.0";
+static const char *VERSION        = "2.0.0-cvs";
 static const char *DESCRIPTION    = trNOOP("X11/xine-lib output plugin");
 static const char *MAINMENUENTRY  = trNOOP("Media Player");
 
-class cPluginXinelibOutput : public cPlugin 
+class cPluginXinelibOutput : public cPlugin
 {
   private:
     // Add any member variables or functions you may need here.
     cXinelibDevice *m_Dev;
+    int             m_MakePrimary;
 
   public:
     cPluginXinelibOutput(void);
@@ -88,6 +89,7 @@ cPluginXinelibOutput::cPluginXinelibOutput(void)
   // VDR OBJECTS TO EXIST OR PRODUCE ANY OUTPUT!
 
   m_Dev = NULL;
+  m_MakePrimary = 0;
 }
 
 cPluginXinelibOutput::~cPluginXinelibOutput()
@@ -194,6 +196,12 @@ void cPluginXinelibOutput::MainThreadHook(void)
 {
   TRACEF("cPluginXinelibOutput::MainThreadHook");
 
+  if (m_MakePrimary) {
+     LOGDBG("Switching primary device to %d", m_MakePrimary);
+     cDevice::SetPrimaryDevice(m_MakePrimary);
+     m_MakePrimary = 0;
+     }
+
   if (m_Dev) {
     m_Dev->MainThreadHook();
   }
@@ -328,6 +336,9 @@ const char **cPluginXinelibOutput::SVDRPHelpPages(void)
     "    Queue music file to playlist.",
     "LFRO <frontend>\n"
     "    Start/stop local frontend. <frontend> can be none, sxfe or fbfe.",
+    "PRIM <n>\n"
+    "    Make <n> the primary device. If <n> is missing,\n"
+    "    xineliboutput will become the primary device.",
     NULL
     };
   return HelpPages;
@@ -400,6 +411,20 @@ cString cPluginXinelibOutput::SVDRPCommand(const char *Command, const char *Opti
     }
   }
 
+  else if(strcasecmp(Command, "PRIM") == 0) {
+    int primary = 0;
+    if(*Option) {
+      LOGMSG("SVDRP(%s, %s)", Command, Option);
+      primary = strtol(Option, NULL, 0);
+    } else {
+      LOGMSG("SVDRP(%s)", Command);
+    }
+    if(!primary && m_Dev)
+        primary = m_Dev->DeviceNumber() + 1;
+    m_MakePrimary = primary;
+    return cString::sprintf("Switching primary device to %d", primary);
+  }
+
   return NULL;
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-vdr-dvb/vdr-plugin-xineliboutput.git



More information about the pkg-vdr-dvb-changes mailing list