diff -r f6051697b2c3 HISTORY
--- a/HISTORY	Sun Jan 27 14:23:28 2013 +0100
+++ b/HISTORY	Mon Feb 11 18:24:38 2013 +0100
@@ -1,6 +1,15 @@
 VDR Plugin 'image' Revision History
 -----------------------------------
 
+2013-02-11
+- Release Version 0.3.3
+- Various Makefile fixes for VDR > 1.7.36
+
+2013-02-02
+- Release Version 0.3.2
+- Support for VDR > 1.7.35
+- Compiles with recent ffmpeg
+
 2011-03-19
 - Release Version 0.3.1
 - Adjust to compile plugin with VDR >= 1.7.17
diff -r f6051697b2c3 Makefile
--- a/Makefile	Sun Jan 27 14:23:28 2013 +0100
+++ b/Makefile	Mon Feb 11 18:24:38 2013 +0100
@@ -26,43 +26,49 @@
 #
 PLUGIN = image
 
-### The C++ compiler and options:
+#### The version number of this plugin (taken from the main source file):
 
-CXX      ?= g++
-CXXFLAGS ?= -fPIC -O2 -Wall -Woverloaded-virtual
-PKG-CONFIG ?= pkg-config
-
-###############################################
-###############################################
-#
-# no user configurable options below this point
-#
-###############################################
-###############################################
+VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g')
 
 ### The directory environment:
 
-VDRDIR = ../../..
-LIBDIR = ../../lib
-TMPDIR = /tmp
+# 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 --variable=$(1) vdr || pkg-config --variable=$(1) ../../../vdr.pc))
+LIBDIR = $(call PKGCFG,libdir)
+LOCDIR = $(call PKGCFG,locdir)
+CFGDIR = $(call PKGCFG,configdir)/plugins/$(PLUGIN)
+PLGCFG = $(call PKGCFG,plgcfg)
+#
+TMPDIR ?= /tmp
+
+### The compiler options:
+
+export CFLAGS   = $(call PKGCFG,cflags)
+export CXXFLAGS = $(call PKGCFG,cxxflags)
+
+### The version number of VDR's plugin API (taken from VDR's "config.h"):
+
+APIVERSION = $(call PKGCFG,apiversion)
 
 ### Allow user defined options to overwrite defaults:
 
--include $(VDRDIR)/Make.config
-
-### The version number of this plugin (taken from the main source file):
-
-VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g')
-
-### The version number of VDR (taken from VDR's "config.h"):
-
-APIVERSION = $(shell grep 'define APIVERSION ' $(VDRDIR)/config.h | awk '{ print $$3 }' | sed -e 's/"//g')
+-include $(PLGCFG)
 
 ### The name of the distribution archive:
 
 ARCHIVE = $(PLUGIN)-$(VERSION)
 PACKAGE = vdr-$(ARCHIVE)
 
+### The name of the shared object file:
+
+SOFILE = libvdr-$(PLUGIN).so
+
+### Includes and Defines (add further entries here):
+ 
+INCLUDES += -I$(VDRDIR)/include -I.
+DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
+CXXFLAGS +=-D__STDC_CONSTANT_MACROS
+
 ### The version number of ffmpeg (taken from "libavcodec/avcodec.h" ):
 
 ifdef FFMDIR
@@ -72,48 +78,52 @@
 
 ### Includes and Defines (add further entries here):
 
-
-DEFINES  += -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
-DEFINES  += -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS
 LIBS += liboutput/liboutput.a libimage/libimage.a
 
-INCLUDES += -I$(VDRDIR)/include -I.
+ifneq (exists, $(shell pkg-config libavcodec && echo exists))
+  $(warning ******************************************************************)
+  $(warning 'libavcodec' not detected! ')
+  $(warning ******************************************************************)
+endif
 
-ifdef FFMDIR
-DEFINES += -DFFMDIR
-LIBS += -L$(FFMDIR)/libavcodec -lavcodec -lz
-ifeq ($(LIBAVCODECVERSION),51)
-LIBS += -L$(FFMDIR)/libavformat -L$(FFMDIR)/libavutil
-LIBS += -lavformat -lavutil
+ifneq (exists, $(shell pkg-config libavformat && echo exists))
+  $(warning ******************************************************************)
+  $(warning 'libavformat' not detected! ')
+  $(warning ******************************************************************)
 endif
+
+ifneq (exists, $(shell pkg-config libswscale && echo exists))
+  $(warning ******************************************************************)
+  $(warning 'libswscale' not detected! ')
+  $(warning ******************************************************************)
+  WITHOUT_SWSCALER = 1
+endif
+
+ifneq (exists, $(shell pkg-config libexif && echo exists))
+  $(warning ******************************************************************)
+  $(warning 'libexif' not detected! ')
+  $(warning ******************************************************************)
+  WITHOUT_LIBEXIF=1
+endif
+
+LIBS += $(shell pkg-config --libs libavformat)
+CXXFLAGS += $(shell pkg-config --cflags libavformat)
+
+LIBS += $(shell pkg-config --libs libavcodec)
+CXXFLAGS += $(shell pkg-config --cflags libavcodec)
+
 ifndef WITHOUT_SWSCALER
   DEFINES += -DHAVE_SWSCALER
-  LIBS += -L$(FFMDIR)/libswscale -lswscale
-endif
-else
-  PKG-LIBS += libavcodec 
-  PKG-INCLUDES += libavcodec
-ifndef WITHOUT_SWSCALER
-  PKG-INCLUDES += libswscale
-  PKG-LIBS += libswscale
-endif
+  LIBS += $(shell pkg-config --libs libswscale)
+  CXXFLAGS += $(shell pkg-config --cflags libswscale)
 endif
 
 ifndef WITHOUT_LIBEXIF
-  PKG-INCLUDES += libexif
-  PKG-LIBS += libexif
+  CXXFLAGS += $(shell pkg-config --cflags libexif)
+  LIBS += $(shell pkg-config --libs libexif)
   DEFINES += -DHAVE_LIBEXIF
 endif
 
-
-ifdef PKG-INCLUDES
-INCLUDES += $(shell $(PKG-CONFIG) --cflags $(PKG-INCLUDES))
-endif
-
-ifdef PKG-LIBS
-LIBS    += $(shell $(PKG-CONFIG) --libs $(PKG-LIBS))
-endif
-
 ### The object files (add further files here):
 
 OBJS = ${PLUGIN}.o data.o menu.o data-image.o menu-image.o \
@@ -129,54 +139,59 @@
 
 SUBDIRS = liboutput libimage
 
+### The main target:
+
+all: subdirs $(SOFILE) i18n
+
 ### Implicit rules:
 
 %.o: %.c
-	$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $<
-
-# Dependencies:
+	$(CXX) $(CXXFLAGS) $(CEXTRA) -c $(DEFINES) $(INCLUDES) $<
+	
+### Dependencies:
 
 MAKEDEP = $(CXX) -MM -MG
 DEPFILE = .dependencies
 $(DEPFILE): Makefile
-	@$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
+	@$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) *.h > $@
 
 -include $(DEPFILE)
 
 ### Internationalization (I18N):
 
 PODIR     = po
-LOCALEDIR = $(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 $@ $<
+	msgfmt -v -c -o $@ $<
 
-$(I18Npot): $(wildcard *.c)
-	xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --msgid-bugs-address='Andreas Brachold <anbr at user.berlios.de>' -o $@ $^
+$(I18Npot): $(wildcard *.c *.h)
+	xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --package-name=vdr-$(PLUGIN) --package-version=$(VERSION) --msgid-bugs-address='<see README>' -o $@ `ls $^`
 
 %.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 $< $@
+$(I18Nmsgs): $(DESTDIR)$(LOCDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo
+	install -D -m644 $< $@
 
 .PHONY: i18n
-i18n: $(I18Nmsgs)
+i18n: $(I18Nmo) $(I18Npot)
+
+install-i18n: $(I18Nmsgs)
 
 ### Targets:
 
-all: subdirs libvdr-$(PLUGIN).so  i18n
+$(SOFILE): $(OBJS)
+	$(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) $(LIBS) -o $@
 
-libvdr-$(PLUGIN).so: $(OBJS)
-	$(CXX) $(CXXFLAGS) -shared -export-dynamic $(OBJS) $(LIBS) -o $@
-	@mkdir -p $(LIBDIR)
-	@cp $@ $(LIBDIR)/$@.$(APIVERSION)
+install-lib: $(SOFILE)
+	install -D $^ $(DESTDIR)$(LIBDIR)/$^.$(APIVERSION)
 
+install: install-lib install-i18n
 
 subdirs:
 	@for i in $(SUBDIRS) ;\
@@ -187,17 +202,14 @@
 	|| exit 1;\
 	done
 
-dist: clean
+dist: $(I18Npo) clean
 	@-rm -rf $(TMPDIR)/$(ARCHIVE)
 	@mkdir $(TMPDIR)/$(ARCHIVE)
 	@cp -a * $(TMPDIR)/$(ARCHIVE)
-	@chmod 644 -R $(TMPDIR)/$(ARCHIVE)/*
-	@find $(TMPDIR)/$(ARCHIVE) -name "*.sh" -exec chmod a+x {} \;
-	@find $(TMPDIR)/$(ARCHIVE) -type d -exec chmod 755 {} \;
-	@chown root.root -R $(TMPDIR)/$(ARCHIVE)/*
-	@tar czf $(PACKAGE).tar.gz --exclude=.svn -C $(TMPDIR) $(ARCHIVE)
+	@tar czf $(PACKAGE).tgz -C $(TMPDIR) $(ARCHIVE)
 	@-rm -rf $(TMPDIR)/$(ARCHIVE)
-	@echo Distribution package created as $(PACKAGE).tar.gz
+	@echo Distribution package created as $(PACKAGE).tgz
+	
 
 subdirs-clean:
 	@for i in $(SUBDIRS) ;\
@@ -210,4 +222,4 @@
 
 clean: subdirs-clean
 	@-rm -f $(PODIR)/*.mo $(PODIR)/*.pot
-	@-rm -f $(OBJS) $(DEPFILE) *.so *.tar.gz core* *~ contrib/*~  examples/*~ scripts/*~
+	@-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~ contrib/*~  examples/*~ scripts/*~
diff -r f6051697b2c3 Makefile.old
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Makefile.old	Mon Feb 11 18:24:38 2013 +0100
@@ -0,0 +1,213 @@
+#
+# Makefile for Image plugin to VDR
+#
+# (C) 2004-2008 Andreas Brachold    <anbr at users.berlios.de>
+#
+# This code is distributed under the terms and conditions of the
+# GNU GENERAL PUBLIC LICENSE. See the file COPYING for details.
+#
+#
+# You can change the compile options here or create a Make.config
+# in the VDR directory an set them there.
+#
+# $Id: Makefile 65 2010-10-19 16:55:00Z anbr $
+#
+
+
+### uncomment the following line, if you don't have libexif installed
+#WITHOUT_LIBEXIF=1
+
+#FFMDIR = ../../../../ffmpeg
+
+
+# The official name of this plugin.
+# This name will be used in the '-P...' option of VDR to load the plugin.
+# By default the main source file also carries this name.
+#
+PLUGIN = image
+
+### The C++ compiler and options:
+
+CXX      ?= g++
+CXXFLAGS ?= -fPIC -O2 -Wall -Woverloaded-virtual
+PKG-CONFIG ?= pkg-config
+
+###############################################
+###############################################
+#
+# no user configurable options below this point
+#
+###############################################
+###############################################
+
+### The directory environment:
+
+VDRDIR = ../../..
+LIBDIR = ../../lib
+TMPDIR = /tmp
+
+### Allow user defined options to overwrite defaults:
+
+-include $(VDRDIR)/Make.config
+
+### The version number of this plugin (taken from the main source file):
+
+VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g')
+
+### The version number of VDR (taken from VDR's "config.h"):
+
+APIVERSION = $(shell grep 'define APIVERSION ' $(VDRDIR)/config.h | awk '{ print $$3 }' | sed -e 's/"//g')
+
+### The name of the distribution archive:
+
+ARCHIVE = $(PLUGIN)-$(VERSION)
+PACKAGE = vdr-$(ARCHIVE)
+
+### The version number of ffmpeg (taken from "libavcodec/avcodec.h" ):
+
+ifdef FFMDIR
+LIBAVCODECVERSION = $(shell grep "\#define LIBAVCODEC_VERSION " $(FFMDIR)/libavcodec/avcodec.h | \
+                    awk '{ print $$3 }' | cut -d "." -f 1 )
+endif
+
+### Includes and Defines (add further entries here):
+
+
+DEFINES  += -DPLUGIN_NAME_I18N='"$(PLUGIN)"'
+DEFINES  += -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS
+LIBS += liboutput/liboutput.a libimage/libimage.a
+
+INCLUDES += -I$(VDRDIR)/include -I.
+
+ifdef FFMDIR
+DEFINES += -DFFMDIR
+LIBS += -L$(FFMDIR)/libavcodec -lavcodec -lz
+ifeq ($(LIBAVCODECVERSION),51)
+LIBS += -L$(FFMDIR)/libavformat -L$(FFMDIR)/libavutil
+LIBS += -lavformat -lavutil
+endif
+ifndef WITHOUT_SWSCALER
+  DEFINES += -DHAVE_SWSCALER
+  LIBS += -L$(FFMDIR)/libswscale -lswscale
+endif
+else
+  PKG-LIBS += libavcodec 
+  PKG-INCLUDES += libavcodec
+ifndef WITHOUT_SWSCALER
+  PKG-INCLUDES += libswscale
+  PKG-LIBS += libswscale
+endif
+endif
+
+ifndef WITHOUT_LIBEXIF
+  PKG-INCLUDES += libexif
+  PKG-LIBS += libexif
+  DEFINES += -DHAVE_LIBEXIF
+endif
+
+
+ifdef PKG-INCLUDES
+INCLUDES += $(shell $(PKG-CONFIG) --cflags $(PKG-INCLUDES))
+endif
+
+ifdef PKG-LIBS
+LIBS    += $(shell $(PKG-CONFIG) --libs $(PKG-LIBS))
+endif
+
+### The object files (add further files here):
+
+OBJS = ${PLUGIN}.o data.o menu.o data-image.o menu-image.o \
+ setup-image.o player-image.o control-image.o commands.o menu-commands.o \
+ list.o
+
+
+ifndef WITHOUT_LIBEXIF
+  OBJS    += exif.o
+endif
+
+### The subdirectories:
+
+SUBDIRS = liboutput libimage
+
+### Implicit rules:
+
+%.o: %.c
+	$(CXX) $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) $<
+
+# Dependencies:
+
+MAKEDEP = $(CXX) -MM -MG
+DEPFILE = .dependencies
+$(DEPFILE): Makefile
+	@$(MAKEDEP) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@
+
+-include $(DEPFILE)
+
+### Internationalization (I18N):
+
+PODIR     = po
+LOCALEDIR = $(VDRDIR)/locale
+I18Npo    = $(wildcard $(PODIR)/*.po)
+I18Nmsgs  = $(addprefix $(LOCALEDIR)/, $(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='Andreas Brachold <anbr at user.berlios.de>' -o $@ $^
+
+%.po: $(I18Npot)
+	msgmerge -U --no-wrap --no-location --backup=none -q $@ $<
+	@touch $@
+
+$(I18Nmsgs): $(LOCALEDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo
+	@mkdir -p $(dir $@)
+	cp $< $@
+
+.PHONY: i18n
+i18n: $(I18Nmsgs)
+
+### Targets:
+
+all: subdirs libvdr-$(PLUGIN).so  i18n
+
+libvdr-$(PLUGIN).so: $(OBJS)
+	$(CXX) $(CXXFLAGS) -shared -export-dynamic $(OBJS) $(LIBS) -o $@
+	@mkdir -p $(LIBDIR)
+	@cp $@ $(LIBDIR)/$@.$(APIVERSION)
+
+
+subdirs:
+	@for i in $(SUBDIRS) ;\
+	do \
+	    ( cd $$i;\
+              $(MAKE) all PLUGIN=$(PLUGIN);\
+       ) \
+	|| exit 1;\
+	done
+
+dist: clean
+	@-rm -rf $(TMPDIR)/$(ARCHIVE)
+	@mkdir $(TMPDIR)/$(ARCHIVE)
+	@cp -a * $(TMPDIR)/$(ARCHIVE)
+	@chmod 644 -R $(TMPDIR)/$(ARCHIVE)/*
+	@find $(TMPDIR)/$(ARCHIVE) -name "*.sh" -exec chmod a+x {} \;
+	@find $(TMPDIR)/$(ARCHIVE) -type d -exec chmod 755 {} \;
+	@chown root.root -R $(TMPDIR)/$(ARCHIVE)/*
+	@tar czf $(PACKAGE).tar.gz --exclude=.svn -C $(TMPDIR) $(ARCHIVE)
+	@-rm -rf $(TMPDIR)/$(ARCHIVE)
+	@echo Distribution package created as $(PACKAGE).tar.gz
+
+subdirs-clean:
+	@for i in $(SUBDIRS) ;\
+	do \
+	    ( cd $$i;\
+              $(MAKE) clean;\
+       ) \
+	|| exit 1;\
+	done
+
+clean: subdirs-clean
+	@-rm -f $(PODIR)/*.mo $(PODIR)/*.pot
+	@-rm -f $(OBJS) $(DEPFILE) *.so *.tar.gz core* *~ contrib/*~  examples/*~ scripts/*~
diff -r f6051697b2c3 control-image.c
--- a/control-image.c	Sun Jan 27 14:23:28 2013 +0100
+++ b/control-image.c	Mon Feb 11 18:24:38 2013 +0100
@@ -339,7 +339,7 @@
 */
 eOSState cImageControl::ProcessKeyPlayMode(eKeys Key)
 {
-  switch (Key)
+  switch ((int)Key)
   {
   // Mode select
   case kBack: return ProcessKeyStopped();
diff -r f6051697b2c3 data-image.h
--- a/data-image.h	Sun Jan 27 14:23:28 2013 +0100
+++ b/data-image.h	Mon Feb 11 18:24:38 2013 +0100
@@ -36,12 +36,12 @@
   int          m_nDefaultRotate;
 #endif
 protected:
-  void Unlink(const char *szName);
   void Clear(void);
 public:
   cImageData(const char *szName, cFileSource * pSource);
   virtual ~cImageData();
   bool CompareBaseDir(const cFileSource * pSource) const;
+  static void Unlink(const char *szName);
 
   inline const char *Name(void) const       
   { 
diff -r f6051697b2c3 exif.c
--- a/exif.c	Sun Jan 27 14:23:28 2013 +0100
+++ b/exif.c	Mon Feb 11 18:24:38 2013 +0100
@@ -103,7 +103,7 @@
 
 eOSState cImageMenuExif::ProcessKey(eKeys nKey)
 {
-  switch (nKey) {
+  switch ((int)nKey) {
     case kUp|k_Repeat:
     case kUp:
     case kDown|k_Repeat:
diff -r f6051697b2c3 image.c
--- a/image.c	Sun Jan 27 14:23:28 2013 +0100
+++ b/image.c	Mon Feb 11 18:24:38 2013 +0100
@@ -7,7 +7,7 @@
  * (C) 2004     A. Holzhammer for the massive script updates
  * (C) 2004-2011 Andreas Brachold <anbr at users.berlios.de>
  *  
- *  based on mp3/mplayer plugin by Stefan H�lswitt <huels at iname.com>
+ *  based on mp3/mplayer plugin by Stefan H�lswitt <huels at iname.com>
  *   
  * This code is distributed under the terms and conditions of the
  * GNU GENERAL PUBLIC LICENSE. See the file COPYING for details.
@@ -26,7 +26,7 @@
 #include "commands.h"
 #include "liboutput/encode.h"
 
-static const char *VERSION        = "0.3.1";
+static const char *VERSION        = "0.3.3";
 
 class cPluginImage : public cPlugin {
     cDirItem*      m_pServiceDirItem;
diff -r f6051697b2c3 image.h
--- a/image.h	Sun Jan 27 14:23:28 2013 +0100
+++ b/image.h	Mon Feb 11 18:24:38 2013 +0100
@@ -16,10 +16,11 @@
 #include <vdr/skins.h>
 #include <string.h>
 
+#ifdef APIVERSNUM
 #if APIVERSNUM < 10347
     #error "For compiled are at the least VDR Plugin-API 1.3.47 required"
 #endif
-
+#endif
 
 inline void OSD_InfoMsg(const char* sz) 
 {	
diff -r f6051697b2c3 liboutput/encode.c
--- a/liboutput/encode.c	Sun Jan 27 14:23:28 2013 +0100
+++ b/liboutput/encode.c	Mon Feb 11 18:24:38 2013 +0100
@@ -49,13 +49,8 @@
 
 bool cEncode::Register()
 {
-    avcodec_init();
-#if 0 
-    // XXX to resolv: dosen't work with osdpip
-    register_avcodec(&mpeg2video_encoder);
-#else
+    av_register_all();
     avcodec_register_all();
-#endif
 
     m_pavCodec = avcodec_find_encoder(CODEC_ID_MPEG2VIDEO);
     if (!m_pavCodec) {
@@ -100,7 +95,7 @@
     AVCodecContext  *pAVCC = NULL;
     AVFrame         *pAVF = NULL;
 
-    pAVCC = avcodec_alloc_context();
+    pAVCC = avcodec_alloc_context3(m_pavCodec);
     if (! pAVCC) 
     {
         esyslog("imageplugin: Failed to alloc memory for AVCodecContext.");
@@ -116,7 +111,7 @@
         {
             SetupEncodingParameters(pAVCC);
 
-            if (avcodec_open(pAVCC, m_pavCodec) < 0) 
+            if (avcodec_open2(pAVCC, m_pavCodec, NULL) < 0)
             {
                 esyslog("imageplugin: Couldn't open Codec.");
             }
@@ -142,7 +137,7 @@
     context->height = m_nHeight;
 
     #if LIBAVCODEC_BUILD >= 4754
-        context->time_base=(AVRational){1, GetFrameRate()};
+        context->time_base=(AVRational){1, (int)GetFrameRate()};
     #else
         context->frame_rate=GetFrameRate();
         context->frame_rate_base=1;
@@ -216,6 +211,8 @@
 
 bool cEncode::EncodeFrames(AVCodecContext *context, AVFrame *frame)
 {
+    AVPacket outpkt;
+    int got_output;
     if(!m_pFrameSizes)
     { 
         esyslog("imageplugin: Failed to add MPEG sequence, insufficient memory.");
@@ -223,23 +220,24 @@
     }
 
     unsigned int i;
-    
+    av_init_packet(&outpkt);
     m_nMPEGSize = 0;
 
     // Encode m_nNumberOfFramesToEncode number of frames
     for(i=0; (i < m_nNumberOfFramesToEncode) && (m_nMPEGSize < m_nMaxMPEGSize);
       ++i)
     {
-        int nFrameSize = avcodec_encode_video(context, m_pMPEG + m_nMPEGSize,
-                                              m_nMaxMPEGSize - m_nMPEGSize, frame);
-        if(nFrameSize < 0)
+        outpkt.data = ( m_pMPEG + m_nMPEGSize);
+        outpkt.size =  m_nMaxMPEGSize - m_nMPEGSize;
+        int err = avcodec_encode_video2(context, &outpkt,frame, &got_output);
+        if(err < 0)
         {
             esyslog("imageplugin: Failed to add frame %d, insufficient memory.",
               i);
             return false;
         }
-        m_nMPEGSize += nFrameSize;
-        *(m_pFrameSizes + i) = nFrameSize;
+        m_nMPEGSize += outpkt.size;
+        *(m_pFrameSizes + i) = outpkt.size;
     }
 
     // Add four bytes MPEG end sequence
diff -r f6051697b2c3 liboutput/encode.h
--- a/liboutput/encode.h	Sun Jan 27 14:23:28 2013 +0100
+++ b/liboutput/encode.h	Mon Feb 11 18:24:38 2013 +0100
@@ -14,6 +14,10 @@
 
 extern "C" {
 #include <libavcodec/avcodec.h>
+#include <libavformat/avformat.h>
+#ifdef HAVE_SWSCALE
+#  include <libswscale/swscale.h>
+#endif
 }
 
 #include "../setup-image.h"
diff -r f6051697b2c3 menu-commands.c
--- a/menu-commands.c	Sun Jan 27 14:23:28 2013 +0100
+++ b/menu-commands.c	Mon Feb 11 18:24:38 2013 +0100
@@ -111,7 +111,7 @@
 
 eOSState cImageMenuResult::ProcessKey(eKeys nKey)
 {
-  switch (nKey) {
+  switch ((int)nKey) {
     case kUp|k_Repeat:
     case kUp:
     case kDown|k_Repeat:
diff -r f6051697b2c3 player-image.c
--- a/player-image.c	Sun Jan 27 14:23:28 2013 +0100
+++ b/player-image.c	Mon Feb 11 18:24:38 2013 +0100
@@ -24,6 +24,7 @@
 #include "image.h"
 #include "list.h"
 #include <vdr/i18n.h>
+#include <vdr/status.h>
 
 #include "libimage/pnm.h"
 #include "libimage/xpm.h"
@@ -307,6 +308,9 @@
           }
         }
         fclose(f);
+        if (ImageSetup.m_bRemoveImmediately) {
+            cImageData::Unlink (pShell->szPNM);
+        }
       }
     }
   if(!bSuccess) {
@@ -440,6 +444,8 @@
     return bQueueEmpty;
   }  
 
+ // cStatus::MsgReplaying(this, "Image", pShell->szPNM, true );
+
   if(pShell->szCmd) {
     //dsyslog("imageplugin: executing script '%s'", pShell->szCmd);
     
diff -r f6051697b2c3 player-image.h
--- a/player-image.h	Sun Jan 27 14:23:28 2013 +0100
+++ b/player-image.h	Mon Feb 11 18:24:38 2013 +0100
@@ -37,6 +37,12 @@
   : szCmd(NULL)
   , szPNM(NULL)
   , szNumber('\0')
+  , nOffLeft(0)
+  , nOffTop(0)
+  , nWidth(0)
+  , nHeight(0)
+  , bClearBackground(false)
+
   {
   }
 
diff -r f6051697b2c3 setup-image.c
--- a/setup-image.c	Sun Jan 27 14:23:28 2013 +0100
+++ b/setup-image.c	Mon Feb 11 18:24:38 2013 +0100
@@ -45,6 +45,7 @@
   m_bLiveAudio = 0;
   m_bHousekeeping = 1;
   m_bUseDeviceStillPicture = 1;
+  m_bRemoveImmediately = false;
 
   m_nBorderHeight = 16;
   m_nBorderWidth = 16;
@@ -73,6 +74,7 @@
   else ParseInteger("Housekeeping",  m_bHousekeeping,0,1)
   else ParseInteger("HideMainMenu",  m_bHideMenu,0,1)
   else ParseInteger("UseDeviceStillPicture",  m_bUseDeviceStillPicture,0,1)
+  else ParseInteger("RemoveImmediately", m_bRemoveImmediately,0,1)
   else if(!strcasecmp(szName, "TempDir")) {
         strn0cpy(m_szTempDir,szValue,sizeof(m_szTempDir));
   }
@@ -95,6 +97,7 @@
   SetupStore("BorderWidth",             ImageSetup.m_nBorderWidth);
   SetupStore("HideMainMenu",            ImageSetup.m_bHideMenu);
   SetupStore("UseDeviceStillPicture",   ImageSetup.m_bUseDeviceStillPicture);
+  SetupStore("RemoveImmediately",       ImageSetup.m_bRemoveImmediately);
 }
 
 cMenuSetupImage::cMenuSetupImage(void)
@@ -134,6 +137,10 @@
         m_tmpSetup.m_szTempDir,sizeof(m_tmpSetup.m_szTempDir), 
         "abcdefghijklmopqrstuvwxyz/-"));
 
+  Add(new cMenuEditBoolItem(tr("Remove temporary files immediately"),
+          &m_tmpSetup.m_bRemoveImmediately,
+          trVDR("no"), trVDR("yes")));
+
   Add(new cMenuEditBoolItem(tr("Remove temporary files"),
         &m_tmpSetup.m_bHousekeeping,  
         trVDR("no"), trVDR("yes")));
diff -r f6051697b2c3 setup-image.h
--- a/setup-image.h	Sun Jan 27 14:23:28 2013 +0100
+++ b/setup-image.h	Mon Feb 11 18:24:38 2013 +0100
@@ -38,7 +38,8 @@
   int m_bLiveAudio;
   /* Activate own house keeping system for temp. files, avoid pregenerated images */
   int m_bHousekeeping;
-
+  /* Remove temp files immediately   */
+  int m_bRemoveImmediately;
   /* Use as output DeviceStillPicture */
   int m_bUseDeviceStillPicture;
 
