[oggvideotools] 01/05: New upstream version 0.9.1

Petter Reinholdtsen pere at moszumanska.debian.org
Mon Sep 5 11:08:55 UTC 2016


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

pere pushed a commit to branch master
in repository oggvideotools.

commit 7eafe558a693c6f31d6795f75fc638201612eb78
Author: Petter Reinholdtsen <pere at hungry.com>
Date:   Mon Sep 5 10:17:15 2016 +0000

    New upstream version 0.9.1
---
 CMakeLists.txt                          |    6 +-
 COPYING                                 |    4 +-
 ChangeLog                               |    3 +
 README                                  |    7 +-
 cpackInfo/COPYING.rtf                   |    2 +-
 cpackInfo/COPYING.txt                   |    4 +-
 docs/oggDump.1                          |    2 +-
 docs/oggDump.html                       |    2 +-
 src/base/CMakeLists.txt                 |    2 +
 src/base/granulePosInterpreter.h        |    6 +-
 src/base/mediaConverter.cpp             |    5 +-
 src/base/mediaConverter.h               |    3 +-
 src/base/mediaRepository.h              |   14 +-
 src/base/oggDecoder.cpp                 |   79 +-
 src/base/oggDecoder.h                   |   15 +-
 src/base/oggEncoder.cpp                 |   18 +-
 src/base/oggPacket.cpp                  |  206 +++--
 src/base/oggPacket.cpp.orig             |  281 -------
 src/base/oggPacket.h                    |   32 +-
 src/base/oggPage.cpp                    |   82 +-
 src/base/oggPage.h                      |   24 +-
 src/base/oggStreamDecoder.cpp           |   45 +-
 src/base/oggStreamDecoder.h             |    8 +-
 src/base/oggStreamEncoder.cpp           |  143 ++--
 src/base/oggStreamEncoder.h             |   23 +-
 src/base/rawMediaPacket.cpp             |    4 +-
 src/base/rawMediaPacket.h               |    8 +-
 src/base/streamExtractor.cpp            |   14 +-
 src/base/streamExtractor.h              |    2 +-
 src/base/test/CMakeLists.txt            |    5 +
 src/base/test/decoderTest.cpp           |   58 ++
 src/base/test/encoderTest.cpp           |   67 ++
 src/binaries/oggCat.cpp                 |  158 +---
 src/binaries/oggCut.cpp                 |   12 +-
 src/binaries/oggDump.cpp                |   33 +-
 src/binaries/oggJoin.cpp                |    2 +-
 src/binaries/oggSilence.cpp             |    2 +-
 src/binaries/oggSlideshow.cpp           |    9 +-
 src/binaries/oggSplit.cpp               |    6 +-
 src/binaries/oggThumb.cpp               |   11 +-
 src/binaries/oggTranscode.cpp           |   74 +-
 src/effect/pictureLoader.cpp            |    4 +-
 src/effect/rgbPlane.h                   |    6 +-
 src/header.dat                          |   51 ++
 src/main/audioHook.cpp                  |   18 +-
 src/main/hookHandler.cpp                |    4 +-
 src/main/hookHandler.h                  |    4 +-
 src/main/oggBOSExtractorFactory.cpp     |    2 +-
 src/main/streamMux.cpp                  |  132 ++--
 src/main/streamMux.h                    |   16 +-
 src/main/streamSerializer.cpp           |    6 +-
 src/main/videoHook.cpp                  |   55 +-
 src/old/SDLvideoOutput.cpp              |  106 ---
 src/old/SDLvideoOutput.h                |   29 -
 src/old/jackAudioOutput.h               |   20 -
 src/old/memFactory.h                    |   96 ---
 src/old/oggConfig.cpp                   |    9 -
 src/old/oggConfig.h                     |   15 -
 src/ovt_kate/kateExtractor.cpp          |    5 +-
 src/ovt_theora/theoraDecoder.cpp        |   35 +-
 src/ovt_theora/theoraDecoder.h          |    5 +-
 src/ovt_theora/theoraEncoder.cpp        |  112 +--
 src/ovt_theora/theoraExtractor.cpp      |   16 +-
 src/ovt_theora/theoraPosInterpreter.cpp |    6 +-
 src/ovt_vorbis/vorbisDecoder.cpp        |   16 +-
 src/ovt_vorbis/vorbisDecoder.h          |    3 +-
 src/ovt_vorbis/vorbisEncoder.cpp        |   28 +-
 src/ovt_vorbis/vorbisExtractor.cpp      |   11 +-
 src/ovt_vorbis/vorbisPosInterpreter.cpp |    8 +-
 src/tools.dox                           | 1294 -------------------------------
 src/wishList.h                          |    3 +-
 testsuite/testoggThumb.sh               |    6 +-
 win32/GD-COPYING.TXT                    |   53 --
 win32/getopt.c                          | 1047 -------------------------
 win32/getopt1.c                         |  188 -----
 win32/getopt_win.h                      |  168 ----
 76 files changed, 953 insertions(+), 4105 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 13bde53..5cd509c 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,10 +1,10 @@
-cmake_minimum_required(VERSION 2.6)
+cmake_minimum_required(VERSION 2.8)
 
 PROJECT ( "OggVideoTools" )
 
 SET ( PACKAGE_NAME "oggvideotools" )
-SET ( PACKAGE_VERSION "0.9" )
-SET ( PACKAGE_BUGREPORT "yorn at gmx.de" )
+SET ( PACKAGE_VERSION "0.9.1" )
+SET ( PACKAGE_BUGREPORT "yorn at gmx.net" )
 
 INCLUDE (CheckIncludeFiles)
 CHECK_INCLUDE_FILES ( bzero.h HAVE_BZERO_H)
diff --git a/COPYING b/COPYING
index 5a965fb..3826596 100644
--- a/COPYING
+++ b/COPYING
@@ -108,8 +108,8 @@ above, provided that you also meet all of these conditions:
     a warranty) and that users may redistribute the program under
     these conditions, and telling the user how to view a copy of this
     License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
+    does not normally toString such an announcement, your work based on
+    the Program is not required to toString an announcement.)
 

 These requirements apply to the modified work as a whole.  If
 identifiable sections of that work are not derived from the Program,
diff --git a/ChangeLog b/ChangeLog
index 152760e..fded6f5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -90,3 +90,6 @@ Version 0.9:
 - Manpage cleanup
 - fix for gcc 4.7 (used in Fedora 17)
 
+Version 0.9.1
+- changed over to C++11 and boost (in some minor places).
+- Cleanup a lot of things to fit ogg/theora/vorbis API again.
diff --git a/README b/README
index 79485fa..bb230cc 100644
--- a/README
+++ b/README
@@ -8,8 +8,13 @@ oggScroll, oggDump, oggSilence
 Required Software
 -----------------
 
+you globally need c++11 + boost (at least lexical_cast and circular_buffer,
+which are both header only) so if built, no boost libraries are needed.
+Version is tested against boost 1.54, however earlier version may work as
+well. 
+
 for oggCat oggCut oggDump oggSplit oggJoin oggLength:
-NONE!! (No you do not need any ogg/theora/vorbis library for that)
+(No you do not need any ogg/theora/vorbis library for that)
 
 for oggSlideshow, oggThumb, oggResize, oggSilence:
 libogg
diff --git a/cpackInfo/COPYING.rtf b/cpackInfo/COPYING.rtf
index c576a9d..7f5ef06 100644
--- a/cpackInfo/COPYING.rtf
+++ b/cpackInfo/COPYING.rtf
@@ -59,7 +59,7 @@ a) You must cause the modified files to carry prominent notices stating that you
 \
 b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.\
 \
-c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License.  (Exception: if the Program itself is  [...]
+c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License.  (Exception: if the Program itself is  [...]
 \
 These requirements apply to the modified work as a whole.  If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in\
 themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works.  But when you distribute the same sections as part of a whole which is a work based\
diff --git a/cpackInfo/COPYING.txt b/cpackInfo/COPYING.txt
index 4661078..4ee9462 100644
--- a/cpackInfo/COPYING.txt
+++ b/cpackInfo/COPYING.txt
@@ -114,8 +114,8 @@ above, provided that you also meet all of these conditions:\
     a warranty) and that users may redistribute the program under\
     these conditions, and telling the user how to view a copy of this\
     License.  (Exception: if the Program itself is interactive but\
-    does not normally print such an announcement, your work based on\
-    the Program is not required to print an announcement.)\
+    does not normally toString such an announcement, your work based on\
+    the Program is not required to toString an announcement.)\
 \
 These requirements apply to the modified work as a whole.  If\
 identifiable sections of that work are not derived from the Program,\
diff --git a/docs/oggDump.1 b/docs/oggDump.1
index d0f18b5..bfc2162 100644
--- a/docs/oggDump.1
+++ b/docs/oggDump.1
@@ -9,7 +9,7 @@ gives detailed information about an ogg video file and prints these information
 
 Ogg files consist of a number of streams (video and audio). From the Ogg-container perspective, the streams are devided into pages. These pages usually have nearly the same size. The pages can be printed out with the -g option.
 
-From the stream perspective, every stream consists of packets. These packets carry a bunch of compressed audio samples in case of a vorbis stream or one video frame in case of a theora video stream. These packets could be of variable length and are places into the ogg pages. To print the packets, use the -p option.
+From the stream perspective, every stream consists of packets. These packets carry a bunch of compressed audio samples in case of a vorbis stream or one video frame in case of a theora video stream. These packets could be of variable length and are places into the ogg pages. To toString the packets, use the -p option.
 
 .SH OPTIONS
 .IP \-g
diff --git a/docs/oggDump.html b/docs/oggDump.html
index 3ea9f41..977648b 100644
--- a/docs/oggDump.html
+++ b/docs/oggDump.html
@@ -25,7 +25,7 @@ gives detailed information about an ogg video file and prints these information
 <P>
 Ogg files consist of a number of streams (video and audio). From the Ogg-container perspective, the streams are devided into pages. These pages usually have nearly the same size. The pages can be printed out with the -g option.
 <P>
-From the stream perspective, every stream consists of packets. These packets carry a bunch of compressed audio samples in case of a vorbis stream or one video frame in case of a theora video stream. These packets could be of variable length and are places into the ogg pages. To print the packets, use the -p option.
+From the stream perspective, every stream consists of packets. These packets carry a bunch of compressed audio samples in case of a vorbis stream or one video frame in case of a theora video stream. These packets could be of variable length and are places into the ogg pages. To toString the packets, use the -p option.
 <P>
 <A NAME="lbAE"> </A>
 <H2>OPTIONS</H2>
diff --git a/src/base/CMakeLists.txt b/src/base/CMakeLists.txt
index f1427ef..00b6c74 100644
--- a/src/base/CMakeLists.txt
+++ b/src/base/CMakeLists.txt
@@ -23,3 +23,5 @@ SET ( LIBRARY_BASE_SRC
 )
 
 ADD_LIBRARY ( ovtbase ${LIBRARY_BASE_SRC} )
+
+add_subdirectory(test)
\ No newline at end of file
diff --git a/src/base/granulePosInterpreter.h b/src/base/granulePosInterpreter.h
index d9bac07..3aae650 100644
--- a/src/base/granulePosInterpreter.h
+++ b/src/base/granulePosInterpreter.h
@@ -4,8 +4,8 @@
 #include "oggPacket.h"
 #include "streamParameter.h"
 
-//! Class to interprete the granule position of a oggPacket
-/*! Every oggPacket carries a granule position within its header information.
+//! Class to interprete the granule position of a m_oggPacket
+/*! Every m_oggPacket carries a granule position within its header information.
  * This granule position is a 64 Bit value and is interpreted quite different
  * across the available ogg encoders/decoders.
  *
@@ -65,7 +65,7 @@ public:
    * */
   virtual int64 getPosition();
 
-  //! Method places the actual stream position into an oggPacket.
+  //! Method places the actual stream position into an m_oggPacket.
   /*! @param packet OggPacket to replace the granule position field in the header
    * */
   virtual void setStreamPosition(OggPacket& packet) = 0;
diff --git a/src/base/mediaConverter.cpp b/src/base/mediaConverter.cpp
index 9768af7..188c35a 100644
--- a/src/base/mediaConverter.cpp
+++ b/src/base/mediaConverter.cpp
@@ -98,8 +98,9 @@ bool MediaConverter::isAvailable()
 
 bool MediaConverter::isEmpty()
 {
-  return((mediaConverterState == mdec_empty) ||
-         (mediaConverterState == mdec_configured));
+  return( (mediaConverterState == mdec_initialized) ||
+          (mediaConverterState == mdec_empty) ||
+          (mediaConverterState == mdec_configured));
 }
 
 bool MediaConverter::isEndOfStream()
diff --git a/src/base/mediaConverter.h b/src/base/mediaConverter.h
index 7f867e0..7269ca6 100644
--- a/src/base/mediaConverter.h
+++ b/src/base/mediaConverter.h
@@ -69,8 +69,7 @@ public:
   bool isEmpty();
   bool isEndOfStream();
 
-  virtual std::string configuration() const
-  {
+  virtual std::string configuration() const {
     return (std::string(""));
   }
 
diff --git a/src/base/mediaRepository.h b/src/base/mediaRepository.h
index 2f5ad89..f482b91 100644
--- a/src/base/mediaRepository.h
+++ b/src/base/mediaRepository.h
@@ -32,7 +32,7 @@
  *  handle raw data from any source.
  *
  *  Actually the only implementation is the FileRepository class. One of
- *  the next implementations will be a http repository, that creates raw packets
+ *  the next implementations will be a http m_repository, that creates raw packets
  *  from an http media source or throughs out an http media stream.
  *
  * */
@@ -46,9 +46,9 @@ public:
 
   //! Constructor to create a new MediaRepository object
   /*! @param type The media direction
-   *   - MediaUnit::read for opening the repository for reading
-   *   - MediaUnit::write for opening the repository for writing
-   *  @param name The name of the media repository, this could be a filename, a url etc.
+   *   - MediaUnit::read for opening the m_repository for reading
+   *   - MediaUnit::write for opening the m_repository for writing
+   *  @param name The name of the media m_repository, this could be a filename, a url etc.
    *
    * */
   MediaRepository(MediaDirection_t type,const std::string name);
@@ -59,13 +59,13 @@ public:
   /*! @return true, if any data is available, false if not */
   virtual bool isAvailable();
 
-  //! Insert a new raw data packet into the repository
+  //! Insert a new raw data packet into the m_repository
   virtual MediaUnit& operator<<(RawMediaPacket& packet) = 0;
 
-  //! Receive a new raw data packet from the repository
+  //! Receive a new raw data packet from the m_repository
   virtual MediaUnit& operator>>(RawMediaPacket& packet) = 0;
 
-  //! Request the actual size of a raw media packet that this repository creates
+  //! Request the actual size of a raw media packet that this m_repository creates
   /*! @return Returns the bunch size, that is actually used.
    * */
   virtual uint32 getBunchSize() = 0;
diff --git a/src/base/oggDecoder.cpp b/src/base/oggDecoder.cpp
index 36deac4..f645aa6 100644
--- a/src/base/oggDecoder.cpp
+++ b/src/base/oggDecoder.cpp
@@ -26,11 +26,12 @@
 #include "oggDecoder.h"
 #include "oggHeader.h"
 #include "log.h"
+#include "exception.h"
 
 #define min(a,b) (((a)<(b))?(a):(b));
 
 OggDecoder::OggDecoder()
-  : oggRingbuffer(71000) // max page size plus 4KB read size
+  : m_oggRingbuffer(71000) // max page size plus 4KB read size
 {
   setConfigured();
 }
@@ -48,16 +49,22 @@ void OggDecoder::getNextPages()
 {
 
   while (1) {
-    std::vector<uint8_t> data; // this will be empty at the end, as we use move semantic
     uint32 length(0);
 
-    if (oggRingbuffer.getNextPage(data, length)) {
+    if (length = getNextPageLength()) {
 
+      logger.debug() << "getNextPage: length="<<length<< " available length in ringbuffer=" << m_oggRingbuffer.size()
+                     <<  std::endl;
+
+      std::vector<uint8_t> data;//(length,0);
+      data.insert(data.end(), m_oggRingbuffer.begin(), m_oggRingbuffer.begin()+length);
+      m_oggRingbuffer.erase_begin(length); //m_oggRingbuffer.begin(), m_oggRingbuffer.begin()+length);
       uint32 headerLength = sizeof(OggHeader) + ((OggHeader*)data.data())->tableSegments;
       uint32 bodyLength = length - headerLength;
+
       auto page = std::make_shared<OggPageInternal>(data, headerLength, bodyLength);
 
-      oggPageList.push(page);
+      m_oggPageList.push(page);
 
       setAvailable();
     } else
@@ -67,8 +74,11 @@ void OggDecoder::getNextPages()
 
 OggDecoder& OggDecoder::operator<<(RawMediaPacket& mediaPacket)
 {
+  logger.debug() << "inserting: ringbuffersize before: " << m_oggRingbuffer.size() << " insert length="<<mediaPacket->getSize() << std::endl;
   /* insert the raw data into the ring buffer*/
-  oggRingbuffer.addData(mediaPacket->getData(), mediaPacket->getSize());
+  m_oggRingbuffer.insert(m_oggRingbuffer.end(), mediaPacket->getData().begin(), mediaPacket->getData().end());
+
+  logger.debug() << "inserting: ringbuffersize after: " << m_oggRingbuffer.size() << std::endl;
 
   /* extract ogg pages */
   getNextPages();
@@ -79,9 +89,9 @@ OggDecoder& OggDecoder::operator<<(RawMediaPacket& mediaPacket)
 OggDecoder& OggDecoder::operator>>(OggPage& page)
 {
   if (isAvailable()) {
-    page = oggPageList.front();
-    oggPageList.pop();
-    if (oggPageList.empty())
+    page = m_oggPageList.front();
+    m_oggPageList.pop();
+    if (m_oggPageList.empty())
       setEmpty();
   } else
     logger.error() << "OggDecoder::operator>>: no page available, insert a packet first\n";
@@ -91,5 +101,56 @@ OggDecoder& OggDecoder::operator>>(OggPage& page)
 
 uint32 OggDecoder::space()
 {
-  return(oggRingbuffer.getAvailable());
+  return (uint32_t) (m_oggRingbuffer.capacity()-m_oggRingbuffer.size());
 }
+
+uint32_t OggDecoder::getNextPageLength()
+{
+
+  uint32_t availLength = (uint32_t) m_oggRingbuffer.size();
+  logger.debug() << "get new page length (if one) " << std::endl;
+
+  if (availLength < (int) sizeof(OggHeader)) {
+    return (0);
+  }
+
+  // test is this aligned?
+  char starter[5];
+  uint32_t pos;
+  for (pos = 0; pos < 5; ++pos) {
+    starter[pos] = m_oggRingbuffer[pos];
+    logger.debug() << "data " << std::hex << "0x" << (int) starter[pos] << " (" << std::dec << starter[pos] << ")\n";
+  }
+
+  if (strncmp(starter, "OggS", 4) != 0) {
+    logger.debug() << "Error: ogg string is " << std::hex << "0x" << (int) starter[0]
+                   << " 0x" << (int) starter[1] << " 0x" << (int) starter[2]
+                   << " 0x" << (int) starter[3] << " 0x" << (int) starter[4] << std::endl;
+    throw OggException("OggRingbuffer::getNextPageLength: ERROR ogg packet not aligned");
+  }
+
+  if ('\0' != starter[4]) {
+    throw OggException("OggRingbuffer::getNextPageLength: ERROR unsupported stream structure version");
+  }
+
+  //pos = sizeof(OggHeader) - 1; // jump to the segment table
+
+  uint32_t readsegments = m_oggRingbuffer[26];
+
+  logger.debug() << "there are " << readsegments << " segments available in this packet";
+
+  if (availLength < (int) (sizeof(OggHeader) + readsegments)) {
+    return (0);
+  }
+
+  // what is the data length
+  uint32_t data_length(0);
+  uint32_t header_offset(sizeof(OggHeader));
+
+  for (uint32_t i = 0; i < readsegments; ++i) {
+    data_length += m_oggRingbuffer[header_offset + i];
+  }
+
+  uint32_t overallLength = data_length + header_offset  + readsegments;
+  return (overallLength<=availLength?overallLength:0);
+}
\ No newline at end of file
diff --git a/src/base/oggDecoder.h b/src/base/oggDecoder.h
index 79ab658..ab8a89f 100644
--- a/src/base/oggDecoder.h
+++ b/src/base/oggDecoder.h
@@ -30,6 +30,7 @@
 #include "oggPage.h"
 #include "oggRingbuffer.h"
 #include <queue>
+#include <boost/circular_buffer.hpp>
 
 //! class to decode a raw bytestream into Ogg packets
 /*! This class awaits raw packets (in form of a RawMediaPacket). These
@@ -47,10 +48,10 @@
 RawMediaPacket rawPacket;
 OggPage        oggPage;
 
-FileRepository repository("myfile.ogg", MediaUnit::read);
+FileRepository m_repository("myfile.ogg", MediaUnit::read);
 OggDecoder     oggDecoder;
 
-repository >> rawPacket;
+m_repository >> rawPacket;
 oggDecoder << rawPacket;
 
 if (oggDecoder.isAvailable())
@@ -60,8 +61,8 @@ if (oggDecoder.isAvailable())
 class OggDecoder : public MediaDecoder {
 
 protected:
-  OggRingbuffer              oggRingbuffer;
-  std::queue<OggPage>       oggPageList;
+  boost::circular_buffer<uint8_t>  m_oggRingbuffer;
+  std::queue<OggPage>              m_oggPageList;
 
   void getNextPages();
 
@@ -73,9 +74,9 @@ public:
   /*! This method inserts a RawMediaPacket, which is just a bunch of
    *  raw bytes, into the decoder. When a new packet arrives, the
    *  decoder tries to extract the oggPages, which are fully available.
-   *  The oggPages will then be buffered within a oggPageList.
+   *  The oggPages will then be buffered within a m_oggPageList.
    *  The uninterpreted data is stored until the next rawdata is received.
-   *  @param mediaPacket This is the raw media packet, created by a repository.
+   *  @param mediaPacket This is the raw media packet, created by a m_repository.
    *  @return A reference to the actual OggDecoder object.
    * */
   virtual OggDecoder& operator<<(RawMediaPacket& mediaPacket);
@@ -88,6 +89,8 @@ public:
    * */
   virtual OggDecoder& operator>>(OggPage& page);
 
+  uint32_t getNextPageLength();
+
   virtual void clear();
 
   uint32 space();
diff --git a/src/base/oggEncoder.cpp b/src/base/oggEncoder.cpp
index 5235861..3daf949 100644
--- a/src/base/oggEncoder.cpp
+++ b/src/base/oggEncoder.cpp
@@ -80,17 +80,17 @@ OggEncoder& OggEncoder::operator<<(OggPage page)
     return(*this);
   }
   /*
-      uint8  streamNo(page->getStreamNo());
-      double time(oggBuffer[streamNo].interpreter->getTime(page->granulepos()));
+      uint8  m_streamNo(page->getStreamNo());
+      double time(oggBuffer[m_streamNo].interpreter->getTime(page->granulepos()));
 
       double nextTime(-2);
       uint8  nextStreamNo(0);
 
-      while(!oggBuffer[streamNo].empty) {
+      while(!oggBuffer[m_streamNo].m_empty) {
 
         // find the next packet to send out
         for(uint32 i(0); i<oggBuffer.size(); ++i) {
-          if (oggBuffer[i].empty)
+          if (oggBuffer[i].m_empty)
             continue;
           if ((nextTime < -1) || (nextTime > oggBuffer[i].time)) {
             nextTime = oggBuffer[i].time;
@@ -101,15 +101,15 @@ OggEncoder& OggEncoder::operator<<(OggPage page)
         // write page to the output buffer
         serializePage(oggBuffer[nextStreamNo].page);
 
-        // ... and mark the buffer as empty
-        oggBuffer[nextStreamNo].empty = true;
+        // ... and mark the buffer as m_empty
+        oggBuffer[nextStreamNo].m_empty = true;
 
       }
 
     // insert the page into the buffer
-    oggBuffer[streamNo].page     = page;
-    oggBuffer[streamNo].time     = time;
-    oggBuffer[streamNo].empty    = false;
+    oggBuffer[m_streamNo].page     = page;
+    oggBuffer[m_streamNo].time     = time;
+    oggBuffer[m_streamNo].m_empty    = false;
   */
   return(*this);
 }
diff --git a/src/base/oggPacket.cpp b/src/base/oggPacket.cpp
index 970884e..299d4c8 100644
--- a/src/base/oggPacket.cpp
+++ b/src/base/oggPacket.cpp
@@ -22,27 +22,54 @@
 #include <iostream>
 #include <sstream>
 #include <cstring>
+#include <ogg/ogg.h>
 
 #include "oggPacket.h"
-#include "log.h"
 
 OggPacketInternal::OggPacketInternal()
-  : oggPacket {/*packet*/0,/*bytes*/0, /*b_o_s*/0, /*e_o_s*/0, /*granualpos*/-1, /*packetno*/0},
-streamType(OggType::unknown), streamNo(255), streamHeader(false)
+  : m_streamType(OggType::unknown), m_streamNo(255), m_streamHeader(false)
 {
+  // create a packet without any extra data
+  memset(&m_oggPacket,0, sizeof(m_oggPacket));
+  m_oggPacket.granulepos = -1;
+
 }
 
-OggPacketInternal::OggPacketInternal(uint8* data, uint32 length,
+OggPacketInternal::OggPacketInternal(const ogg_packet& pkt)
+  : m_streamType(OggType::unknown), m_streamNo(255), m_streamHeader(false)
+{
+
+  m_oggPacket = pkt;
+
+  // it is unclear, who is the owner of the data!?
+  uint8_t* tmp = new uint8_t [pkt.bytes];
+  memcpy(tmp, pkt.packet, pkt.bytes);
+  m_oggPacket.packet = tmp;
+
+}
+
+OggPacketInternal::OggPacketInternal(uint8 *data, uint32 length,
                                      uint32 packetNo, int64 granulePos, PacketType packetType)
-  : oggPacket {/*packet*/data,/*bytes*/length, /*b_o_s*/0, /*e_o_s*/0, /*granualpos*/granulePos, /*packetno*/packetNo},
-streamType(OggType::unknown), streamNo(255), streamHeader(false)
+  : m_streamType(OggType::unknown), m_streamNo(255), m_streamHeader(false)
 {
+  uint8_t* tmp_data(0);
+
+  tmp_data = new uint8_t[length];
+  memcpy(tmp_data, data, length);
+
+  m_oggPacket.packet     = tmp_data;
+  m_oggPacket.bytes      = length;
+  m_oggPacket.b_o_s      = 0;
+  m_oggPacket.e_o_s      = 0;
+  m_oggPacket.granulepos = granulePos;
+  m_oggPacket.packetno   = packetNo;
+
   switch (packetType) {
   case PacketType::bos:
-    oggPacket.b_o_s = 256;
+    m_oggPacket.b_o_s = 256;
     break;
   case PacketType::eos:
-    oggPacket.e_o_s = 256;
+    m_oggPacket.e_o_s = 256;
     break;
   default: {
   }
@@ -50,29 +77,74 @@ streamType(OggType::unknown), streamNo(255), streamHeader(false)
 
 }
 
-OggPacket OggPacketInternal::clone()
+OggPacketInternal::OggPacketInternal(std::vector<uint8> data, uint32 packetNo, int64 granulePos, PacketType packetType)
+  : m_streamType(OggType::unknown), m_streamNo(255), m_streamHeader(false)
 {
-  /* a bit nasty, as ogg_packet is c */
-  uint8* data = new uint8[oggPacket.bytes];
-  memcpy(data, oggPacket.packet, oggPacket.bytes);
+  uint8_t* tmp_data(0);
+
+  if (data.size() > 0) {
+    tmp_data = new uint8_t[data.size()];
+    memcpy(tmp_data, &data[0], data.size());
+  }
+
+  m_oggPacket.packet     = tmp_data;
+  m_oggPacket.bytes      = data.size();
+  m_oggPacket.b_o_s      = 0;
+  m_oggPacket.e_o_s      = 0;
+  m_oggPacket.granulepos = granulePos;
+  m_oggPacket.packetno   = packetNo;
+
+  switch (packetType) {
+  case PacketType::bos:
+    m_oggPacket.b_o_s = 256;
+    break;
+  case PacketType::eos:
+    m_oggPacket.e_o_s = 256;
+    break;
+  default: {
+  }
+  }
 
-  PacketType packetType(PacketType::normal);
+}
 
-  if (oggPacket.b_o_s)
-    packetType = PacketType::bos;
 
-  if (oggPacket.e_o_s)
-    packetType = PacketType::eos;
 
-  OggPacket pkt = std::make_shared<OggPacketInternal>(data, oggPacket.bytes, oggPacket.packetno, oggPacket.granulepos, packetType);
+OggPacket OggPacketInternal::clone()
+{
+  OggPacket pkt = std::make_shared<OggPacketInternal>(m_oggPacket);
 
-  pkt->streamNo = streamNo;
-  pkt->streamType = streamType;
-  pkt->streamHeader = streamHeader;
+  /* a bit nasty, as ogg_packet is c */
+//  uint8* data = new uint8[m_oggPacket.bytes];
+//  memcpy(data, m_oggPacket.packet, m_oggPacket.bytes);
+//
+//  PacketType packetType(PacketType::normal);
+//
+//  if (m_oggPacket.b_o_s)
+//    packetType = PacketType::bos;
+//
+//  if (m_oggPacket.e_o_s)
+//    packetType = PacketType::eos;
+//
+//  OggPacket pkt = std::make_shared<OggPacketInternal>(data, m_oggPacket.bytes, m_oggPacket.packetno, m_oggPacket.granulepos, packetType);
+//
+//  pkt->m_streamNo = m_streamNo;
+//  pkt->m_streamType = m_streamType;
+//  pkt->m_streamHeader = m_streamHeader;
 
   return pkt;
 }
 
+void OggPacketInternal::liboggDelivery()
+{
+  uint8_t* tmp(new uint8_t [m_oggPacket.bytes]);
+  memcpy(tmp, m_oggPacket.packet, m_oggPacket.bytes);
+  m_oggPacket.packet = tmp;
+
+  // libtheora/libvorbis or whatever - do whatever is neccessary with your memory
+  // I have my copy to use it wherever I like ;-)
+
+}
+
 OggPacket OggPacketInternal::getPtr()
 {
   return shared_from_this();
@@ -81,74 +153,74 @@ OggPacket OggPacketInternal::getPtr()
 OggPacket OggPacketInternal::create(uint8 *data, uint32 length, uint32 packetNo, int64 granulePos, OggPacketInternal::PacketType packetType)
 {
   return std::make_shared<OggPacketInternal>(data, length, packetNo, granulePos, packetType);
-
 }
 
 
 OggPacketInternal::~OggPacketInternal()
 {
-  delete[] oggPacket.packet;
+  if (!m_streamHeader)
+    delete[] m_oggPacket.packet;
 }
 
 
 int64 OggPacketInternal::granulepos()
 {
-  return oggPacket.granulepos;
+  return m_oggPacket.granulepos;
 }
 
 void OggPacketInternal::setGranulepos(int64 pos)
 {
-  oggPacket.granulepos = pos;
+  m_oggPacket.granulepos = pos;
 }
 
 void OggPacketInternal::setStreamHeader()
 {
-  streamHeader = true;
+  m_streamHeader = true;
 }
 
 bool OggPacketInternal::isStreamHeader()
 {
-  return streamHeader;
+  return m_streamHeader;
 }
 
 uint32 OggPacketInternal::getPacketNo()
 {
-  return oggPacket.packetno;
+  return m_oggPacket.packetno;
 }
 
 uint32 OggPacketInternal::length()
 {
-  return oggPacket.bytes;
+  return (uint32) m_oggPacket.bytes;
 }
 
 bool OggPacketInternal::isBOS()
 {
-  return oggPacket.b_o_s;
+  return m_oggPacket.b_o_s != 0;
 }
 
 bool OggPacketInternal::isEOS()
 {
-  return oggPacket.e_o_s;
+  return m_oggPacket.e_o_s != 0;
 }
 
 void OggPacketInternal::setBOS()
 {
-  oggPacket.b_o_s = 1;
+  m_oggPacket.b_o_s = 1;
 }
 
 void OggPacketInternal::setEOS()
 {
-  oggPacket.e_o_s = 1;
+  m_oggPacket.e_o_s = 1;
 }
 
 void OggPacketInternal::unsetBOS()
 {
-  oggPacket.b_o_s = 0;
+  m_oggPacket.b_o_s = 0;
 }
 
 void OggPacketInternal::unsetEOS()
 {
-  oggPacket.e_o_s = 0;
+  m_oggPacket.e_o_s = 0;
 }
 
 /*
@@ -159,62 +231,41 @@ ogg_packet OggPacketInternal::toLibogg()
 */
 uint8 OggPacketInternal::getStreamNo()
 {
-  return streamNo;
+  return m_streamNo;
 }
 
 OggType OggPacketInternal::getStreamType()
 {
-  return streamType;
+  return m_streamType;
 }
 
-void OggPacketInternal::setStreamNo(int8 no)
+void OggPacketInternal::setStreamNo(uint8 no)
 {
-  streamNo = no;
+  m_streamNo = no;
 }
 
 void OggPacketInternal::setStreamType(OggType type)
 {
-  streamType = type;
+  m_streamType = type;
 }
 
-/*
-void OggPacketInternal::fromLibogg(ogg_packet pack)
-{
-  // copy all information including the pointers
-  bytes      = pack.bytes;
-  packetno   = pack.packetno;
-  granulepos = pack.granulepos;
-  b_o_s      = pack.b_o_s;
-  e_o_s      = pack.e_o_s;
-
-  packet = new uint8[pack.bytes];
-
-  if (packet) {
-    memcpy(packet, pack.packet, pack.bytes);
-  }
-  else {
-    logger.error() << "OggPacketInternal::fromLibogg: out of memory\n";
-  }
-}
-*/
-
 uint8* OggPacketInternal::data()
 {
-  return oggPacket.packet;
+  return m_oggPacket.packet;
 }
 
-/* print levels:
+/* toString levels:
  * 1) only data length information
  * 2) header information
  * 3) additional header information
  * 4) header dump
  * 5) body dump
  */
-std::string OggPacketInternal::print(uint8 level)
+std::string OggPacketInternal::toString(uint8 level)
 {
   std::stringstream retStream;
 
-  retStream << "\nOgg Packet: packet length = " << oggPacket.bytes << std::endl;
+  retStream << "\nOgg Packet: packet length = " << m_oggPacket.bytes << std::endl;
 
   if (level < 1)
     return(retStream.str());
@@ -222,30 +273,30 @@ std::string OggPacketInternal::print(uint8 level)
   retStream << "\nHeader Information:"
             << "\n\tBegin of Stream     : ";
 
-  if (oggPacket.b_o_s)
+  if (m_oggPacket.b_o_s)
     retStream << "true";
   else
     retStream << "false";
 
   retStream << "\n\tEnd of Stream       : ";
 
-  if (oggPacket.e_o_s)
+  if (m_oggPacket.e_o_s)
     retStream << "true";
   else
     retStream << "false";
 
-  retStream << "\n\tGranule Position    : " << oggPacket.granulepos;
-  retStream << "\n\tPacket Number       : " << oggPacket.packetno;
+  retStream << "\n\tGranule Position    : " << m_oggPacket.granulepos;
+  retStream << "\n\tPacket Number       : " << m_oggPacket.packetno;
 
   retStream << std::endl;
 
   if (level < 3)
     return(retStream.str());
 
-  retStream << "\n\tStream Number       : " << (int)streamNo;
+  retStream << "\n\tStream Number       : " << (int)m_streamNo;
   retStream << "\n\tStream Type         : ";
 
-  switch (streamType) {
+  switch (m_streamType) {
   case OggType::vorbis:
     retStream << "Vorbis";
     break;
@@ -267,12 +318,15 @@ std::string OggPacketInternal::print(uint8 level)
 
   retStream << "\nPacket Hex dump:" << std::hex;
 
-  for (int32 c(0); c<oggPacket.bytes; ++c) {
-    if ((c%16) == 0)
+  for (int32 c(0); c<m_oggPacket.bytes; ++c) {
+    if ((c%32) == 0)
       retStream << std::endl;
-    if (((unsigned) (oggPacket.packet[c])) < 16)
-      retStream << "0";
-    retStream << (unsigned) (oggPacket.packet[c]);
+    if (((unsigned) (m_oggPacket.packet[c])) < 16)
+      retStream << " 0";
+    else
+      retStream << " ";
+
+    retStream << (unsigned) (m_oggPacket.packet[c]);
   }
 
   retStream << std::dec << std::endl;
diff --git a/src/base/oggPacket.cpp.orig b/src/base/oggPacket.cpp.orig
deleted file mode 100644
index 75f1f57..0000000
--- a/src/base/oggPacket.cpp.orig
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- * OggPacket will carry all relevant information of an ogg packet
- *
- * Copyright (C) 2008 Joern Seger
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include <iostream>
-#include <sstream>
-#include <cstring>
-
-#include "oggPacket.h"
-#include "log.h"
-
-OggPacketInternal::OggPacketInternal()
-  : oggPacket {/*packet*/0,/*bytes*/0, /*b_o_s*/0, /*e_o_s*/0, /*granualpos*/-1, /*packetno*/0},
-streamType(OggType::unknown), streamNo(255), streamHeader(false)
-{
-}
-
-OggPacketInternal::OggPacketInternal(uint8* data, uint32 length,
-                                     uint32 packetNo, int64 granulePos, PacketType packetType)
-  : oggPacket {/*packet*/data,/*bytes*/length, /*b_o_s*/0, /*e_o_s*/0, /*granualpos*/granulePos, /*packetno*/packetNo},
-streamType(OggType::unknown), streamNo(255), streamHeader(false)
-{
-  switch (packetType) {
-  case PacketType::bos:
-    oggPacket.b_o_s = 256;
-    break;
-  case PacketType::eos:
-    oggPacket.e_o_s = 256;
-    break;
-  default:
-  {}
-  }
-
-}
-
-OggPacket OggPacketInternal::clone()
-{
-  /* a bit nasty, as ogg_packet is c */
-  uint8* data = new uint8[oggPacket.bytes];
-  memcpy(data, oggPacket.packet, oggPacket.bytes);
-
-  PacketType packetType(PacketType::normal);
-
-  if (oggPacket.b_o_s)
-    packetType = PacketType::bos;
-
-  if (oggPacket.e_o_s)
-    packetType = PacketType::eos;
-
-  OggPacket pkt = std::make_shared<OggPacketInternal>(data, oggPacket.bytes, oggPacket.packetno, oggPacket.granulepos, packetType);
-
-  pkt->streamNo = streamNo;
-  pkt->streamType = streamType;
-  pkt->streamHeader = streamHeader;
-
-  return pkt;
-}
-
-OggPacket OggPacketInternal::getPtr()
-{
-  return shared_from_this();
-}
-
-OggPacket OggPacketInternal::create(uint8 *data, uint32 length, uint32 packetNo, int64 granulePos, OggPacketInternal::PacketType packetType)
-{
-  return std::make_shared<OggPacketInternal>(data, length, packetNo, granulePos, packetType);
-
-}
-
-
-OggPacketInternal::~OggPacketInternal()
-{
-  delete[] oggPacket.packet;
-}
-
-
-int64 OggPacketInternal::granulepos()
-{
-  return oggPacket.granulepos;
-}
-
-void OggPacketInternal::setGranulepos(int64 pos)
-{
-  oggPacket.granulepos = pos;
-}
-
-void OggPacketInternal::setStreamHeader()
-{
-  streamHeader = true;
-}
-
-bool OggPacketInternal::isStreamHeader()
-{
-  return streamHeader;
-}
-
-uint32 OggPacketInternal::getPacketNo()
-{
-  return oggPacket.packetno;
-}
-
-uint32 OggPacketInternal::length()
-{
-  return oggPacket.bytes;
-}
-
-bool OggPacketInternal::isBOS()
-{
-  return oggPacket.b_o_s;
-}
-
-bool OggPacketInternal::isEOS()
-{
-  return oggPacket.e_o_s;
-}
-
-void OggPacketInternal::setBOS()
-{
-  oggPacket.b_o_s = 1;
-}
-
-void OggPacketInternal::setEOS()
-{
-  oggPacket.e_o_s = 1;
-}
-
-void OggPacketInternal::unsetBOS()
-{
-  oggPacket.b_o_s = 0;
-}
-
-void OggPacketInternal::unsetEOS()
-{
-  oggPacket.e_o_s = 0;
-}
-
-/*
-ogg_packet OggPacketInternal::toLibogg()
-{
-  return(*objPtr);
-}
-*/
-uint8 OggPacketInternal::getStreamNo()
-{
-  return streamNo;
-}
-
-OggType OggPacketInternal::getStreamType()
-{
-  return streamType;
-}
-
-void OggPacketInternal::setStreamNo(int8 no)
-{
-  streamNo = no;
-}
-
-void OggPacketInternal::setStreamType(OggType type)
-{
-  streamType = type;
-}
-
-/*
-void OggPacketInternal::fromLibogg(ogg_packet pack)
-{
-  // copy all information including the pointers
-  bytes      = pack.bytes;
-  packetno   = pack.packetno;
-  granulepos = pack.granulepos;
-  b_o_s      = pack.b_o_s;
-  e_o_s      = pack.e_o_s;
-
-  packet = new uint8[pack.bytes];
-
-  if (packet) {
-    memcpy(packet, pack.packet, pack.bytes);
-  }
-  else {
-    logger.error() << "OggPacketInternal::fromLibogg: out of memory\n";
-  }
-}
-*/
-
-uint8* OggPacketInternal::data()
-{
-  return oggPacket.packet;
-}
-
-/* print levels:
- * 1) only data length information
- * 2) header information
- * 3) additional header information
- * 4) header dump
- * 5) body dump
- */
-std::string OggPacketInternal::print(uint8 level)
-{
-  std::stringstream retStream;
-
-  retStream << "\nOgg Packet: packet length = " << oggPacket.bytes << std::endl;
-
-  if (level < 1)
-    return(retStream.str());
-
-  retStream << "\nHeader Information:"
-            << "\n\tBegin of Stream     : ";
-
-  if (oggPacket.b_o_s)
-    retStream << "true";
-  else
-    retStream << "false";
-
-  retStream << "\n\tEnd of Stream       : ";
-
-  if (oggPacket.e_o_s)
-    retStream << "true";
-  else
-    retStream << "false";
-
-  retStream << "\n\tGranule Position    : " << oggPacket.granulepos;
-  retStream << "\n\tPacket Number       : " << oggPacket.packetno;
-
-  retStream << std::endl;
-
-  if (level < 3)
-    return(retStream.str());
-
-  retStream << "\n\tStream Number       : " << (int)streamNo;
-  retStream << "\n\tStream Type         : ";
-
-  switch (streamType) {
-  case OggType::vorbis:
-    retStream << "Vorbis";
-    break;
-  case OggType::theora:
-    retStream << "Theora";
-    break;
-  case OggType::kate:
-    retStream << "Kate";
-    break;
-  case OggType::unknown:
-  default:
-    retStream << "unknown";
-    break;
-  }
-  retStream << std::endl;
-
-  if (level < 4)
-    return(retStream.str());
-
-  retStream << "\nPacket Hex dump:" << std::hex;
-
-  for (int32 c(0); c<oggPacket.bytes; ++c) {
-    if ((c%16) == 0)
-      retStream << std::endl;
-    if (((unsigned) (oggPacket.packet[c])) < 16)
-      retStream << "0";
-    retStream << (unsigned) (oggPacket.packet[c]);
-  }
-
-  retStream << std::dec << std::endl;
-
-  return(retStream.str());
-}
diff --git a/src/base/oggPacket.h b/src/base/oggPacket.h
index def30c3..88f2a4d 100644
--- a/src/base/oggPacket.h
+++ b/src/base/oggPacket.h
@@ -24,6 +24,7 @@
 
 #include <string>
 #include <memory>
+#include <vector>
 
 #ifdef HAVE_LIBOGG
 #include <ogg/ogg.h>
@@ -48,26 +49,27 @@ public:
   };
 
 protected:
-  ogg_packet oggPacket;
+  ogg_packet m_oggPacket;
 
   /* information about the stream type and the stream No */
-  OggType streamType;
-  uint8   streamNo;
-  bool    streamHeader;
+  OggType m_streamType;
+  uint8   m_streamNo;
+  bool    m_streamHeader;
 
 public:
   OggPacketInternal();
+  OggPacketInternal(const ogg_packet& ogg_p);
   OggPacketInternal(uint8* data, uint32 length, uint32 packetNo,
                     int64 granulePos=-1, PacketType packetType = PacketType::normal);
+  OggPacketInternal(std::vector<uint8> data, uint32 packetNo, int64 granulePos, PacketType packetType);
 
-  ~OggPacketInternal();
+  virtual ~OggPacketInternal();
 
   OggPacket clone();
   OggPacket getPtr();
   static OggPacket create(uint8* data, uint32 length, uint32 packetNo,
                           int64 granulePos=-1, PacketType packetType = PacketType::normal);
 
-
   int64   granulepos();
 
   void    setGranulepos(int64 pos);
@@ -75,14 +77,13 @@ public:
   uint32  getPacketNo();
   uint8   getStreamNo();
   OggType getStreamType();
-  ogg_packet* getUnderlayingOggPacketPtr()
-  {
-    return &oggPacket;
+  ogg_packet* getUnderlayingOggPacketPtr() {
+    return &m_oggPacket;
   }
-//  void    cleanPacketPtr() { oggPacket.packet = 0; /* no delete */ }
+//  void    cleanPacketPtr() { m_oggPacket.packet = 0; /* no delete */ }
 
   void    setStreamType(OggType type);
-  void    setStreamNo(int8 streamNo);
+  void    setStreamNo(uint8 streamNo);
   void    setStreamHeader();
 
   bool    isBOS();
@@ -94,11 +95,12 @@ public:
   void    setEOS();
   void    unsetEOS();
 
-  void    setPacketno(int64_t no)
-  {
-    oggPacket.packetno = no;
+  void    setPacketno(int64_t no) {
+    m_oggPacket.packetno = no;
   }
 
+  void liboggDelivery();
+
   uint32 length();
   uint8* data();
 
@@ -107,7 +109,7 @@ public:
     void fromLibogg(ogg_packet packet);
   */
 
-  std::string print(uint8 level);
+  std::string toString(uint8 level);
 
 };
 
diff --git a/src/base/oggPage.cpp b/src/base/oggPage.cpp
index d28ce59..7a75471 100644
--- a/src/base/oggPage.cpp
+++ b/src/base/oggPage.cpp
@@ -29,14 +29,14 @@
 /* OggPageInternal */
 
 OggPageInternal::OggPageInternal()
-  : dataPtr(0), headerLength(0), bodyLength(0), streamNo(255), empty(true)
+  : m_dataPtr(0), m_headerLength(0), m_bodyLength(0), m_streamNo(255), m_empty(true)
 {
 }
 
 OggPageInternal::OggPageInternal(std::vector<uint8_t>& _dataPtr, uint32 _headerLength, uint32 _bodyLength)
-  : headerLength(_headerLength), bodyLength(_bodyLength),  streamNo(255), empty(false)
+  : m_headerLength(_headerLength), m_bodyLength(_bodyLength),  m_streamNo(255), m_empty(false)
 {
-  dataPtr = std::move(_dataPtr);
+  m_dataPtr = _dataPtr;
 }
 
 OggPageInternal::~OggPageInternal()
@@ -46,64 +46,64 @@ OggPageInternal::~OggPageInternal()
 
 bool OggPageInternal::isContinued()
 {
-  return(((OggHeader*)(&dataPtr[0]))->pack_type);
+  return(((OggHeader*)(&m_dataPtr[0]))->pack_type);
 }
 
 void OggPageInternal::setContinued()
 {
-  ((OggHeader*)(&dataPtr[0]))->pack_type = 1;
+  ((OggHeader*)(&m_dataPtr[0]))->pack_type = 1;
 }
 
 bool OggPageInternal::isBOS()
 {
-  return(((OggHeader*)(&dataPtr[0]))->page_type);
+  return(((OggHeader*)(&m_dataPtr[0]))->page_type);
 }
 
 bool OggPageInternal::isEOS()
 {
-  return(((OggHeader*)(&dataPtr[0]))->last);
+  return(((OggHeader*)(&m_dataPtr[0]))->last);
 }
 
 void OggPageInternal::setBOS()
 {
-  ((OggHeader*)(&dataPtr[0]))->page_type = 1;
+  ((OggHeader*)(&m_dataPtr[0]))->page_type = 1;
 }
 
 void OggPageInternal::unsetBOS()
 {
-  ((OggHeader*)(&dataPtr[0]))->page_type = 0;
+  ((OggHeader*)(&m_dataPtr[0]))->page_type = 0;
 }
 
 void OggPageInternal::setEOS()
 {
-  ((OggHeader*)(&dataPtr[0]))->last = 1;
+  ((OggHeader*)(&m_dataPtr[0]))->last = 1;
 }
 
 void OggPageInternal::unsetEOS()
 {
-  ((OggHeader*)(&dataPtr[0]))->last = 0;
+  ((OggHeader*)(&m_dataPtr[0]))->last = 0;
 }
 
 void OggPageInternal::setStreamNo(uint8 streamNo)
 {
-  streamNo = streamNo;
+  m_streamNo = streamNo;
 }
 
 uint8 OggPageInternal::getStreamNo()
 {
-  return(streamNo);
+  return(m_streamNo);
 }
 
 uint32 OggPageInternal::version()
 {
-  return(((OggHeader*)(&dataPtr[0]))->version);
+  return(((OggHeader*)(&m_dataPtr[0]))->version);
 }
 
 uint32 OggPageInternal::packets()
 {
-  uint32 segments(((OggHeader*)(&dataPtr[0]))->tableSegments);
+  uint32 segments(((OggHeader*)(&m_dataPtr[0]))->tableSegments);
   uint32 packets(0);
-  uint8* oggPtr=&dataPtr[0]+sizeof(OggHeader);
+  uint8* oggPtr=&m_dataPtr[0]+sizeof(OggHeader);
 
   for (uint32 i(0); i<segments; ++i)
     if (oggPtr[i]<0xff)packets++;
@@ -114,50 +114,48 @@ uint32 OggPageInternal::packets()
 
 int64 OggPageInternal::granulepos()
 {
-  return(((OggHeader*)(&dataPtr[0]))->position);
+  return(((OggHeader*)(&m_dataPtr[0]))->position);
 }
 
 uint32 OggPageInternal::serialno()
 {
-  return(((OggHeader*)(&dataPtr[0]))->serial);
+  return(((OggHeader*)(&m_dataPtr[0]))->serial);
 }
 
 uint32 OggPageInternal::pageno()
 {
-  return(((OggHeader*)(&dataPtr[0]))->pageNo);
+  return(((OggHeader*)(&m_dataPtr[0]))->pageNo);
 }
 
 uint32 OggPageInternal::length()
 {
-  return(headerLength + bodyLength);
+  return(m_headerLength + m_bodyLength);
 }
 
 std::vector<uint8_t>& OggPageInternal::data()
 {
-  return(dataPtr);
+  return(m_dataPtr);
 }
 
 bool OggPageInternal::isEmpty()
 {
-  return(empty);
+  return(m_empty);
 }
 
 void OggPageInternal::createCRC()
 {
-  OggHeader* hdr = (OggHeader*)(&dataPtr[0]);
+  OggHeader* hdr = (OggHeader*)(&m_dataPtr[0]);
   hdr->checksum  = 0;
-  hdr->checksum  = Crc::create(&dataPtr[0], length());
+  hdr->checksum  = Crc::create(&m_dataPtr[0], length());
 }
 
 OggPage OggPageInternal::clone()
 {
   OggPage page;
 
-  if (!dataPtr.empty()) {
+  if (!m_dataPtr.empty()) {
 
-    std::vector<uint8_t> newDataPtr = dataPtr;
-
-    page = std::make_shared<OggPageInternal>(newDataPtr, headerLength, bodyLength);
+    page = std::make_shared<OggPageInternal>(m_dataPtr, m_headerLength, m_bodyLength);
 
   }
 
@@ -180,25 +178,25 @@ OggPage OggPageInternal::getPtr()
   return shared_from_this();
 }
 
-/* print levels:
+/* toString levels:
  * 0) only data length information
  * 1) header information
  * 2) additional header information
  * 3) header dump
  * 4) body dump
  */
-std::string OggPageInternal::print(uint8 level)
+std::string OggPageInternal::toString(uint8 level)
 {
   std::stringstream retStream;
 
-  retStream << "Ogg Page: header length = " << std::dec << headerLength
-            << " and body length = " << std::dec << bodyLength
+  retStream << "Ogg Page: header length = " << std::dec << m_headerLength
+            << " and body length = " << std::dec << m_bodyLength
             << std::endl;
 
   if (level < 1)
     return(retStream.str());
 
-  OggHeader* header = (OggHeader*)(&dataPtr[0]);
+  OggHeader* header = (OggHeader*)(&m_dataPtr[0]);
   retStream << "Header Information:"
             << "\n\tOgg Version      : " << (uint32)header->version
             << "\n\tSerial No        : 0x" << std::hex << header->serial << std::dec
@@ -238,9 +236,9 @@ std::string OggPageInternal::print(uint8 level)
     if ((c%16) == 0)
       retStream << std::endl;
     retStream << " "<< std::hex;
-    if (((unsigned int) (dataPtr[c+sizeof(OggHeader)])) < 16)
+    if (((unsigned int) (m_dataPtr[c+sizeof(OggHeader)])) < 16)
       retStream << "0";
-    retStream << (unsigned int) (dataPtr[c+sizeof(OggHeader)]);
+    retStream << (unsigned int) (m_dataPtr[c+sizeof(OggHeader)]);
   }
 
   retStream << std::endl << std::endl;
@@ -249,13 +247,13 @@ std::string OggPageInternal::print(uint8 level)
     return(retStream.str());
 
   retStream << "Header Hex dump: ";
-  for (uint32 c(0); c<headerLength; ++c) {
+  for (uint32 c(0); c<m_headerLength; ++c) {
     if ((c%16) == 0)
       retStream << std::endl;
     retStream << " " << std::hex;
-    if (((unsigned int) (dataPtr[c])) < 16)
+    if (((unsigned int) (m_dataPtr[c])) < 16)
       retStream << "0";
-    retStream << (unsigned int) (dataPtr[c]);
+    retStream << (unsigned int) (m_dataPtr[c]);
   }
   retStream << std::dec << std::endl << std::endl;
 
@@ -264,13 +262,13 @@ std::string OggPageInternal::print(uint8 level)
 
   retStream << "Body Hex dump: ";
 
-  for (uint32 c(0); c<bodyLength; ++c) {
-    if ((c%16) == 0)
+  for (uint32 c(0); c<m_bodyLength; ++c) {
+    if ((c%32) == 0)
       retStream << std::endl;
     retStream << " " << std::hex;
-    if (((unsigned int) (dataPtr[c+headerLength])) < 16)
+    if (((unsigned int) (m_dataPtr[c+m_headerLength])) < 16)
       retStream << "0";
-    retStream << (unsigned int) (dataPtr[c+headerLength]);
+    retStream << (unsigned int) (m_dataPtr[c+m_headerLength]);
   }
 
   retStream << std::dec << std::endl;
diff --git a/src/base/oggPage.h b/src/base/oggPage.h
index 59d0af0..853404e 100644
--- a/src/base/oggPage.h
+++ b/src/base/oggPage.h
@@ -39,19 +39,12 @@ class OggPageInternal : public std::enable_shared_from_this<OggPageInternal> {
 
 protected:
   //! pointer to the packet data
-  std::vector<uint8_t> dataPtr;
+  std::vector<uint8_t> m_dataPtr;
 
-  //! header length
-  uint32 headerLength;
-
-  //! body length
-  uint32 bodyLength;
-
-  //! internal information: number of stream associated by the decoder
-  uint8 streamNo;
-
-  //! internal information: unused page
-  bool  empty;
+  uint32 m_headerLength;
+  uint32 m_bodyLength;
+  uint8  m_streamNo;
+  bool   m_empty;
 
 public:
 
@@ -95,16 +88,15 @@ public:
 
   uint32   length();
   std::vector<uint8_t>&   data();
-  uint32   getHeaderLength()
-  {
-    return headerLength;
+  uint32   getHeaderLength() {
+    return m_headerLength;
   }
 
   OggPage  clone();
   OggPage  create(std::vector<uint8_t>& data, uint32_t headerLength, uint32_t bodyLength);
   OggPage  getPtr();
 
-  std::string print(uint8 level);
+  std::string toString(uint8 level);
 
 };
 
diff --git a/src/base/oggStreamDecoder.cpp b/src/base/oggStreamDecoder.cpp
index 5ac3962..0df3011 100644
--- a/src/base/oggStreamDecoder.cpp
+++ b/src/base/oggStreamDecoder.cpp
@@ -53,24 +53,24 @@ void OggStreamDecoder::init(OggPage page)
     return;
   }
 
-  packetCount = 0;
+  m_packetCount = 0;
 
   /* extract and remember the serial number of this stream */
-  serialNo = page->serialno();
+  m_serialNo = page->serialno();
   setConfigured();
 
 }
 
 void OggStreamDecoder::clear()
 {
-  delete[] tmpSegment.data;
-  tmpSegment.data = 0;
-  tmpSegment.length = 0;
+  delete[] m_tmpSegment.data;
+  m_tmpSegment.data = 0;
+  m_tmpSegment.length = 0;
 }
 
 uint32 OggStreamDecoder::getSerialNo()
 {
-  return(serialNo);
+  return(m_serialNo);
 }
 
 OggStreamDecoder& OggStreamDecoder::operator<<(OggPage& page)
@@ -84,7 +84,7 @@ OggStreamDecoder& OggStreamDecoder::operator<<(OggPage& page)
     throw OggException("OggStreamDecoder::operator<<: This stream is not is not configured yet");
   }
 
-  if (page->serialno() != serialNo) {
+  if (page->serialno() != m_serialNo) {
     throw OggException("OggStreamDecoder::operator<<: page does not belong to this stream");
   }
 
@@ -141,22 +141,22 @@ OggStreamDecoder& OggStreamDecoder::operator<<(OggPage& page)
 
   for (unsigned int i(0); i<segmentDataList.size(); ++i) {
 
-    uint32 overallLength = tmpSegment.length+segmentDataList[i].length;
+    uint32 overallLength = m_tmpSegment.length+segmentDataList[i].length;
     unsigned char* newPacketPtr = new unsigned char[overallLength];
 
-    if (tmpSegment.length)
-      memcpy(newPacketPtr,tmpSegment.data, tmpSegment.length);
+    if (m_tmpSegment.length)
+      memcpy(newPacketPtr, m_tmpSegment.data, m_tmpSegment.length);
 
-    memcpy(newPacketPtr+tmpSegment.length, segmentDataList[i].data, segmentDataList[i].length);
+    memcpy(newPacketPtr+m_tmpSegment.length, segmentDataList[i].data, segmentDataList[i].length);
 
     // delete the temporary Segment
-    if (tmpSegment.data) {
-      delete[] tmpSegment.data;
-      tmpSegment = SegmentElement();
+    if (m_tmpSegment.data) {
+      delete[] m_tmpSegment.data;
+      m_tmpSegment = SegmentElement();
     }
     if ((i == (segmentDataList.size()-1)) && willBeContinued) {
       //store last segment as it is does not end here
-      tmpSegment = SegmentElement(newPacketPtr, overallLength);
+      m_tmpSegment = SegmentElement(newPacketPtr, overallLength);
     } else {
       // we found a full packet
       OggPacketInternal::PacketType packetType(OggPacketInternal::PacketType::normal);
@@ -172,13 +172,14 @@ OggStreamDecoder& OggStreamDecoder::operator<<(OggPage& page)
         granulePosition = header->position;
 
       /* create the packet */
-      OggPacket packet(new OggPacketInternal(newPacketPtr, overallLength, packetCount++, granulePosition, packetType));
+      OggPacket packet(new OggPacketInternal(newPacketPtr, overallLength, m_packetCount++, granulePosition, packetType));
+      delete[] newPacketPtr;
 
-      oggPacketList.push_back(packet);
+      m_oggPacketList.push_back(packet);
     }
   }
 
-  if (!oggPacketList.empty())
+  if (!m_oggPacketList.empty())
     setAvailable();
 
   return(*this);
@@ -193,7 +194,7 @@ OggPacket OggStreamDecoder::inspectNextPacket()
   }
 
   // we will not harm the list in any kind
-  packet = oggPacketList.front();
+  packet = m_oggPacketList.front();
 
   return (packet);
 }
@@ -204,15 +205,15 @@ OggStreamDecoder& OggStreamDecoder::operator>>(OggPacket& packet)
     throw OggException("OggStreamDecoder::operator>>: no packet available");
   }
 
-  packet = oggPacketList.front();
-  oggPacketList.pop_front();
+  packet = m_oggPacketList.front();
+  m_oggPacketList.pop_front();
 
   /* is this the last packet within this stream,
    * then set the stream status */
   if (packet->isEOS()) {
     setEndOfStream();
   } else {
-    if (oggPacketList.empty()) {
+    if (m_oggPacketList.empty()) {
       setEmpty();
     }
   }
diff --git a/src/base/oggStreamDecoder.h b/src/base/oggStreamDecoder.h
index 603f7b2..e2ca59f 100644
--- a/src/base/oggStreamDecoder.h
+++ b/src/base/oggStreamDecoder.h
@@ -44,10 +44,10 @@ protected:
     SegmentElement(uint8* data=0, uint32 length=0);
   };
 
-  uint32                 packetCount;
-  uint32                 serialNo;
-  SegmentElement         tmpSegment;
-  std::list<OggPacket>   oggPacketList;
+  uint32                 m_packetCount;
+  uint32                 m_serialNo;
+  SegmentElement         m_tmpSegment;
+  std::list<OggPacket>   m_oggPacketList;
 
   void init(OggPage page);
 
diff --git a/src/base/oggStreamEncoder.cpp b/src/base/oggStreamEncoder.cpp
index 07c36de..808a5bd 100644
--- a/src/base/oggStreamEncoder.cpp
+++ b/src/base/oggStreamEncoder.cpp
@@ -33,29 +33,29 @@
 #define min(a,b) ((a<b)?(a):(b))
 #define max(a,b) ((a>b)?(a):(b))
 
-std::vector<uint32> OggStreamEncoder::usedSerialNo;
+std::vector<uint32> OggStreamEncoder::m_usedSerialNo;
 
 OggStreamEncoder::OggStreamEncoder(uint32 serial)
-  : maxPageSize(4096), streamNo(0), dataLength(0), dataSegments(0), usedData(0), pageCounter(0)
+  : m_maxPageSize(4096), m_streamNo(0), m_segmentsBuffer(maxSegmentEntries), m_dataLength(0), m_dataSegments(0), m_usedData(0), m_pageCounter(0)
 //   packetCounter(0), positionInterpreterEnabled(false), pageKeepEnabled(false),
   //posInterpreter(0)
 {
   uint32 newSerial = findUniqueSerial(serial);
-  streamSerialNo = newSerial;
+  m_streamSerialNo = newSerial;
   setInitialized();
 }
 
 OggStreamEncoder::~OggStreamEncoder()
 {
-  if (!oggPacketList.empty())
-    logger.warning() << "OggStreamEncoder::Destructor: WARNING packet list not empty ("<<oggPacketList.size()<<" Elements)\n";
+  if (!m_oggPacketList.empty())
+    logger.warning() << "OggStreamEncoder::Destructor: WARNING packet list not m_empty ("<<m_oggPacketList.size()<<" Elements)\n";
 
-  if (!oggPageList.empty())
-    logger.warning() << "OggStreamEncoder::Destructor: WARNING page list not empty\n";
+  if (!m_oggPageList.empty())
+    logger.warning() << "OggStreamEncoder::Destructor: WARNING page list not m_empty\n";
 
 }
 
-// we need a global repository to keep an Eye on the serial numbers
+// we need a global m_repository to keep an Eye on the serial numbers
 uint32 OggStreamEncoder::findUniqueSerial(uint32 origSerial)
 {
   bool isUnique(false);
@@ -66,11 +66,11 @@ uint32 OggStreamEncoder::findUniqueSerial(uint32 origSerial)
     isUnique   = true;
     origSerial = 0;
 
-    for (uint32 i(0); i<usedSerialNo.size(); ++i)
-      if (serial == usedSerialNo[i])
+    for (uint32 i(0); i<m_usedSerialNo.size(); ++i)
+      if (serial == m_usedSerialNo[i])
         isUnique = false;
   }
-  usedSerialNo.push_back(serial);
+  m_usedSerialNo.push_back(serial);
   return(serial);
 }
 
@@ -96,9 +96,9 @@ void OggStreamEncoder::addPacket(OggPacket& packet)
   */
   /* This is a normal packet
    * Let's start to calculate the actual length */
-  oggPacketList.push_back(packet);
+  m_oggPacketList.push_back(packet);
 
-  dataLength             += packet->length();
+  m_dataLength             += packet->length();
   uint32 actSegmentsSize  = (packet->length()+255)/255;
   std::vector<uint8_t> actSegments(actSegmentsSize/*maxSegmentEntries*/, 0xff);
   //uint8  actSegments[maxSegmentEntries];
@@ -110,7 +110,7 @@ void OggStreamEncoder::addPacket(OggPacket& packet)
 //  memset(actSegments, 0xff, actSegmentsSize-1);
   actSegments[actSegmentsSize-1] = packet->length()%255;
 
-  segmentsBuffer.addData(actSegments, actSegmentsSize);
+  m_segmentsBuffer.insert(m_segmentsBuffer.end(), actSegments.begin(), actSegments.end());
 
 }
 
@@ -122,37 +122,32 @@ bool OggStreamEncoder::getNextPacketLength(uint32 pageBorder, uint32& length,
   segments = 0;
 
   /* if the data length is in range, do nothing */
-  if ((dataLength < pageBorder) && (segmentsBuffer.getUsed() < 255)) {
-    return(false);
+  if ((m_dataLength < pageBorder) && (m_segmentsBuffer.size() < 255)) {
+    return false;
   }
 
-  /* get the actually available segments (maximum 255) */
-//  uint8 actSegments[255];
-  std::vector<uint8_t> actSegments(255);
-  uint32 actSegmentsSize = segmentsBuffer.peekFront(actSegments,255);
+  uint32_t allSegLength=0;
+  for(uint32_t tmpLen : m_segmentsBuffer) {
+    allSegLength += tmpLen;
+  }
+  //logger.info() << "\nsegments: "<< m_segmentsBuffer.size()<< "len: "<<allSegLength<< " data length: "<< m_dataLength<<"\n";
+
 
   /* and calculate, how many segments we want to include into the
    * actual page */
   bool end_found(false);
-  for (auto& actSegment : actSegments ) { //uint32 count(0); count<actSegmentsSize; ++count) {
-
+  for (uint32_t i(0); i<m_segmentsBuffer.size(); ++i) {
+    length  += m_segmentsBuffer[i];
     segments++;
-    if (end_found) {
-      if (actSegment == 0)
-        continue;
-      else
+    if ((length >= pageBorder) || (segments >= 254)) {
+      if ((i+1 == m_segmentsBuffer.size()) || (m_segmentsBuffer[i+1] != 0)) { // this is due to an empty (0) segment
         break;
-    }
-
-    length  += actSegment;// actSegments[count];
-
-    if ((length >= pageBorder) || (segments >= 255)) {
-      // this is a "sonderlocke" for zero size segments
-      end_found = true;
+      }
     }
   }
 
-  return(true);
+  return true;
+
 }
 
 OggStreamEncoder& OggStreamEncoder::operator<<(OggPacket packet)
@@ -170,7 +165,7 @@ OggStreamEncoder& OggStreamEncoder::operator<<(OggPacket packet)
       return(*this);
     } else {
       // The first BOS packet defines the stream number
-      streamNo = packet->getStreamNo();
+      m_streamNo = packet->getStreamNo();
     }
     /* add the packet to the temporal buffer */
     addPacket(packet);
@@ -188,8 +183,8 @@ OggStreamEncoder& OggStreamEncoder::operator<<(OggPacket packet)
   addPacket(packet);
 
   /* create as many packets as data is available */
-  while ((dataLength >= maxPageSize) || (segmentsBuffer.getUsed() >= 255)) {
-    createPage(maxPageSize);
+  while ((m_dataLength >= m_maxPageSize) || (m_segmentsBuffer.size() >= 255)) {
+    createPage(m_maxPageSize);
   }
 
   return(*this);
@@ -202,12 +197,12 @@ OggStreamEncoder& OggStreamEncoder::operator>>(OggPage& page)
     return(*this);
   }
 
-  page = oggPageList.front();
-  oggPageList.pop_front();
+  page = m_oggPageList.front();
+  m_oggPageList.pop_front();
 
-  page->setStreamNo(streamNo);
+  page->setStreamNo(m_streamNo);
 
-  if (oggPageList.empty())
+  if (m_oggPageList.empty())
     setEmpty();
 
 
@@ -217,8 +212,8 @@ OggStreamEncoder& OggStreamEncoder::operator>>(OggPage& page)
 
 void OggStreamEncoder::flush()
 {
-  while (dataLength || (segmentsBuffer.getUsed() > 0)) {
-    createPage(dataLength);
+  while (m_dataLength || (m_segmentsBuffer.size() > 0)) {
+    createPage(m_dataLength);
   }
 }
 
@@ -247,39 +242,41 @@ void OggStreamEncoder::createPage(uint32 minPageSize)
   uint8*     body     (segments+segmentsSize);
 
   /* set the header information */
-#ifdef HAVE_BZERO
-  bzero(header,sizeof(OggHeader));
-#else
-  for (uint32 i(0); i<sizeof(OggHeader); ++i) *(((uint8*)header)+i) = 0;
-#endif
+  memset(header, 0x00, sizeof(OggHeader));
 
   memcpy(header->ogg,"OggS",4);
   header->tableSegments = segmentsSize;
-  header->pageNo        = pageCounter++;
-  header->serial        = streamSerialNo;
+  header->pageNo        = m_pageCounter++;
+  header->serial        = m_streamSerialNo;
   header->position      = -1;
 
-  if (usedData)
-    header->pack_type   = 1; // is packet starts on the previous page
+  if (m_usedData)
+    header->pack_type   = 1; // packet starts on the previous page
 
   /* fill the segments */
-  segmentsBuffer.getData(segments,segmentsSize);
+  for (uint32_t i(0); i<segmentsSize; ++i)
+    segments[i] = m_segmentsBuffer[i];
 
-  std::list<OggPacket>::iterator it(oggPacketList.begin());
+  m_segmentsBuffer.erase_begin(segmentsSize);
+
+  std::list<OggPacket>::iterator it(m_oggPacketList.begin());
 
   /* if this is a bos packet, this would surely be the first packet */
   if ((*it)->isBOS())
     header->page_type = 1;
 
   uint32 arrayIndex(0);
+  logger.debug() << "OggStreamEncoder::create_page: packet length="<< overallLength <<"\n";
 
-  for (; it != oggPacketList.end(); it++) {
+  for (; it != m_oggPacketList.end(); it++) {
 
     OggPacket pkt(*it);
     uint32 packetLength = pkt->length();
-    uint32 cpyLength = min((packetLength-usedData),(bodyLength-arrayIndex));
+    uint32 cpyLength = min((packetLength-m_usedData),(bodyLength-arrayIndex));
+
+    logger.debug() << "OggStreamEncoder::create_page: copyLength="<<cpyLength<<" arrayIndex="<<arrayIndex<<" m_usedData="<<m_usedData<<"\n";
 
-    memcpy(body+arrayIndex, pkt->data()+usedData, cpyLength);
+    memcpy(body+arrayIndex, pkt->data()+m_usedData, cpyLength);
     arrayIndex += cpyLength;
 
     /* is this the end of the actual page */
@@ -287,10 +284,10 @@ void OggStreamEncoder::createPage(uint32 minPageSize)
 
       /* the packet does not start within this page and does not end
        * on this page? */
-      if (usedData != 0) {
-        usedData += cpyLength;
-        if (usedData == packetLength) {
-          usedData = 0;
+      if (m_usedData != 0) {
+        m_usedData += cpyLength;
+        if (m_usedData == packetLength) {
+          m_usedData = 0;
           if (pkt->isEOS())
             header->last = 1;
 
@@ -304,7 +301,7 @@ void OggStreamEncoder::createPage(uint32 minPageSize)
         if (cpyLength == packetLength) {
 
           /* this packet ended on this page */
-          usedData = 0;
+          m_usedData = 0;
 
           /* at lease the actual Packet has been completed on this page */
 //          onePacketCompleted = true;
@@ -318,22 +315,22 @@ void OggStreamEncoder::createPage(uint32 minPageSize)
 
         } else {
           /* keep the number of copied bytes for the next page */
-          usedData = cpyLength;
+          m_usedData = cpyLength;
         }
       }
 
       // we found the end of the page
-      if (usedData || it == oggPacketList.end())
+      if (m_usedData || it == m_oggPacketList.end())
         break;
     }
 
-    usedData = 0;
+    m_usedData = 0;
   }
 
 #ifdef DEBUG
-  if ( arrayIndex != bodyLength ) {
-    logger.error() << "ERROR: array not matching ( index "<<arrayIndex <<" bodylength "<<bodyLength << ")\n";
-    logger.error() << "SegmentsSize: "<<(int)segmentsSize<< " still available: "<<(int)segmentsBuffer.getUsed()<<"\n";
+  if ( arrayIndex != m_bodyLength ) {
+    logger.error() << "ERROR: array not matching ( index "<<arrayIndex <<" bodylength "<<m_bodyLength << ")\n";
+    logger.error() << "SegmentsSize: "<<(int)segmentsSize<< " still available: "<<(int)m_segmentsBuffer.getUsed()<<"\n";
     for (uint32 i(0); i<segmentsSize; ++i)
       logger.error() << " 0x"<<(int)segments[i];
     logger.error() << "\n";
@@ -344,19 +341,19 @@ void OggStreamEncoder::createPage(uint32 minPageSize)
   /* set the granule position if at least one packet has ended on this page
    * The position is taken from the last full packet
    */
-  if (oggPacketList.begin() != it) {
+  if (m_oggPacketList.begin() != it) {
     std::list<OggPacket>::iterator it1 = it;
     it1--;
     header->position = (*it1)->granulepos();
-    oggPacketList.erase(oggPacketList.begin(), it);
+    m_oggPacketList.erase(m_oggPacketList.begin(), it);
   }
 
   header->checksum = Crc::create(pageBeginPtr, overallLength);
 
-  OggPage page(new OggPageInternal(pageData, sizeof(OggHeader)+segmentsSize, bodyLength));
-  oggPageList.push_back(page);
+  OggPage page = std::make_shared<OggPageInternal>(pageData, sizeof(OggHeader)+segmentsSize, bodyLength);
+  m_oggPageList.push_back(page);
 
-  dataLength -= bodyLength;
+  m_dataLength -= bodyLength;
 
   setAvailable();
 
diff --git a/src/base/oggStreamEncoder.h b/src/base/oggStreamEncoder.h
index e8f244f..803f6e1 100644
--- a/src/base/oggStreamEncoder.h
+++ b/src/base/oggStreamEncoder.h
@@ -30,28 +30,29 @@
 #include "oggPacket.h"
 #include "ringbuffer.h"
 #include "definition.h"
+#include <boost/circular_buffer.hpp>
 
 class OggStreamEncoder : public MediaEncoder {
 
 protected:
   static const uint32 maxSegmentEntries = 4096;
 
-  static std::vector<uint32> usedSerialNo;
+  static std::vector<uint32> m_usedSerialNo;
 
-  uint32 maxPageSize;
+  uint32 m_maxPageSize;
 
-  uint32 streamSerialNo;
-  uint8  streamNo;
+  uint32 m_streamSerialNo;
+  uint8  m_streamNo;
 
-  std::list<OggPage> oggPageList;
-  std::list<OggPacket> oggPacketList;
-  ringbuffer segmentsBuffer;
+  std::list<OggPage> m_oggPageList;
+  std::list<OggPacket> m_oggPacketList;
+  boost::circular_buffer<uint8_t> m_segmentsBuffer;
 
-  uint32 dataLength;   //!< is the length of the actually available data
-  uint32 dataSegments; //!< is the number of the actually available segments
-  uint32 usedData;     //!< is the size of data, that has already been used in the first packet
+  uint32 m_dataLength;   //!< is the length of the actually available data
+  uint32 m_dataSegments; //!< is the number of the actually available segments
+  uint32 m_usedData;     //!< is the size of data, that has already been used in the first packet
 
-  uint32 pageCounter;
+  uint32 m_pageCounter;
 
   uint32 findUniqueSerial(uint32 proposal);
 
diff --git a/src/base/rawMediaPacket.cpp b/src/base/rawMediaPacket.cpp
index 6e0c726..4fa8ef3 100644
--- a/src/base/rawMediaPacket.cpp
+++ b/src/base/rawMediaPacket.cpp
@@ -67,8 +67,8 @@ uint32 RawMediaPacketInternal::getSize()
 //{
 //}
 
-//RawMediaPacket::RawMediaPacket(RawMediaPacketInternal* dataPtr)
-//    : RefObject<RawMediaPacketInternal>(dataPtr)
+//RawMediaPacket::RawMediaPacket(RawMediaPacketInternal* m_dataPtr)
+//    : RefObject<RawMediaPacketInternal>(m_dataPtr)
 //{
 //}
 
diff --git a/src/base/rawMediaPacket.h b/src/base/rawMediaPacket.h
index 875536e..4d4a478 100644
--- a/src/base/rawMediaPacket.h
+++ b/src/base/rawMediaPacket.h
@@ -29,6 +29,9 @@
 #include "definition.h"
 //#include "refObject.h"
 
+class RawMediaPacketInternal;
+typedef std::shared_ptr<RawMediaPacketInternal> RawMediaPacket;
+
 class RawMediaPacketInternal {
 
 protected:
@@ -45,6 +48,9 @@ public:
 
 };
 
-typedef std::shared_ptr<RawMediaPacketInternal> RawMediaPacket;
+static RawMediaPacket createRawMediaPacket()
+{
+  return std::make_shared<RawMediaPacketInternal>();
+}
 
 #endif /*RAWMEDIAPACKET_H_*/
diff --git a/src/base/streamExtractor.cpp b/src/base/streamExtractor.cpp
index 1604510..9590102 100644
--- a/src/base/streamExtractor.cpp
+++ b/src/base/streamExtractor.cpp
@@ -9,9 +9,7 @@ ExtractorInformation::ExtractorInformation(const ExtractorInformation& extractor
   : type(extractorInfo.type), serialNo(extractorInfo.serialNo),
     parameter(0), numOfHeaderPackets(extractorInfo.numOfHeaderPackets)
 {
-  if (extractorInfo.parameter)
-    parameter = extractorInfo.parameter->clone();
-
+  parameter = extractorInfo.parameter;
 }
 
 ExtractorInformation& ExtractorInformation::operator=(const ExtractorInformation& extractorInfo)
@@ -20,21 +18,13 @@ ExtractorInformation& ExtractorInformation::operator=(const ExtractorInformation
   serialNo           = extractorInfo.serialNo;
   numOfHeaderPackets = extractorInfo.numOfHeaderPackets;
 
-  if (parameter)
-    delete parameter;
-
-  if (extractorInfo.parameter)
-    parameter = extractorInfo.parameter->clone();
-  else
-    parameter = 0;
+  parameter = extractorInfo.parameter;
 
   return(*this);
 }
 
 ExtractorInformation::~ExtractorInformation()
 {
-  if (parameter)
-    delete parameter;
 }
 
 StreamExtractor::StreamExtractor()
diff --git a/src/base/streamExtractor.h b/src/base/streamExtractor.h
index 704887a..2de043e 100644
--- a/src/base/streamExtractor.h
+++ b/src/base/streamExtractor.h
@@ -31,7 +31,7 @@ public:
   uint32                 serialNo;
 
   //! The first page/packet gives detailed information of the stream
-  StreamParameter*       parameter;
+  std::shared_ptr<StreamParameter>       parameter;
 
   //! the number of header packets must be identified by the stream type
   uint8                  numOfHeaderPackets;
diff --git a/src/base/test/CMakeLists.txt b/src/base/test/CMakeLists.txt
new file mode 100644
index 0000000..3b65dde
--- /dev/null
+++ b/src/base/test/CMakeLists.txt
@@ -0,0 +1,5 @@
+add_executable(decoderTest decoderTest.cpp)
+target_link_libraries(decoderTest ovtbase ovtmisc)
+
+add_executable(encoderTest encoderTest.cpp)
+target_link_libraries(encoderTest ovtbase ovtmisc)
diff --git a/src/base/test/decoderTest.cpp b/src/base/test/decoderTest.cpp
new file mode 100644
index 0000000..0c5469a
--- /dev/null
+++ b/src/base/test/decoderTest.cpp
@@ -0,0 +1,58 @@
+//
+// Created by joern on 23.07.16.
+//
+
+#include "oggDecoder.h"
+#include <vector>
+#include <iostream>
+
+int main(int argc, char* argv[])
+{
+
+  OggDecoder decoder;
+
+  {
+    // create a packet, that is valid in the eyes of the decoder
+    std::vector<uint8_t> packet;
+
+    OggHeader header;
+    memset(&header, 0, sizeof(OggHeader));
+
+    header.ogg[0] = 'O';
+    header.ogg[1] = 'g';
+    header.ogg[2] = 'g';
+    header.ogg[3] = 'S';
+
+    header.tableSegments = 2;
+    uint8_t* hdr_ptr = (uint8_t*)&header;
+    packet.insert(packet.end(), &hdr_ptr[0], &hdr_ptr[sizeof(OggHeader)]);
+
+    /* add the segments table */
+    packet.push_back(255);
+    packet.push_back(1);
+
+    /* add all the data (that is 0xc5) */
+    for (uint32_t i(0); i < 256; ++i) {
+      packet.push_back(0xc5);
+    }
+
+    RawMediaPacket rmp = createRawMediaPacket();
+    rmp->setData(packet, false);
+    decoder << rmp;
+  }
+
+  OggPage page;
+
+  decoder >> page;
+
+  std::vector<uint8_t> pg_data = page->data();
+  uint32_t cnt;
+
+  for (auto i : pg_data) {
+    std::cout << " 0x"<<std::hex<<(int)i;
+    if (cnt++%16 == 0)
+      std::cout << std::endl;
+  }
+
+
+}
\ No newline at end of file
diff --git a/src/base/test/encoderTest.cpp b/src/base/test/encoderTest.cpp
new file mode 100644
index 0000000..b6ca6bc
--- /dev/null
+++ b/src/base/test/encoderTest.cpp
@@ -0,0 +1,67 @@
+//
+// Created by joern on 23.07.16.
+//
+
+#include "oggStreamEncoder.h"
+#include <vector>
+#include <iostream>
+
+void printif(OggPage page)
+{
+  if (page) {
+    std::cout << page->toString(5);
+  } else {
+    std::cout << "page is empty"<<std::endl;
+  }
+}
+
+int main(int argc, char* argv[])
+{
+
+  unsigned char data[] = "hallo";
+  uint32_t length = 6;
+
+  OggPacket packet = OggPacketInternal::create(data, length,0,0);
+  OggPage page;
+
+  OggStreamEncoder encoder;
+
+  packet->setBOS();
+
+  encoder << packet;
+
+  std::vector<uint8_t> packetData2;
+  packetData2.insert(packetData2.end(),254, 0x5c);
+
+  packet = OggPacketInternal::create(&packetData2[0], packetData2.size(),0,0);
+  page.reset();
+
+  encoder << packet;
+
+  while (!encoder.isEmpty()) {
+    page.reset();
+    encoder >> page;
+
+    printif(page);
+  }
+
+  std::vector<uint8_t> packetData3;
+  packetData3.insert(packetData3.end(),1276, 0xb4);
+
+  packet = OggPacketInternal::create(&packetData3[0], packetData3.size(),0,0);
+  page.reset();
+
+  encoder << packet;
+  encoder.flush();
+
+  while (!encoder.isEmpty()) {
+    page.reset();
+    encoder >> page;
+
+    printif(page);
+  }
+
+
+  return 0;
+
+}
diff --git a/src/binaries/oggCat.cpp b/src/binaries/oggCat.cpp
index d82e035..34dac04 100644
--- a/src/binaries/oggCat.cpp
+++ b/src/binaries/oggCat.cpp
@@ -27,10 +27,8 @@
 #include <iostream>
 #include <map>
 #include <vector>
-#include <string>
 #include <fstream>
 
-#include <cstdlib>
 #include <ctime>
 #include <unistd.h>
 
@@ -40,8 +38,6 @@
 #include "oggPacket.h"
 #include "streamMux.h"
 #include "streamSerializer.h"
-#include "streamConfig.h"
-#include "oggTypes.h"
 
 #include "cmdlineextractor.h"
 #include "theoraStreamParameter.h"
@@ -53,75 +49,6 @@
 #include "exception.h"
 #include "log.h"
 
-/* get the next file
- * within this function, the next stream serializer is created.
- * The configuration of this serializer is compared with the
- * configuration of the given configuration, and a matching table
- * is created (i.e. a theora stream with a certain configuration
- * may be on an other stream position, than on the first stream)
- * if there is no match found, the function returns false.
- * If there is a match found, the packets created by the serializer
- * should be remarked from the actual stream ID to the stream ID
- * of the output file.
- * */
-bool getNextFile(std::string& fileName, StreamSerializer* &serializer,
-                 std::vector<StreamConfig>& origConfigList, std::vector<uint8>& streamMap)
-{
-  serializer = new StreamSerializer;
-
-  if (!serializer->open(fileName)) {
-    logger.error() << "Unable to open file <" << fileName << "> \n";
-    delete serializer;
-    serializer = 0;
-    return (false);
-  }
-
-  std::vector<StreamConfig> actConfigList;
-
-  serializer->getStreamConfig(actConfigList);
-
-  uint32 matchCounter(0);
-  uint32 origCounter(0);
-
-  streamMap.resize(actConfigList.size(), 255);
-
-  bool vorbisFound(false);
-  bool theoraFound(false);
-
-  for (uint32 i(0); i<actConfigList.size(); ++i) {
-
-    if (origConfigList[i].type == OggType::unknown)
-      continue;
-
-    origCounter++;
-
-    for (uint32 j(0); j<origConfigList.size(); ++j) {
-      if ((actConfigList[i].type == OggType::theora) && (!theoraFound)) {
-        theoraFound == true;
-        streamMap[i] = j;
-        matchCounter++;
-      }
-
-      if ((actConfigList[i].type == OggType::vorbis) && (!vorbisFound)) {
-        vorbisFound == true;
-        streamMap[i] = j;
-        matchCounter++;
-      }
-    }
-  }
-
-  if (matchCounter != origCounter) {
-    logger.error()
-        << "I could not find enough matching streams for file <fileName>\n";
-    delete serializer;
-    serializer = 0;
-    return (false);
-  }
-  // detele the config list explicitly
-
-  return (true);
-}
-
 void printHelpScreen(const std::string& progName)
 {
   logger.error() << "usage: " << progName << " [options]"
@@ -142,12 +69,12 @@ void printHelpScreen(const std::string& progName)
 }
 
 void analyseVideoTranscoding(WishList& wishList,
-                             TheoraStreamParameter* theoraConfigInput,
-                             TheoraStreamParameter* theoraConfigOutput)
+                             std::shared_ptr<TheoraStreamParameter> theoraConfigInput,
+                             std::shared_ptr<TheoraStreamParameter> theoraConfigOutput)
 {
   /* first we believe the output should be equal for all
    * parameters that are not explicitly changed */
-  (*theoraConfigOutput) = (*theoraConfigInput);
+  *theoraConfigOutput.get() = *theoraConfigInput.get();
 
   if (wishList.changeVideoDatarate) {
     if (theoraConfigInput->videoBitrate != wishList.videoDatarate) {
@@ -198,12 +125,12 @@ void analyseVideoTranscoding(WishList& wishList,
 }
 
 void analyseAudioTranscoding(WishList& wishList,
-                             VorbisStreamParameter* vorbisConfigInput,
-                             VorbisStreamParameter* vorbisConfigOutput)
+                             std::shared_ptr<VorbisStreamParameter> vorbisConfigInput,
+                             std::shared_ptr<VorbisStreamParameter> vorbisConfigOutput)
 {
   /* first we believe the output should be equal for all
    * parameters, that are not explicitly changed */
-  (*vorbisConfigOutput) = (*vorbisConfigInput);
+  *vorbisConfigOutput.get() = *vorbisConfigInput.get();
 
   if (wishList.changeAudioDatarate) {
     if (vorbisConfigOutput->datarate != wishList.audioDatarate) {
@@ -235,9 +162,6 @@ int oggCatCmd(int argc, char* argv[])
 
   WishList wishList;
 
-  bool usePresizeVideoCutting(false);
-  bool usePresizeAudioCutting(false);
-
   std::vector<OggComment> videoComments;
   bool withVideoComments( false);
 
@@ -245,11 +169,11 @@ int oggCatCmd(int argc, char* argv[])
   bool withAudioComments( false);
 
   bool reencodeVideo(false);
-  bool reencodeAudio(true);
+//  bool reencodeAudio(true); is always used
 
   bool existenceTest(true);
 
-  srand(time(0));
+  srand((uint) time(0));
 
   int opt;
   while ((opt = getopt(argc, argv, "hp:d:q:o:D:s:f:F:N:tC:c:r:x")) != EOF)
@@ -265,15 +189,6 @@ int oggCatCmd(int argc, char* argv[])
       outputFile = std::string(optarg);
       break;
 
-    case 'p':
-      if (optarg[0] == 'a')
-        usePresizeAudioCutting = true;
-      else {
-        usePresizeVideoCutting = true;
-        usePresizeAudioCutting = true;
-      }
-      break;
-
     case 'd':
       wishList.videoDatarate = CmdlineExtractor::atoi(optarg);
       wishList.changeVideoDatarate = true;
@@ -358,9 +273,9 @@ int oggCatCmd(int argc, char* argv[])
 
     case 'r':
       switch (optarg[0]) {
-      case 'a':
-        reencodeAudio = true;
-        break;
+//      case 'a':
+//        reencodeAudio = true;
+//        break;
       case 'v':
         reencodeVideo = true;
         break;
@@ -370,6 +285,8 @@ int oggCatCmd(int argc, char* argv[])
     case 'x':
       existenceTest = false;
       break;
+    default:
+      logger.error() << "option \"-" << opt << "\" is unknown" << std::endl;
     }
 
   argc -= optind;
@@ -377,7 +294,7 @@ int oggCatCmd(int argc, char* argv[])
 
   /* There are two possibilities to get the output file
    * "old" version is via -o option. In this case the output file is
-   * not empty. In the other case the output file is given as the first
+   * not m_empty. In the other case the output file is given as the first
    * argument (except the options). */
   if (outputFile.empty()) {
     if (argc > 1) {
@@ -424,12 +341,9 @@ int oggCatCmd(int argc, char* argv[])
   streamMap.resize(originalConfigList.size(), 255);
 
   /* These are the information ordered, by the stream IDs from the input stream */
-  std::vector<HookHandler*> hookList;
+  std::vector<std::shared_ptr<HookHandler> > hookList;
   std::vector<StreamConfig> muxerInformation;
 
-  uint32 theoraStreamNo(255);
-  uint32 vorbisStreamNo(255);
-
   bool foundTheora(false);
   bool foundVorbis(false);
 
@@ -442,14 +356,14 @@ int oggCatCmd(int argc, char* argv[])
     StreamConfig& decoderConfig(originalConfigList[i]);
 
     if (decoderConfig.type == OggType::theora) {
-      if (foundTheora == false) {
+      if (!foundTheora) {
         foundTheora = true;
         StreamConfig encoderConfig;
 
-        TheoraStreamParameter* theoraEncoderConfig(0);
-        TheoraStreamParameter* theoraDecoderConfig(0);
+        std::shared_ptr<TheoraStreamParameter> theoraEncoderConfig;
+        std::shared_ptr<TheoraStreamParameter> theoraDecoderConfig;
 
-        VideoHook* vHook(new VideoHook(streamCounter, false, true ));
+        std::shared_ptr<VideoHook> vHook = std::make_shared<VideoHook>(streamCounter, false, true );
 
         if (reencodeVideo)
           vHook->forceReencoding();
@@ -472,10 +386,10 @@ int oggCatCmd(int argc, char* argv[])
 
         /* grap the information extracted by the decoder */
         theoraDecoderConfig
-          = static_cast<TheoraStreamParameter*>(decoderConfig.parameter);
+          = std::dynamic_pointer_cast<TheoraStreamParameter>(decoderConfig.parameter);
 
         /* create a config for the output stream and keep a pointer */
-        theoraEncoderConfig = new TheoraStreamParameter;
+        theoraEncoderConfig = std::make_shared<TheoraStreamParameter>();
 
         analyseVideoTranscoding(wishList, theoraDecoderConfig,
                                 theoraEncoderConfig);
@@ -513,15 +427,15 @@ int oggCatCmd(int argc, char* argv[])
     }
 
     if (decoderConfig.type == OggType::vorbis) {
-      if (foundVorbis == false) {
+      if (!foundVorbis) {
         StreamConfig encoderConfig;
 
-        VorbisStreamParameter* vorbisEncoderConfig(0);
-        VorbisStreamParameter* vorbisDecoderConfig(0);
+        std::shared_ptr<VorbisStreamParameter> vorbisEncoderConfig;
+        std::shared_ptr<VorbisStreamParameter> vorbisDecoderConfig;
 
         foundVorbis = true;
 
-        AudioHook* aHook(new AudioHook(streamCounter, false, true ));
+        std::shared_ptr<AudioHook> aHook = std::make_shared<AudioHook>(streamCounter, false, true );
         hookList.push_back(aHook);
 
         /* We only need these information for the information printout */
@@ -531,11 +445,10 @@ int oggCatCmd(int argc, char* argv[])
         aHook->setDecoderConfig(decoderConfig, decoderComments);
 
         /* create a config for this stream */
-        vorbisEncoderConfig = new VorbisStreamParameter;
+        vorbisEncoderConfig = std::make_shared<VorbisStreamParameter>();
 
         /* */
-        vorbisDecoderConfig
-          = static_cast<VorbisStreamParameter*>(decoderConfig.parameter);
+        vorbisDecoderConfig = std::dynamic_pointer_cast<VorbisStreamParameter>(decoderConfig.parameter);
 
         /* */
         encoderConfig.parameter = vorbisEncoderConfig;
@@ -543,9 +456,12 @@ int oggCatCmd(int argc, char* argv[])
         analyseAudioTranscoding(wishList, vorbisDecoderConfig,
                                 vorbisEncoderConfig);
 
+        if (!withAudioComments)
+          audioComments = decoderComments;
+
         /* the decoder Comments are used as well in case, keepComments
          * is set within the HookHandler */
-        aHook->setEncoderConfig(encoderConfig, videoComments);
+        aHook->setEncoderConfig(encoderConfig, audioComments);
 
         /* calculate how to handle the input, to create the correct output */
         aHook->initAndConnect();
@@ -662,8 +578,7 @@ int oggCatCmd(int argc, char* argv[])
         /* run through the stream map to find the original stream,
          * this stream should be mapped to */
         for (uint32 k(0); k<hookList.size(); ++k) {
-          if ((hookList[k]->getType() == OggType::theora) && (foundTheora
-              == false)) {
+          if ((hookList[k]->getType() == OggType::theora) && !foundTheora) {
             foundTheora = true;
 //            logger.debug() << "Theora found ("<< l <<") -> "<<k<<std::endl;
             VideoHook& vHook = dynamic_cast<VideoHook&>(*hookList[k]);
@@ -681,7 +596,7 @@ int oggCatCmd(int argc, char* argv[])
             vHook.initAndConnect();
 
             /* set the stream ID, to which this stream should be maped to */
-            streamMap[l] = k;
+            streamMap[l] = (uint8)k;
 
             newStreamCounter++;
 
@@ -694,8 +609,7 @@ int oggCatCmd(int argc, char* argv[])
         /* run through the stream map to find the original stream,
          * this stream should be mapped to */
         for (uint32 k(0); k<hookList.size(); ++k) {
-          if ((hookList[k]->getType() == OggType::vorbis) && (foundVorbis
-              == false)) {
+          if ((hookList[k]->getType() == OggType::vorbis) && !foundVorbis) {
             foundVorbis = true;
 //            logger.debug() << "Vorbis found ("<< l <<") -> "<<k<<std::endl;
             AudioHook& aHook = dynamic_cast<AudioHook&>(*hookList[k]);
@@ -710,7 +624,7 @@ int oggCatCmd(int argc, char* argv[])
             aHook.initAndConnect();
 
             /* set the stream ID, to which this stream should be maped to */
-            streamMap[l] = k;
+            streamMap[l] = (uint8)k;
 
             newStreamCounter++;
 
@@ -772,8 +686,6 @@ int oggCatCmd(int argc, char* argv[])
       streamCreate << packet;
     }
 
-    delete hookList[i];
-
   }
 
   /* set end of stream and do everything neccessary */
diff --git a/src/binaries/oggCut.cpp b/src/binaries/oggCut.cpp
index 96fdc3e..63c1d04 100644
--- a/src/binaries/oggCut.cpp
+++ b/src/binaries/oggCut.cpp
@@ -43,8 +43,7 @@ struct ListElement {
   double time;
   OggPacket packet;
   ListElement(double _time, OggPacket _packet) :
-    time(_time), packet(_packet)
-  {
+    time(_time), packet(_packet) {
   }
 };
 
@@ -215,8 +214,7 @@ int oggCutCmd(int argc, char* argv[])
   streamSerializer.getStreamConfig(streamConfigList);
 
   /* create the time synchronizer, which holds the time offset for every stream */
-  std::vector<double> offset;
-  offset.resize(streamConfigList.size());
+  std::vector<double> offset(streamConfigList.size(),0.0);
 
   /* Output some stream information and reset the offset */
   for (uint32 i(0); i<streamConfigList.size(); ++i) {
@@ -224,9 +222,9 @@ int oggCutCmd(int argc, char* argv[])
     logger.info() << "Stream No: "<<(int)conf.streamNo<<"(0x"<<std::hex
                   << conf.serialNo<<std::dec<<")\n";
     if (streamConfigList[i].parameter)
-      logger.info() << streamConfigList[i].parameter->toString();
-    if (streamConfigList[i].type == OggType::theora)
-      foundTheora = true;
+      // logger.info() << streamConfigList[i].parameter->toString();
+      if (streamConfigList[i].type == OggType::theora)
+        foundTheora = true;
     offset[i] = -1;
   }
 
diff --git a/src/binaries/oggDump.cpp b/src/binaries/oggDump.cpp
index efdfd20..4434d53 100644
--- a/src/binaries/oggDump.cpp
+++ b/src/binaries/oggDump.cpp
@@ -100,18 +100,18 @@ void dumpPacketof(std::string& file, uint8 dumpLevel, bool promptForStreams, std
 
     std::cout << "serial No : 0x"<< std::hex << configList[i].serialNo;
     if (configList[i].parameter)
-      std::cout << configList[i].parameter->toString();
+      //std::cout << configList[i].parameter->toString();
 
-    if (promptForStreams) {
-      std::cout << "Dump this stream? (y/n) \n";
-      char answer;
-      std::cin >> answer;
+      if (promptForStreams) {
+        std::cout << "Dump this stream? (y/n) \n";
+        char answer;
+        std::cin >> answer;
 
-      if (answer != 'Y' && answer != 'y')
-        outputStreamNo.push_back(configList[i].streamNo);
+        if (answer != 'Y' && answer != 'y')
+          outputStreamNo.push_back(configList[i].streamNo);
 
-      std::cout << answer << "\n";
-    }
+        std::cout << answer << "\n";
+      }
   }
 
   OggPacket packet;
@@ -132,10 +132,10 @@ void dumpPacketof(std::string& file, uint8 dumpLevel, bool promptForStreams, std
 
     if (outFilename.empty()) {
       std::cout << "\nTime: " << _time;
-      std::cout << packet->print(dumpLevel);
+      std::cout << packet->toString(dumpLevel);
     } else {
       outStream << "\nTime: " << _time;
-      outStream << packet->print(dumpLevel);
+      outStream << packet->toString(dumpLevel);
     }
   }
 }
@@ -213,7 +213,7 @@ int oggDumpCmd(int argc, char* argv[])
   if (!outFilename.empty())
     outStream.open(outFilename.c_str());
 
-  /* open the repository
+  /* open the m_repository
    in this easy example, it is a simple file */
   FileRepository repository(analysisFile, MediaUnit::read);
 
@@ -221,7 +221,7 @@ int oggDumpCmd(int argc, char* argv[])
   std::map<uint32, OggStreamDecoder> oggStreamDecoderList;
   std::vector<OggPage> bosPages;
 
-  /* run through the repository until there is no data left */
+  /* run through the m_repository until there is no data left */
   while (!repository.isEndOfFile()) {
 
     RawMediaPacket rawDecoderPacket;
@@ -326,14 +326,14 @@ int oggDumpCmd(int argc, char* argv[])
 
             std::string outputString;
 
-            // are there any bos pages, then print them first
+            // are there any bos pages, then toString them first
             if (!bosPages.empty()) {
               for (uint32 j(0); j<bosPages.size(); ++j)
-                outputString += bosPages[j]->print(dumpLevel);
+                outputString += bosPages[j]->toString(dumpLevel);
               bosPages.clear();
             }
 
-            outputString += oggPage->print(dumpLevel);
+            outputString += oggPage->toString(dumpLevel);
 
             if (outFilename.empty())
               std::cout << outputString;
@@ -357,6 +357,7 @@ int oggDumpCmd(int argc, char* argv[])
 
 int main(int argc, char* argv[])
 {
+  //logger.setLevel(OggLog::LOG_DEBUG);
   try {
     return oggDumpCmd(argc, argv);
   } catch (OggException & e) {
diff --git a/src/binaries/oggJoin.cpp b/src/binaries/oggJoin.cpp
index f2d7bdd..c9b281c 100644
--- a/src/binaries/oggJoin.cpp
+++ b/src/binaries/oggJoin.cpp
@@ -101,7 +101,7 @@ int oggJoinCmd(int argc, char* argv[])
 
   std::vector<JoinElement*> decoderList;
 
-  /* open the repository and encoder for the joined file */
+  /* open the m_repository and encoder for the joined file */
   FileRepository outRepository = FileRepository(argv[1], MediaUnit::write);
   OggEncoder oggEncoder;
 
diff --git a/src/binaries/oggSilence.cpp b/src/binaries/oggSilence.cpp
index c37d1dc..a366c16 100644
--- a/src/binaries/oggSilence.cpp
+++ b/src/binaries/oggSilence.cpp
@@ -136,7 +136,7 @@ int oggSilenceCmd( int argc, char* argv[] )
   muxer.recreatePacketPosition(false);
 
   /* configure encoder */
-  VorbisStreamParameter* config = new VorbisStreamParameter;
+  std::shared_ptr<VorbisStreamParameter> config = std::make_shared<VorbisStreamParameter>();
   config->datarate = datarate;
   config->channels = channels;
   config->samplerate = samplerate;
diff --git a/src/binaries/oggSlideshow.cpp b/src/binaries/oggSlideshow.cpp
index 50b0eea..634b7b8 100644
--- a/src/binaries/oggSlideshow.cpp
+++ b/src/binaries/oggSlideshow.cpp
@@ -229,7 +229,7 @@ int oggSlideshowCmd(int argc, char* argv[])
   }
 
   StreamConfig streamConf;
-  TheoraStreamParameter* config = new TheoraStreamParameter;
+  std::shared_ptr<TheoraStreamParameter> config = std::make_shared<TheoraStreamParameter>();
   streamConf.parameter = config;
 
 // for valgrind
@@ -249,6 +249,7 @@ int oggSlideshowCmd(int argc, char* argv[])
   config->framerateDenom   = 1;
   config->keyframeShift    = 6;
   config->pixel_fmt        = TheoraStreamParameter::pf_420;//TheoraStreamParameter::pf_444;
+  config->colorspace       = TheoraStreamParameter::unspecified;
 
   config->videoBitrate = datarate;
   config->videoQuality = quality;
@@ -270,7 +271,7 @@ int oggSlideshowCmd(int argc, char* argv[])
   std::vector<StreamConfig> configList;
   configList.push_back(streamConf);
 
-  /* create a repository, where the data should be placed */
+  /* create a m_repository, where the data should be placed */
   FileRepository* repository = new FileRepository(outputFile, MediaUnit::write);
 
   /* create a stream multiplexer */
@@ -282,7 +283,7 @@ int oggSlideshowCmd(int argc, char* argv[])
   /* extract the RGB picture plane */
   RGBPlane pictureRGB;
 
-  std::auto_ptr<Effector> effector;
+  std::shared_ptr<Effector> effector;
 
   bool first(true);
   bool noneFound(true);
@@ -503,7 +504,7 @@ int oggSlideshowCmd(int argc, char* argv[])
 
 int main(int argc, char* argv[])
 {
-  logger.setLevel(OggLog::LOG_DEBUG);
+  logger.setLevel(OggLog::LOG_INFO);
   try {
     return oggSlideshowCmd(argc, argv);
   } catch (OggException & e) {
diff --git a/src/binaries/oggSplit.cpp b/src/binaries/oggSplit.cpp
index 14d0a6b..95538a1 100644
--- a/src/binaries/oggSplit.cpp
+++ b/src/binaries/oggSplit.cpp
@@ -64,7 +64,7 @@ int oggSplitCmd(int argc, char* argv[])
     exit(-1);
   }
 
-  /* open the repository
+  /* open the m_repository
    in this easy example, it is a simple file */
   FileRepository repository(argv[1], MediaUnit::read);
 
@@ -74,7 +74,7 @@ int oggSplitCmd(int argc, char* argv[])
   RawMediaPacket rawDecoderPacket;
   OggDecoder oggDecoder;
 
-  /* run through the repository until there is no data left */
+  /* run through the m_repository until there is no data left */
   while (!repository.isEndOfFile()) {
 
     /* extract a raw data bunch from the file .. */
@@ -94,7 +94,7 @@ int oggSplitCmd(int argc, char* argv[])
       /* what ID has this page / what stream does this page belongs to */
       uint32 serialID = oggPage->serialno();
 
-      /* if this is the start of a stream, create a repository file for it */
+      /* if this is the start of a stream, create a m_repository file for it */
       if (oggPage->isBOS()) {
 
         std::stringstream filename;
diff --git a/src/binaries/oggThumb.cpp b/src/binaries/oggThumb.cpp
index 7e86ca0..095e996 100644
--- a/src/binaries/oggThumb.cpp
+++ b/src/binaries/oggThumb.cpp
@@ -416,7 +416,6 @@ int oggThumbCmd(int argc, char* argv[])
     std::vector<StreamConfig> streamConfigList;
     streamSerializer.getStreamConfig(streamConfigList);
 
-    TheoraStreamParameter* theoraConfig(0);
     std::vector<OggComment> oggComments;
 
     /* Output some stream information */
@@ -426,7 +425,7 @@ int oggThumbCmd(int argc, char* argv[])
         // take the first theora stream
         if (!foundTheora) {
           theoraStreamNo = streamConfigList[i].streamNo;
-          theoraConfig = (TheoraStreamParameter*)streamConfigList[i].parameter;
+          TheoraStreamParameter& theoraConfig = dynamic_cast<TheoraStreamParameter&>(*streamConfigList[i].parameter.get());
           theoraDecoder.initDecoder(streamConfigList[i], oggComments);
           logger.info() << "Info:\n" << theoraDecoder.configuration()<<std::endl;
 
@@ -436,13 +435,13 @@ int oggThumbCmd(int argc, char* argv[])
             aspectCorrection = 1;
 
           if ((width == 0) && (height == 0)) {
-            width = theoraConfig->pictureX * aspectCorrection; //theoraConfig->frameX;
-            height = theoraConfig->pictureY; //theoraConfig->frameY;
+            width = theoraConfig.pictureX * aspectCorrection; //theoraConfig.frameX;
+            height = theoraConfig.pictureY; //theoraConfig.frameY;
           } else {
             if (height == 0)
-              height = (uint32)((width * theoraConfig->pictureY*1.0)/(theoraConfig->pictureX*aspectCorrection*1.0) + 0.5);
+              height = (uint32)((width * theoraConfig.pictureY*1.0)/(theoraConfig.pictureX*aspectCorrection*1.0) + 0.5);
             else if (width == 0)
-              width = (uint32)((height * theoraConfig->pictureX*aspectCorrection*1.0)/(theoraConfig->pictureY*1.0) +0.5);
+              width = (uint32)((height * theoraConfig.pictureX*aspectCorrection*1.0)/(theoraConfig.pictureY*1.0) +0.5);
           }
 
           logger.info() << "width: "<<width<<" and height: "<<height<<"\n";
diff --git a/src/binaries/oggTranscode.cpp b/src/binaries/oggTranscode.cpp
index 6b9f163..7e3dbc4 100644
--- a/src/binaries/oggTranscode.cpp
+++ b/src/binaries/oggTranscode.cpp
@@ -40,8 +40,9 @@
 #include "config.h"
 #endif
 
+#include <boost/lexical_cast.hpp>
+
 #include "definition.h"
-#include "th_helper.h"
 #include "helper.h"
 
 #include "rgbPlane.h"
@@ -52,14 +53,10 @@
 #include "videoHook.h"
 #include "audioHook.h"
 
-#include "theoraStreamParameter.h"
-#include "vorbisStreamParameter.h"
-
 #include "fileRepository.h"
 #include "streamSerializer.h"
 #include "streamMux.h"
 
-#include "blendElement.h"
 #include "cmdlineextractor.h"
 #include "wishList.h"
 #include "exception.h"
@@ -121,7 +118,7 @@ void alphaBlend(double time, RGBPlane& inPlane,
     switch (blendList[i].state) {
     case BlendElement::blend_off: {
       if (time >= blendList[i].startTime) {
-        if (blendList[i].smooth == true) {
+        if (blendList[i].smooth) {
           blendList[i].state = BlendElement::blend_slideIn;
         } else {
           blendList[i].intensity = 1.0;
@@ -145,7 +142,7 @@ void alphaBlend(double time, RGBPlane& inPlane,
     case BlendElement::blend_on: {
       if ( (blendList[i].endTime > 0.0 )
            && (time >= blendList[i].endTime )) {
-        if (blendList[i].smooth == true) {
+        if (blendList[i].smooth) {
           blendList[i].state = BlendElement::blend_slideOut;
         } else {
           blendList[i].intensity = 0.0;
@@ -183,12 +180,12 @@ void alphaBlend(double time, RGBPlane& inPlane,
 }
 
 void analyseVideoTranscoding(WishList& wishList,
-                             TheoraStreamParameter* theoraConfigInput,
-                             TheoraStreamParameter* theoraConfigOutput)
+                             std::shared_ptr<TheoraStreamParameter> theoraConfigInput,
+                             std::shared_ptr<TheoraStreamParameter> theoraConfigOutput)
 {
   /* first we believe the output should be equal for all
    * parameters that are not explicitly changed */
-  (*theoraConfigOutput) = (*theoraConfigInput);
+  *theoraConfigOutput.get() = *theoraConfigInput.get();
 
   if (wishList.changeVideoDatarate) {
     if (theoraConfigInput->videoBitrate != wishList.videoDatarate) {
@@ -247,12 +244,12 @@ void analyseVideoTranscoding(WishList& wishList,
 }
 
 void analyseAudioTranscoding(WishList& wishList,
-                             VorbisStreamParameter* vorbisConfigInput,
-                             VorbisStreamParameter* vorbisConfigOutput)
+                             std::shared_ptr<VorbisStreamParameter> vorbisConfigInput,
+                             std::shared_ptr<VorbisStreamParameter> vorbisConfigOutput)
 {
   /* first we believe the output should be equal for all
    * parameters, that are not explicitly changed */
-  (*vorbisConfigOutput) = (*vorbisConfigInput);
+  *vorbisConfigOutput.get() = *vorbisConfigInput.get();
 
   if (wishList.changeAudioDatarate) {
     if (vorbisConfigOutput->datarate != wishList.audioDatarate) {
@@ -285,10 +282,8 @@ int oggTranscodeCmd(int argc, char* argv[])
   WishList wishList;
 
   std::vector<OggComment> videoComments;
-  bool withVideoComments( false);
 
   std::vector<OggComment> audioComments;
-  bool withAudioComments( false);
 
   bool forceVideoReencode(false);
   bool forceAudioReencode(true);
@@ -302,7 +297,7 @@ int oggTranscodeCmd(int argc, char* argv[])
   std::string inputFile;
   std::string outputFile;
 
-  srand( time(0) );
+  srand( (int) time(0) );
 
   int opt;
   while ( (opt = getopt(argc, argv, "hs:f:d:tD:c:C:N:F:a:A:q:p:xr:o:Q:") ) != EOF)
@@ -327,7 +322,7 @@ int oggTranscodeCmd(int argc, char* argv[])
     break;
 
     case 'Q': {
-      uint8 _quality = atoi(optarg);
+      uint8 _quality = boost::lexical_cast<uint8>(optarg);
 
       if (_quality < 1)
         _quality = 1;
@@ -359,7 +354,7 @@ int oggTranscodeCmd(int argc, char* argv[])
 
     case 'q': {
       wishList.changeVideoQuality = true;
-      wishList.videoQuality = atoi(optarg);
+      wishList.videoQuality = boost::lexical_cast<uint32_t>(optarg);
       break;
     }
 
@@ -403,29 +398,27 @@ int oggTranscodeCmd(int argc, char* argv[])
 
     case 'd':
       wishList.changeVideoDatarate = true;
-      wishList.videoDatarate = atoi(optarg); // yes, I know the atoi bug
+      wishList.videoDatarate = boost::lexical_cast<uint32_t>(optarg);
       break;
 
     case 'D':
       wishList.changeAudioDatarate = true;
-      wishList.audioDatarate = atoi(optarg);
+      wishList.audioDatarate = boost::lexical_cast<uint32_t>(optarg);
       break;
 
     case 'c':
-      withVideoComments = true;
       CmdlineExtractor::extractCommentPairs(videoComments, optarg, ';',
                                             '=');
       break;
 
     case 'C':
-      withAudioComments = true;
       CmdlineExtractor::extractCommentPairs(audioComments, optarg, ';',
                                             '=');
       break;
 
     case 'N':
       wishList.changeAudioChannels = true;
-      wishList.audioChannels = atoi(optarg);
+      wishList.audioChannels = boost::lexical_cast<uint32_t>(optarg);
       if ( (wishList.audioChannels != 1 )
            && (wishList.audioChannels != 2 ))
         wishList.changeAudioChannels = false;
@@ -433,7 +426,7 @@ int oggTranscodeCmd(int argc, char* argv[])
 
     case 'F':
       wishList.changeAudioSamplerate = true;
-      wishList.audioSamplerate = atoi(optarg);
+      wishList.audioSamplerate = boost::lexical_cast<uint32_t>(optarg);
       break;
 
     case 't':
@@ -441,7 +434,7 @@ int oggTranscodeCmd(int argc, char* argv[])
       break;
 
     case 'p':
-      wishList.preview = atoi(optarg);
+      wishList.preview = boost::lexical_cast<uint32_t>(optarg);
       wishList.ignoreVorbis = true;
       break;
 
@@ -489,7 +482,6 @@ int oggTranscodeCmd(int argc, char* argv[])
 
 
   /* load all png pictures that should later be used */
-  /* I have to think this over - maybe not the best solution */
   for (uint32 i(0); i<blendListBefore.size(); ++i) {
     try {
       RGBPlane plane;
@@ -545,7 +537,7 @@ int oggTranscodeCmd(int argc, char* argv[])
   streamMap.resize(demuxerInformation.size(), 255);
 
   /* These are the information ordered, by the stream IDs from the input stream */
-  std::vector<HookHandler*> hookList;
+  std::vector<std::shared_ptr<HookHandler> > hookList;
   std::vector<StreamConfig> muxerInformation;
 
   bool foundTheora( false);
@@ -560,14 +552,14 @@ int oggTranscodeCmd(int argc, char* argv[])
     StreamConfig& decoderConfig(demuxerInformation[i]);
 
     if (decoderConfig.type == OggType::theora) {
-      if (foundTheora == false) {
+      if (!foundTheora) {
         foundTheora = true;
         StreamConfig encoderConfig;
 
-        TheoraStreamParameter* theoraEncoderConfig(0);
-        TheoraStreamParameter* theoraDecoderConfig(0);
+        std::shared_ptr<TheoraStreamParameter> theoraEncoderConfig;
+        std::shared_ptr<TheoraStreamParameter> theoraDecoderConfig;
 
-        VideoHook* vHook(new VideoHook(streamCounter, false, true ));
+        std::shared_ptr<VideoHook> vHook = std::make_shared<VideoHook>(streamCounter, false, true );
 
         /* configure the video hook */
         vHook->configureProcess(videoHookConfig);
@@ -581,11 +573,10 @@ int oggTranscodeCmd(int argc, char* argv[])
         vHook->setDecoderConfig(decoderConfig, decoderComments);
 
         /* grap the information extracted by the decoder */
-        theoraDecoderConfig
-          = static_cast<TheoraStreamParameter*>(decoderConfig.parameter);
+        theoraDecoderConfig = std::dynamic_pointer_cast<TheoraStreamParameter>(decoderConfig.parameter);
 
         /* create a config for the output stream and keep a pointer */
-        theoraEncoderConfig = new TheoraStreamParameter;
+        theoraEncoderConfig = std::make_shared<TheoraStreamParameter>();
 
         /* add the pointer to the configuration */
         encoderConfig.parameter = theoraEncoderConfig;
@@ -618,15 +609,15 @@ int oggTranscodeCmd(int argc, char* argv[])
     }
 
     if (decoderConfig.type == OggType::vorbis) {
-      if (foundVorbis == false) {
+      if (!foundVorbis) {
         StreamConfig encoderConfig;
 
-        VorbisStreamParameter* vorbisEncoderConfig(0);
-        VorbisStreamParameter* vorbisDecoderConfig(0);
+        std::shared_ptr<VorbisStreamParameter> vorbisEncoderConfig;
+        std::shared_ptr<VorbisStreamParameter> vorbisDecoderConfig;
 
         foundVorbis = true;
 
-        AudioHook* aHook (new AudioHook(streamCounter, false, true ));
+        std::shared_ptr<AudioHook> aHook = std::make_shared<AudioHook>(streamCounter, false, true );
         hookList.push_back(aHook);
 
         /* We only need these information for the information printout */
@@ -636,11 +627,11 @@ int oggTranscodeCmd(int argc, char* argv[])
         aHook->setDecoderConfig(decoderConfig, decoderComments);
 
         /* create a config for this stream */
-        vorbisEncoderConfig = new VorbisStreamParameter;
+        vorbisEncoderConfig = std::make_shared<VorbisStreamParameter>();
 
         /* */
         vorbisDecoderConfig
-          = static_cast<VorbisStreamParameter*>(decoderConfig.parameter);
+          = std::dynamic_pointer_cast<VorbisStreamParameter>(decoderConfig.parameter);
 
         /* */
         encoderConfig.parameter = vorbisEncoderConfig;
@@ -668,7 +659,7 @@ int oggTranscodeCmd(int argc, char* argv[])
       continue;
     }
 
-    logger.error() << "There is actually no stream handler available to resize this stream \n";
+    logger.warning() << "There is actually no stream handler available to resize stream "<< decoderConfig.streamNo<<"\n";
   }
 
   /* configure stream hook */
@@ -724,7 +715,6 @@ int oggTranscodeCmd(int argc, char* argv[])
       streamCreate << packet;
     }
 
-    delete hookList[i];
   }
 
   /* set end of stream and do everything neccessary */
diff --git a/src/effect/pictureLoader.cpp b/src/effect/pictureLoader.cpp
index 0242853..14c888a 100644
--- a/src/effect/pictureLoader.cpp
+++ b/src/effect/pictureLoader.cpp
@@ -235,7 +235,7 @@ bool PictureLoader::save(RGBPlane& pic, const std::string& filename, uint32 newW
       gdImagePng(resampled, out);
       break;
 
-    //    case suffix_gif:
+      //    case suffix_gif:
 
     default:
       logger.error() << "cannot identify suffix\n";
@@ -256,7 +256,7 @@ bool PictureLoader::save(RGBPlane& pic, const std::string& filename, uint32 newW
       gdImagePng(im, out);
       break;
 
-    //    case suffix_gif:
+      //    case suffix_gif:
 
     default:
       logger.error() << "cannot identify suffix\n";
diff --git a/src/effect/rgbPlane.h b/src/effect/rgbPlane.h
index 4cb4d2b..1cf1e0f 100644
--- a/src/effect/rgbPlane.h
+++ b/src/effect/rgbPlane.h
@@ -30,12 +30,10 @@ public:
 
   virtual ~RGBPlane();
 
-  const uint32 getWidth() const
-  {
+  const uint32 getWidth() const {
     return objPtr->width;
   }
-  const uint32 getHeight() const
-  {
+  const uint32 getHeight() const {
     return objPtr->height;
   }
 
diff --git a/src/header.dat b/src/header.dat
new file mode 100644
index 0000000..400a973
--- /dev/null
+++ b/src/header.dat
@@ -0,0 +1,51 @@
+SDLvideoOutput.h
+audioPacket.h
+crc.h
+definition.h
+fileRepository.h
+granulePosInterpreter.h
+jackAudioOutput.h
+mediaConfig.h
+mediaContainer.h
+mediaControlPacket.h
+mediaConverter.h
+mediaDecoder.h
+mediaEncoder.h
+mediaOutputDecoder.h
+mediaPacket.h
+mediaRepository.h
+mediaStream.h
+mediaUnit.h
+oggBOSExtractorFactory.h
+oggConfig.h
+oggDecoder.h
+oggDecoderFactory.h
+oggEncoder.h
+oggHeader.h
+oggPacket.h
+oggPage.h
+oggRingbuffer.h
+oggStreamDecoder.h
+oggStreamEncoder.h
+oggTypes.h
+rawMediaPacket.h
+refObject.h
+ringbuffer.h
+streamConfig.h
+streamExtractor.h
+streamMux.h
+streamParameter.h
+streamSerializer.h
+theoraConfig.h
+theoraDecoder.h
+theoraExtractor.h
+theoraHeader.h
+theoraPosInterpreter.h
+theoraStreamParameter.h
+theoraVideoPacket.h
+videoInfo.h
+vorbisDecoder.h
+vorbisExtractor.h
+vorbisHeader.h
+vorbisPosInterpreter.h
+vorbisStreamParameter.h
diff --git a/src/main/audioHook.cpp b/src/main/audioHook.cpp
index 5776b4a..929d3f7 100644
--- a/src/main/audioHook.cpp
+++ b/src/main/audioHook.cpp
@@ -14,8 +14,8 @@ AudioHook::AudioHook(uint8 outStreamID, const bool copy, const bool keepComments
 {
 //	logger.debug() << "Vorbis Encoder stream No "<<(int)outStreamID<<std::endl;
 
-  outputDecoder = new VorbisDecoder;
-  inputEncoder = new VorbisEncoder(outStreamID);
+  outputDecoder.reset(new VorbisDecoder);
+  inputEncoder.reset(new VorbisEncoder(outStreamID));
 
 }
 
@@ -26,17 +26,13 @@ AudioHook::~AudioHook()
 
 void AudioHook::initAndConnect()
 {
-  VorbisDecoder& decoder = static_cast<VorbisDecoder&>(*outputDecoder);
-  VorbisEncoder& encoder = static_cast<VorbisEncoder&>(*inputEncoder);
+  VorbisDecoder& decoder = static_cast<VorbisDecoder&>(*outputDecoder.get());
+  VorbisEncoder& encoder = static_cast<VorbisEncoder&>(*inputEncoder.get());
 
-  if (!copyOnly) {
+  copy = true;
 
-    if (decoder.getInfo() == encoder.getInfo())
-      copy = true;
-    else
-      copy = false;
-
-  }
+  if (!copyOnly)
+    copy = decoder.getInfo() == encoder.getInfo();
 
   if (!copy) {
     if (decoder.getInfo().channels != encoder.getInfo().channels)
diff --git a/src/main/hookHandler.cpp b/src/main/hookHandler.cpp
index 3300e12..d72d401 100644
--- a/src/main/hookHandler.cpp
+++ b/src/main/hookHandler.cpp
@@ -2,14 +2,12 @@
 #include "hookHandler.h"
 
 HookHandler::HookHandler(const bool _copy, const bool _keepComments)
-  : copyOnly(_copy), reencode(false), keepComments(_keepComments), inPacketCounter(0), outPacketCounter(0), outputDecoder(0), inputEncoder(0)
+  : copyOnly(_copy), reencode(false), keepComments(_keepComments), inPacketCounter(0), outPacketCounter(0)
 {
 }
 
 HookHandler::~HookHandler()
 {
-  delete outputDecoder;
-  delete inputEncoder;
 }
 
 /* refactor StreamConfig to be const*/
diff --git a/src/main/hookHandler.h b/src/main/hookHandler.h
index a291fa9..b9501d3 100644
--- a/src/main/hookHandler.h
+++ b/src/main/hookHandler.h
@@ -18,8 +18,8 @@ protected:
   uint64 outPacketCounter;
   std::vector<OggComment> comments;
 
-  MediaOutputDecoder* outputDecoder;
-  MediaInputEncoder*  inputEncoder;
+  std::unique_ptr<MediaOutputDecoder> outputDecoder;
+  std::unique_ptr<MediaInputEncoder>  inputEncoder;
   std::deque<OggPacket> packetList;
 
 
diff --git a/src/main/oggBOSExtractorFactory.cpp b/src/main/oggBOSExtractorFactory.cpp
index 8bee556..54d193e 100644
--- a/src/main/oggBOSExtractorFactory.cpp
+++ b/src/main/oggBOSExtractorFactory.cpp
@@ -107,7 +107,7 @@ GranulePosInterpreter* OggBOSExtractorFactory::extractPositionInterpreter(Extrac
   }
 
   if (retPosInterpreter)
-    retPosInterpreter->initialize(info.parameter);
+    retPosInterpreter->initialize(info.parameter.get());
 
   return(retPosInterpreter);
 }
diff --git a/src/main/streamMux.cpp b/src/main/streamMux.cpp
index 662b80f..4577db4 100644
--- a/src/main/streamMux.cpp
+++ b/src/main/streamMux.cpp
@@ -47,15 +47,15 @@ MuxStreamEntry::~MuxStreamEntry()
 }
 
 StreamMux::StreamMux(MediaRepository* _repository)
-  : timeOfLastPage(0.0), redoTiming(true), repository(_repository)
+  : m_timeOfLastPage(0.0), m_redoTiming(true), m_repository(_repository)
 {
 }
 
 StreamMux::~StreamMux()
 {
-  for (uint32 i(0); i<streamList.size(); ++i) {
-    delete streamList[i].streamEncoder;
-    delete streamList[i].posInterpreter;
+  for (uint32 i(0); i<m_streamList.size(); ++i) {
+    delete m_streamList[i].streamEncoder;
+    delete m_streamList[i].posInterpreter;
   }
   close();
 
@@ -63,17 +63,17 @@ StreamMux::~StreamMux()
 
 void StreamMux::recreatePacketPosition(bool _redoTiming)
 {
-  redoTiming = _redoTiming;
+  m_redoTiming = _redoTiming;
 }
 
 void StreamMux::writeToRepository()
 {
   RawMediaPacket rawPacket;
 
-  // write the data bunches to the repository
-  while (oggEncoder.isAvailable()) {
-    oggEncoder    >> rawPacket;
-    (*repository) << rawPacket;
+  // write the data bunches to the m_repository
+  while (m_oggEncoder.isAvailable()) {
+    m_oggEncoder    >> rawPacket;
+    (*m_repository) << rawPacket;
   }
 
 }
@@ -83,39 +83,43 @@ void StreamMux::insertHeader()
   OggPage oggPage;
 
   /* first set all BOS Packets/Pages */
-  for (uint32 i(0); i<streamList.size(); ++i) {
+  for (uint32 i(0); i<m_streamList.size(); ++i) {
 
-    if (!streamList[i].used)
+    if (!m_streamList[i].used)
       continue;
 
     // easier access
-    OggStreamEncoder& encoder = *streamList[i].streamEncoder;
+    OggStreamEncoder& encoder = *m_streamList[i].streamEncoder;
 
-    encoder << streamList[i].streamConfig.headerList[0];
+    //logger.info() << "inserting first header packet: \n" << m_streamList[i].streamConfig.headerList[0]->toString(10);
+
+    encoder << m_streamList[i].streamConfig.headerList[0];
 
     // we do not have to flush, the encoder knows, that the bos
     // page needs a clean page
 
     if (encoder.isAvailable()) {
       encoder    >> oggPage;
-      oggEncoder << oggPage;
+      m_oggEncoder << oggPage;
 
     }
   }
 
   /* then set the rest of the packets */
-  for (uint32 i(0); i<streamList.size(); ++i) {
+  for (uint32 i(0); i<m_streamList.size(); ++i) {
 
     /* if there are no additional header available, do nothing */
-    if (streamList[i].streamConfig.headerList.size() <= 1)
+    if (m_streamList[i].streamConfig.headerList.size() <= 1)
       continue;
 
     // easier access
-    OggStreamEncoder& encoder = *streamList[i].streamEncoder;
+    OggStreamEncoder& encoder = *m_streamList[i].streamEncoder;
 
     // insert the rest of the header files
-    for (uint32 j(1); j<streamList[i].streamConfig.headerList.size(); ++j)
-      encoder << streamList[i].streamConfig.headerList[j];
+    for (uint32 j(1); j<m_streamList[i].streamConfig.headerList.size(); ++j) {
+//      logger.info() << "inserting first header packet: \n" << m_streamList[i].streamConfig.headerList[j]->toString(3);
+      encoder << m_streamList[i].streamConfig.headerList[j];
+    }
 
     // place the additional header packets on a clean page
     encoder.flush();
@@ -123,13 +127,13 @@ void StreamMux::insertHeader()
     // write all pages to the ogg encoder
     while (encoder.isAvailable()) {
       encoder    >> oggPage;
-      oggEncoder << oggPage;
+      m_oggEncoder << oggPage;
     }
 
-    streamList[i].lastPacketNo = streamList[i].streamConfig.headerList.size()-1;
+    m_streamList[i].lastPacketNo = m_streamList[i].streamConfig.headerList.size()-1;
   }
 
-  // write the data to the repository
+  // write the data to the m_repository
   writeToRepository();
 
 }
@@ -140,24 +144,26 @@ void StreamMux::writeToOggEncoder()
   // at least one packet of every stream available
   // This is because we might not know the end of stream
 
-  while (!outputPageList.empty()) {
+  while (!m_outputPageList.empty()) {
 
     // get the first page
-    OggPage nextPage = outputPageList.back().page;
+    OggPage nextPage = m_outputPageList.back().page;
+
+    // logger.info() << nextPage->toString(5);
 
     uint8 streamNo(nextPage->getStreamNo());
 
     // this is the real return reason, the Page list
-    // should never be empty
-    if (streamList[streamNo].bufferElemCounter < 2)
+    // should never be m_empty
+    if (m_streamList.at(streamNo).bufferElemCounter < 2)
       break;
 
     // insert the packet into the ogg encoder
-    oggEncoder << nextPage;
+    m_oggEncoder << nextPage;
 
     // decrement the marker for the elements of this stream
-    streamList[streamNo].bufferElemCounter--;
-    outputPageList.pop_back();
+    m_streamList.at(streamNo).bufferElemCounter--;
+    m_outputPageList.pop_back();
 
   }
 
@@ -169,30 +175,30 @@ void StreamMux::flushOggEncoder()
   // now we search for the last page of every stream
   // and mark it as the "End of Stream"
 
-  while (!outputPageList.empty()) {
+  while (!m_outputPageList.empty()) {
 
     // get the first page
-    OggPage nextPage = outputPageList.back().page;
+    OggPage nextPage = m_outputPageList.back().page;
 
     uint8 streamNo(nextPage->getStreamNo());
 
     // is this the last page of this stream, then mark it
-    if (streamList[streamNo].bufferElemCounter == 1) {
+    if (m_streamList.at(streamNo).bufferElemCounter == 1) {
       nextPage->setEOS();
       nextPage->createCRC();
     }
 
     // insert the packet into the ogg encoder
-    oggEncoder << nextPage;
+    m_oggEncoder << nextPage;
 
     // decrement the marker for the elements of this stream
-    streamList[streamNo].bufferElemCounter--;
+    m_streamList.at(streamNo).bufferElemCounter--;
 
-    outputPageList.pop_back();
+    m_outputPageList.pop_back();
   }
 
   // flush the encoder (actually does nothing)
-  oggEncoder.flush();
+  m_oggEncoder.flush();
 
 }
 
@@ -201,8 +207,8 @@ bool StreamMux::allBuffersEmpty()
   // run through the list and find out, if there is
   // a filled buffer
 
-  for (uint32 i(0); i<streamList.size(); ++i)
-    if (!streamList[i].empty)
+  for (uint32 i(0); i<m_streamList.size(); ++i)
+    if (!m_streamList[i].empty)
       return(false);
 
   return(true);
@@ -213,13 +219,13 @@ bool StreamMux::findAndInsertNextPage()
   double nextTime(-2);
   uint8  nextID(0);
 
-  for (uint32 i(0); i<streamList.size(); ++i) {
+  for (uint32 i(0); i<m_streamList.size(); ++i) {
 
-    if (streamList[i].empty)
+    if (m_streamList[i].empty)
       continue;
 
-    if ((nextTime < -1) || (streamList[i].nextTime < nextTime)) {
-      nextTime = streamList[i].nextTime;
+    if ((nextTime < -1) || (m_streamList[i].nextTime < nextTime)) {
+      nextTime = m_streamList[i].nextTime;
       nextID   = i;
     }
   }
@@ -229,30 +235,30 @@ bool StreamMux::findAndInsertNextPage()
     return(false);
 
   // insert the found page into the page list
-  OutputElement elem(streamList[nextID].nextPage, streamList[nextID].nextTime);
+  OutputElement elem(m_streamList[nextID].nextPage, m_streamList[nextID].nextTime);
 
-  std::list<OutputElement>::iterator iter(outputPageList.begin());
+  std::list<OutputElement>::iterator iter(m_outputPageList.begin());
 
   // -1 is a problem!
   if (elem.time < 0) {
-    elem.time = timeOfLastPage; // should we care for the stream No?
+    elem.time = m_timeOfLastPage; // should we care for the stream No?
   }
 
-  while ((iter != outputPageList.end()) && (elem.time < iter->time))
+  while ((iter != m_outputPageList.end()) && (elem.time < iter->time))
     ++iter;
 
-  outputPageList.insert(iter, elem);
+  m_outputPageList.insert(iter, elem);
 
-  timeOfLastPage = elem.time;
+  m_timeOfLastPage = elem.time;
 
   // page has been added to the output list, mark the entry as free
-  streamList[nextID].empty = true;
+  m_streamList[nextID].empty = true;
 
   // increment the number of elements in the, that
   // belongs to this stream
   // we need to know that, to be able to ensure that at least
   // one packet of every stream is not written to the ogg encoder
-  streamList[nextID].bufferElemCounter++;
+  m_streamList[nextID].bufferElemCounter++;
 
   // write the data
   writeToOggEncoder();
@@ -264,16 +270,16 @@ void StreamMux::handleNextPage(OggPage& page, uint8 streamNo)
 {
   /* here we look, if there is a page in the buffer
    * if yes, look into the other buffers and insert the pages into
-   * the outputPageList by their time order until the page buffer,
+   * the m_outputPageList by their time order until the page buffer,
    * we are looking for is free */
 
-  MuxStreamEntry& entry = streamList[streamNo];
+  page->setStreamNo(streamNo);
+  MuxStreamEntry& entry = m_streamList.at(streamNo);
 
   while (!entry.empty) {
     findAndInsertNextPage();
   }
 
-  page->setStreamNo(streamNo);
   entry.nextPage = page;
   entry.empty    = false;
   entry.nextTime = entry.posInterpreter->getTime(page->granulepos());
@@ -283,7 +289,7 @@ void StreamMux::handleNextPage(OggPage& page, uint8 streamNo)
 
 void StreamMux::configureStreams(std::vector<StreamConfig>& config)
 {
-  streamList.resize(config.size());
+  m_streamList.resize(config.size());
 
   for (uint32 i(0); i<config.size(); ++i) {
 
@@ -298,7 +304,7 @@ void StreamMux::configureStreams(std::vector<StreamConfig>& config)
 
     MuxStreamEntry entry(config[i], streamEncoder, posInterpreter);
 
-    streamList[config[i].streamNo] = entry;
+    m_streamList[config[i].streamNo] = entry;
 
   }
 
@@ -310,7 +316,7 @@ StreamMux& StreamMux::operator<<(OggPacket& packet)
 {
 
   // easier access
-  MuxStreamEntry& entry     = streamList[packet->getStreamNo()];
+  MuxStreamEntry& entry     = m_streamList.at(packet->getStreamNo());
 
   // can we handle this packet - if not, this packet will be discarded
   if (!entry.used) {
@@ -321,7 +327,7 @@ StreamMux& StreamMux::operator<<(OggPacket& packet)
   OggStreamEncoder& encoder = *entry.streamEncoder;
 
   // first we set a valid granule position to the packet
-  if (redoTiming)
+  if (m_redoTiming)
     entry.posInterpreter->setStreamPosition(packet);
 
   // then we place this packet into the stream encoder
@@ -343,9 +349,9 @@ StreamMux& StreamMux::operator<<(OggPacket& packet)
 void StreamMux::setEndOfStream()
 {
   // flush the rest, if there is some
-  for (uint32 i(0); i<streamList.size(); ++i) {
+  for (uint32 i(0); i<m_streamList.size(); ++i) {
 
-    MuxStreamEntry& entry = streamList[i];
+    MuxStreamEntry& entry = m_streamList[i];
 
     if (!entry.used)
       continue;
@@ -371,9 +377,9 @@ void StreamMux::setEndOfStream()
 
 void StreamMux::close()
 {
-  if (repository) {
-    repository->close();
-    delete repository;
-    repository = 0;
+  if (m_repository) {
+    m_repository->close();
+    delete m_repository;
+    m_repository = 0;
   }
 }
diff --git a/src/main/streamMux.h b/src/main/streamMux.h
index 413b8fd..c4136b3 100644
--- a/src/main/streamMux.h
+++ b/src/main/streamMux.h
@@ -61,7 +61,7 @@ public:
 };
 
 //! streamMux creates a new ogg media stream
-/*! This object awaits a repository with the constructor, which informs
+/*! This object awaits a m_repository with the constructor, which informs
  *  the object about where to write the information to.
  *  Additional it awaits a vector of Stream Config information to set up
  *  the header and the granule position correctly.
@@ -79,16 +79,16 @@ protected:
       : page(_page), time(_time) {}
   };
 
-  double           timeOfLastPage;
+  double           m_timeOfLastPage;
 
-  bool             redoTiming;
+  bool             m_redoTiming;
 
-  OggEncoder       oggEncoder;
-  MediaRepository* repository;
+  OggEncoder       m_oggEncoder;
+  MediaRepository* m_repository;
 
-  std::vector<MuxStreamEntry> streamList;
-  //std::list<OggPage> outputPageList;
-  std::list<OutputElement> outputPageList;
+  std::vector<MuxStreamEntry> m_streamList;
+  //std::list<OggPage> m_outputPageList;
+  std::list<OutputElement> m_outputPageList;
 
   bool allBuffersEmpty();
 
diff --git a/src/main/streamSerializer.cpp b/src/main/streamSerializer.cpp
index 4d4a6f4..8cd4d73 100644
--- a/src/main/streamSerializer.cpp
+++ b/src/main/streamSerializer.cpp
@@ -218,7 +218,7 @@ void StreamSerializer::close()
   delete oggDecoder;
   oggDecoder = 0;
 
-  /* close the repository */
+  /* close the m_repository */
   if (repository) {
     repository->close();
     delete repository;
@@ -255,10 +255,10 @@ bool StreamSerializer::fillPage()
     // is there no packet available within the ogg page decoder
     while (!oggDecoder->isAvailable()) {
 
-      // is there any data bunch available from the repository?
+      // is there any data bunch available from the m_repository?
       if (!repository->isAvailable()) {
 
-        // if there is no more data at the repository, there is an error
+        // if there is no more data at the m_repository, there is an error
         // in the stream/file
         return (false);
       }
diff --git a/src/main/videoHook.cpp b/src/main/videoHook.cpp
index d069d45..8f604f0 100644
--- a/src/main/videoHook.cpp
+++ b/src/main/videoHook.cpp
@@ -33,9 +33,10 @@ VideoHook::VideoHook(uint8 outStreamID, const bool copy, const bool keepComments
   // even if we don't need them
   // specially the encoder may be needed later, if the
   // input comes from another source
-  outputDecoder = new TheoraDecoder;
-//  logger.debug() << "Theora Encoder stream No "<<(int)outStreamID<<std::endl;
-  inputEncoder = new TheoraEncoder(outStreamID);
+
+  outputDecoder.reset(new TheoraDecoder);
+  inputEncoder.reset(new TheoraEncoder(outStreamID));
+
   th_clean_ycbcr(outycbcr);
   th_clean_ycbcr(inycbcr);
 
@@ -56,8 +57,8 @@ HookHandler& VideoHook::operator<<(OggPacket& packet)
   if (!inputEncoder)
     throw OggException("VideoHook::callHook: no inputEncoder given");
 
-  TheoraDecoder& decoder = static_cast<TheoraDecoder&>(*outputDecoder);
-  TheoraEncoder& encoder = static_cast<TheoraEncoder&>(*inputEncoder);
+  TheoraDecoder& decoder = static_cast<TheoraDecoder&>(*outputDecoder.get());
+  TheoraEncoder& encoder = static_cast<TheoraEncoder&>(*inputEncoder.get());
 
   // What is the best way to receive the time?!
   // best way may be to recalculate the time due to the number of packets
@@ -142,14 +143,6 @@ HookHandler& VideoHook::operator<<(OggPacket& packet)
     }
   }
 
-// logger.debug() << "time in Sec: "<<posCreator.getActTime()<<" ( "<<posCreator.getPosition()<<" ) ";
-  /*
-    int64 keyframe;
-    int32 intra;
-    posCreator.extractFramePos(posCreator.getPosition(), keyframe, intra);
-    logger.debug() << " < "<<keyframe<<" : "<<intra<<" > ";
-    logger.debug() << (posCreator::packetIsKeyframe())
-  */
   return(*this);
 }
 
@@ -157,7 +150,7 @@ void VideoHook::setEncoderConfig(StreamConfig& config,
                                  std::vector<OggComment>& commentList)
 {
   HookHandler::setEncoderConfig(config, commentList);
-  posCreator.initialize(config.parameter);
+  posCreator.initialize(config.parameter.get());
 }
 
 void VideoHook::resetEncoder()
@@ -172,8 +165,8 @@ void VideoHook::initAndConnect()
   // specified
   // at this point every thing must be configured.
   // So the comparison could take place
-  TheoraDecoder& decoder = static_cast<TheoraDecoder&>(*outputDecoder);
-  TheoraEncoder& encoder = static_cast<TheoraEncoder&>(*inputEncoder);
+  TheoraDecoder& decoder = static_cast<TheoraDecoder&>(*outputDecoder.get());
+  TheoraEncoder& encoder = static_cast<TheoraEncoder&>(*inputEncoder.get());
 
   /* if this is a reinitialisation, remember the offset */
   timeOffset = time;
@@ -186,34 +179,12 @@ void VideoHook::initAndConnect()
   /* if it is ok, that we do a reencoding, than we could trim the output */
   if (!copyOnly) {
     /* if both stream configurations are equal, they could be copied */
-    if ((decoder.getInfo() == encoder.getInfo()) && !reencode) {
-      copy = true;
-    } else
-      copy = false;
+    copy = (decoder.getInfo() == encoder.getInfo()) && !reencode;
 
     /* maybe only the datarate/quality is different in this case, we can copy the
      * stream. But maybe somebody wants to trim the datarate/quality. In this case
      * we do not copy (very difficult ;-)*/
-    /*
-        if ( !copy && !config.trimDatarateOrQuality) {
-          if ((decoder.getInfo().aspect_denominator == encoder.getInfo().aspect_denominator) &&
-              ( decoder.getInfo().aspect_numerator == encoder.getInfo().aspect_numerator  ) &&
-              ( decoder.getInfo().fps_denominator == encoder.getInfo().fps_denominator) &&
-              ( decoder.getInfo().fps_numerator == encoder.getInfo().fps_numerator) &&
-              ( decoder.getInfo().frame_height == encoder.getInfo().frame_height) &&
-              ( decoder.getInfo().frame_width == encoder.getInfo().frame_width) &&
-              ( decoder.getInfo().pic_height == decoder.getInfo().pic_height) &&
-              ( decoder.getInfo().pic_width == encoder.getInfo().pic_width) &&
-              ( decoder.getInfo().pic_x == encoder.getInfo().pic_x) &&
-              ( decoder.getInfo().pic_y == encoder.getInfo().pic_y) &&
-              ( decoder.getInfo().pixel_fmt == encoder.getInfo().pixel_fmt) &&
-              ( decoder.getInfo().colorspace == encoder.getInfo().colorspace) &&
-              ( decoder.getInfo().keyframe_granule_shift == encoder.getInfo().keyframe_granule_shift)) {
-            // everything is equal except the datarate, so we can copy
-            copy = true;
-          }
-        }
-    */
+
     /* if the picture size is different, we need to resize the video */
     if ((decoder.getInfo().pic_width != encoder.getInfo().pic_width) ||
         (decoder.getInfo().pic_height != encoder.getInfo().pic_height))
@@ -268,7 +239,7 @@ void VideoHook::alphaBlend(double time, RGBPlane& inPlane,
     switch (blendList[i].state) {
     case BlendElement::blend_off: {
       if (time >= blendList[i].startTime) {
-        if (blendList[i].smooth == true) {
+        if (blendList[i].smooth) {
           blendList[i].state = BlendElement::blend_slideIn;
         } else {
           blendList[i].intensity = 1.0;
@@ -292,7 +263,7 @@ void VideoHook::alphaBlend(double time, RGBPlane& inPlane,
     case BlendElement::blend_on: {
       if ( (blendList[i].endTime > 0.0 )
            && (time >= blendList[i].endTime )) {
-        if (blendList[i].smooth == true) {
+        if (blendList[i].smooth) {
           blendList[i].state = BlendElement::blend_slideOut;
         } else {
           blendList[i].intensity = 0.0;
diff --git a/src/old/SDLvideoOutput.cpp b/src/old/SDLvideoOutput.cpp
deleted file mode 100644
index 913bc1b..0000000
--- a/src/old/SDLvideoOutput.cpp
+++ /dev/null
@@ -1,106 +0,0 @@
-#include <iostream>
-
-#include "SDLvideoOutput.h"
-#include "log.h"
-
-SDLvideoOutput::SDLvideoOutput()
-  : MediaUnit(write, "SDLvideoOutput")
-{
-}
-
-SDLvideoOutput::SDLvideoOutput(VideoInfo& info)
-  : MediaUnit(write, "SDLvideoOutput")
-{
-  init(info);
-}
-
-void SDLvideoOutput::init(VideoInfo& info)
-{
-  videoInfo = info;
-
-  if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) {
-    logger.error() << "Unable to init SDL: "<< SDL_GetError() << std::endl;
-    return;
-  }
-
-  screen = SDL_SetVideoMode(info.frame_width, info.frame_height, 0, SDL_SWSURFACE);
-  if ( screen == NULL ) {
-    logger.error() << "Unable to set " << info.frame_width <<" " << info.frame_height
-                   << " video: " << SDL_GetError() << std::endl;
-    return;
-  }
-
-  yuv_overlay = SDL_CreateYUVOverlay(info.frame_width, info.frame_height,
-                                     SDL_YV12_OVERLAY,
-                                     screen);
-  if ( yuv_overlay == NULL ) {
-    logger.error() << "SDLvideoOutput::init: Couldn't create SDL_yuv_overlay:" << SDL_GetError();
-    return;
-  }
-  rect.x = 0;
-  rect.y = 0;
-  rect.w = info.frame_width;
-  rect.h = info.frame_height;
-
-  SDL_DisplayYUVOverlay(yuv_overlay, &rect);
-
-}
-
-SDLvideoOutput::~SDLvideoOutput()
-{
-  SDL_Quit();
-  logger.debug() << std::endl;
-}
-
-//SDLvideoOutput& SDLvideoOutput::operator<<(TheoraVideoPacket packet)
-SDLvideoOutput& SDLvideoOutput::operator<<(th_ycbcr_buffer packet)
-{
-  int i;
-//  yuv_buffer yuv = packet.getYuvBuffer();
-  int crop_offset;
-
-  /* Lock SDL_yuv_overlay */
-  if ( SDL_MUSTLOCK(screen) ) {
-    if ( SDL_LockSurface(screen) < 0 ) {
-      logger.error() << "SDLvideoOutput::operator<<: ERROR SDL_LockSurface\n";
-      return(*this);
-    }
-  }
-  if (SDL_LockYUVOverlay(yuv_overlay) < 0) {
-    logger.error() << "SDLvideoOutput::operator<<: ERROR SDL_YUVOverlay\n";
-    return(*this);
-  }
-
-  /* let's draw the data (*yuv[3]) on a SDL screen (*screen) */
-  /* deal with border stride */
-  /* reverse u and v for SDL */
-  /* and crop input properly, respecting the encoded frame rect */
-  crop_offset=videoInfo.offset_x+packet[0].stride*videoInfo.offset_y;
-  for (i=0; i<yuv_overlay->h; i++)
-    memcpy(yuv_overlay->pixels[0]+yuv_overlay->pitches[0]*i,
-           packet[0].data+crop_offset+packet[0].stride*i,
-           yuv_overlay->w);
-  crop_offset=(videoInfo.offset_x/2)+(packet[1].stride)*(videoInfo.offset_y/2);
-  for (i=0; i<yuv_overlay->h/2; i++) {
-    memcpy(yuv_overlay->pixels[2]+yuv_overlay->pitches[2]*i,
-           packet[1].data+crop_offset+packet[1].stride*i,
-           yuv_overlay->w/2);
-    memcpy(yuv_overlay->pixels[1]+yuv_overlay->pitches[1]*i,
-           packet[2].data+crop_offset+packet[2].stride*i,
-           yuv_overlay->w/2);
-  }
-
-  logger.debug() << ".";
-
-  /* Unlock SDL_yuv_overlay */
-  if ( SDL_MUSTLOCK(screen) ) {
-    SDL_UnlockSurface(screen);
-  }
-  SDL_UnlockYUVOverlay(yuv_overlay);
-
-  /* Show, baby, show! */
-  SDL_DisplayYUVOverlay(yuv_overlay, &rect);
-
-  return(*this);
-
-}
diff --git a/src/old/SDLvideoOutput.h b/src/old/SDLvideoOutput.h
deleted file mode 100644
index 7fafc2f..0000000
--- a/src/old/SDLvideoOutput.h
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef SDLVIDEOOUTPUT_H_
-#define SDLVIDEOOUTPUT_H_
-
-#include "mediaUnit.h"
-//#include "theoraVideoPacket.h"
-#include "videoInfo.h"
-#include <theora/codec.h>
-#include <SDL/SDL.h>
-
-class SDLvideoOutput : public MediaUnit {
-protected:
-  SDL_Surface *screen;
-  SDL_Overlay *yuv_overlay;
-  SDL_Rect     rect;
-
-  VideoInfo    videoInfo;
-
-public:
-  SDLvideoOutput();
-  SDLvideoOutput(VideoInfo& info);
-  virtual ~SDLvideoOutput();
-
-  void init(VideoInfo& info);
-
-//  SDLvideoOutput& operator<<(TheoraVideoPacket packet);
-  SDLvideoOutput& operator<<(th_ycbcr_buffer packet);
-};
-
-#endif /*SDLVIDEOOUTPUT_H_*/
diff --git a/src/old/jackAudioOutput.h b/src/old/jackAudioOutput.h
deleted file mode 100644
index 69d0cb3..0000000
--- a/src/old/jackAudioOutput.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef jackAudioOutput_h
-#define jackAudioOutput_h
-
-#include "mediaUnit.h"
-#include "audioPacket.h"
-
-class JackAudioOutput : public MediaUnit {
-
-protected:
-
-
-public:
-  JackAudioOutput();
-  virtual ~JackAudioOutput();
-
-  JackAudioOutput& operator<<(AudioPacket audioPacket);
-
-};
-
-#endif
\ No newline at end of file
diff --git a/src/old/memFactory.h b/src/old/memFactory.h
deleted file mode 100644
index b0bab3f..0000000
--- a/src/old/memFactory.h
+++ /dev/null
@@ -1,96 +0,0 @@
-#ifndef MEMFACTORY_H_
-#define MEMFACTORY_H_
-
-#include <list>
-#include <iostream>
-
-#include "definition.h"
-
-template <class C> class MemFactory {
-private:
-
-  static const uint32 maxElements = 20;
-
-  template <class T> class MemElem {
-  public:
-    bool used;
-    T* memRegion;
-    uint32 size;
-  };
-
-  std::list<MemElem<C> > list;
-  typename std::list<MemElem<C> >::iterator it;
-
-public:
-  MemFactory();
-  virtual ~MemFactory();
-
-  C* getMemElement(uint32 size);
-  void returnMemElement(C* elem);
-
-};
-
-template <class C> inline MemFactory<C>::MemFactory()
-{
-}
-
-template <class C> inline MemFactory<C>::~MemFactory()
-{
-
-  it = list.begin();
-
-  for (; it != list.end(); it++)
-    delete[] it->memRegion;
-}
-
-template <class C> inline C* MemFactory<C>::getMemElement(uint32 size)
-{
-  /* is there an unused data portion available, then use it */
-  it = list.begin();
-
-  for (; it != list.end(); it++)
-    if ((!it->used) && (it->size == size))
-      break;
-
-  MemElem<C> elem;
-  if (it ==list.end()) {
-    //		logger.debug() << "Create new Element\n";
-    elem.used = true;
-    elem.size = size;
-    elem.memRegion = new C[size];
-  } else {
-    elem = (*it);
-    elem.used = true;
-    list.erase(it);
-  }
-
-  list.push_back(elem);
-
-  if (list.size() > maxElements)
-    for (it = list.begin(); it != list.end(); it++) {
-      if (!it->used) {
-        //				logger.debug() << "Delete an Element\n";
-        delete[] it->memRegion;
-        list.erase(it);
-        break;
-      }
-    }
-
-  return (elem.memRegion);
-
-}
-
-template <class C> inline void MemFactory<C>::returnMemElement(C* elem)
-{
-  it = list.begin();
-
-  for (; it != list.end(); it++)
-    if (it->memRegion == elem) {
-      it->used = false;
-      //			logger.debug() << "Free new Element\n";
-      break;
-    }
-
-}
-
-#endif /*MEMFACTORY_H_*/
diff --git a/src/old/oggConfig.cpp b/src/old/oggConfig.cpp
deleted file mode 100644
index ac14325..0000000
--- a/src/old/oggConfig.cpp
+++ /dev/null
@@ -1,9 +0,0 @@
-#include "oggConfig.h"
-
-OggConfig::OggConfig()
-{
-}
-
-OggConfig::~OggConfig()
-{
-}
diff --git a/src/old/oggConfig.h b/src/old/oggConfig.h
deleted file mode 100644
index acf467b..0000000
--- a/src/old/oggConfig.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef OGGCONFIG_H_
-#define OGGCONFIG_H_
-
-#include "mediaConfig.h"
-
-class OggConfig : public MediaConfig {
-public:
-  OggConfig();
-  virtual ~OggConfig();
-
-
-
-};
-
-#endif /*OGGCONFIG_H_*/
diff --git a/src/ovt_kate/kateExtractor.cpp b/src/ovt_kate/kateExtractor.cpp
index c523cec..50e7837 100644
--- a/src/ovt_kate/kateExtractor.cpp
+++ b/src/ovt_kate/kateExtractor.cpp
@@ -33,7 +33,7 @@ bool KateExtractor::_extract(uint8* data, ExtractorInformation& info)
   }
 
   // first extract the parameters
-  KateStreamParameter* param = new KateStreamParameter;
+  std::shared_ptr<KateStreamParameter> param(new KateStreamParameter);
 
   param->granulerateNum   = (kateHeader->granulerateNumerator);
   param->granulerateDenom = (kateHeader->granulerateDenominator);
@@ -43,9 +43,6 @@ bool KateExtractor::_extract(uint8* data, ExtractorInformation& info)
   param->category = std::string(kateHeader->category, 16);
 
   /* are there any old info stored, then delete them */
-  if (info.parameter)
-    delete info.parameter;
-
   info.parameter = param;
 
   /* set the ogg type and the number of header packets */
diff --git a/src/ovt_theora/theoraDecoder.cpp b/src/ovt_theora/theoraDecoder.cpp
index 9e17ace..60516ed 100644
--- a/src/ovt_theora/theoraDecoder.cpp
+++ b/src/ovt_theora/theoraDecoder.cpp
@@ -33,6 +33,7 @@
 
 #include <theora/codec.h>
 #include <theora/theoradec.h>
+#include <ogg/ogg.h>
 #include "exception.h"
 #include "log.h"
 
@@ -132,23 +133,23 @@ void TheoraDecoder::initDecoder(StreamConfig& config,
     throw OggException("TheoraDecoder::initDecoder: th_decode_alloc failed");
   }
 
-  TheoraStreamParameter* theoraConfig = dynamic_cast<TheoraStreamParameter*>(config.parameter);
-
-  theoraConfig->aspectRatioDenom = theoraInfo.aspect_denominator;
-  theoraConfig->aspectRatioNum = theoraInfo.aspect_numerator;
-  theoraConfig->colorspace = (TheoraStreamParameter::ColorSpace) theoraInfo.colorspace;
-  theoraConfig->framerateDenom = theoraInfo.fps_denominator;
-  theoraConfig->framerateNum   = theoraInfo.fps_numerator;
-  theoraConfig->pictureX    = theoraInfo.pic_width;
-  theoraConfig->pictureY    = theoraInfo.pic_height;
-  theoraConfig->frameX      = theoraInfo.frame_width;
-  theoraConfig->frameY      = theoraInfo.frame_height;
-  theoraConfig->frameXOffset = theoraInfo.pic_x;
-  theoraConfig->frameYOffset = theoraInfo.pic_y;
-  theoraConfig->keyframeShift = theoraInfo.keyframe_granule_shift;
-  theoraConfig->pixel_fmt    = (TheoraStreamParameter::PixFormat) theoraInfo.pixel_fmt;
-  theoraConfig->videoBitrate = theoraInfo.target_bitrate;
-  theoraConfig->videoQuality = theoraInfo.quality;
+  TheoraStreamParameter& theoraConfig = dynamic_cast<TheoraStreamParameter&>(*config.parameter.get());
+
+  theoraConfig.aspectRatioDenom = theoraInfo.aspect_denominator;
+  theoraConfig.aspectRatioNum = theoraInfo.aspect_numerator;
+  theoraConfig.colorspace = (TheoraStreamParameter::ColorSpace) theoraInfo.colorspace;
+  theoraConfig.framerateDenom = theoraInfo.fps_denominator;
+  theoraConfig.framerateNum   = theoraInfo.fps_numerator;
+  theoraConfig.pictureX    = theoraInfo.pic_width;
+  theoraConfig.pictureY    = theoraInfo.pic_height;
+  theoraConfig.frameX      = theoraInfo.frame_width;
+  theoraConfig.frameY      = theoraInfo.frame_height;
+  theoraConfig.frameXOffset = theoraInfo.pic_x;
+  theoraConfig.frameYOffset = theoraInfo.pic_y;
+  theoraConfig.keyframeShift = theoraInfo.keyframe_granule_shift;
+  theoraConfig.pixel_fmt    = (TheoraStreamParameter::PixFormat) theoraInfo.pixel_fmt;
+  theoraConfig.videoBitrate = theoraInfo.target_bitrate;
+  theoraConfig.videoQuality = theoraInfo.quality;
 
   /* set the state machine */
   setConfigured();
diff --git a/src/ovt_theora/theoraDecoder.h b/src/ovt_theora/theoraDecoder.h
index a089d90..6d44ab1 100644
--- a/src/ovt_theora/theoraDecoder.h
+++ b/src/ovt_theora/theoraDecoder.h
@@ -37,6 +37,7 @@
 #include "definition.h"
 
 #include "mediaOutputDecoder.h"
+#include "theoraStreamParameter.h"
 
 class TheoraDecoder : public MediaOutputDecoder {
 
@@ -49,7 +50,7 @@ protected:
   th_dec_ctx*    theoraDecState;
 
   std::list<OggPacket>   packetList;
-  std::vector<OggPacket> headerList;
+//  std::vector<OggPacket> headerList;
 
   uint8 initCount;
   uint32 packetCount;
@@ -68,7 +69,6 @@ public:
 
   TheoraDecoder& operator>>(th_ycbcr_buffer& picture);
 
-//  virtual std::string getInfoString();
 
   th_info&        getInfo();
   th_comment&     getComment();
@@ -85,6 +85,7 @@ public:
 
   virtual std::string configuration() const;
 
+
 };
 
 #endif // WITH_LIBTHEORA
diff --git a/src/ovt_theora/theoraEncoder.cpp b/src/ovt_theora/theoraEncoder.cpp
index e186a0d..0b73006 100644
--- a/src/ovt_theora/theoraEncoder.cpp
+++ b/src/ovt_theora/theoraEncoder.cpp
@@ -31,6 +31,7 @@
 #include <sstream>
 #include <cstdlib>
 #include <cstring>
+#include <ogg/ogg.h>
 
 #include "exception.h"
 #include "log.h"
@@ -62,25 +63,29 @@ void TheoraEncoder::createHeader(std::vector<OggPacket>& headerList, std::vector
     th_comment_add_tag(&theoraComment, (char*) oggComments[i].tag.c_str(), (char*) oggComments[i].value.c_str());
 
   while (encodeRetID > 0) {
-    OggPacket packet = std::make_shared<OggPacketInternal>();
-    encodeRetID = th_encode_flushheader(theoraState, &theoraComment, packet->getUnderlayingOggPacketPtr());
+    ogg_packet tmpPkt;
+    encodeRetID = th_encode_flushheader(theoraState, &theoraComment, &tmpPkt); //packet->getUnderlayingOggPacketPtr());
+
+    if (encodeRetID == TH_EFAULT)
+      throw OggException("TheoraEncoder::operator <<: encoder or packet are NULL");
+
     //    ost::slog(ost::Slog::levelDebug) << "TheoraEncoder:: inserting header/n";
+    if (encodeRetID > 0) {
+      OggPacket packet = std::make_shared<OggPacketInternal>(tmpPkt);
 
 #ifdef DEBUG
-    logger.debug() << "Theora Packet Number: "<< packet.packetno << "reset to 0" << std::endl;
+      logger.debug() << "Theora Packet Number: "<< packet.packetno << "reset to 0" << std::endl;
 #endif
 
-    packet->setStreamType(OggType::theora);
-    packet->setStreamNo(streamNo);
-    packet->setStreamHeader();
-    packet->setPacketno(0);
-
-    headerList.push_back(packet);
+      packet->setStreamType(OggType::theora);
+      packet->setStreamNo(streamNo);
+      packet->setStreamHeader();
+      packet->setPacketno(0);
 
+      headerList.push_back(packet);
+    }
   }
 
-  if (encodeRetID == TH_EFAULT)
-    throw OggException("TheoraEncoder::operator <<: encoder or packet are NULL");
 
 }
 
@@ -98,40 +103,37 @@ void TheoraEncoder::configureEncoder(StreamConfig& streamConf, std::vector<OggCo
   if (isConfigured())
     throw OggException("TheoraEncoder::configureEncoder: can't configure encoder twice");
 
-  TheoraStreamParameter* config = dynamic_cast<TheoraStreamParameter*>(streamConf.parameter);
-
-  if (!config)
-    throw OggException("TheoraEncoder::configureEncoder: wrong configuration");
+  TheoraStreamParameter& config = dynamic_cast<TheoraStreamParameter&>(*streamConf.parameter.get());
 
   // Theora has a divisible-by-sixteen restriction for the encoded video size
   // scale the frame size up to the nearest /16 and calculate offsets
 
-  config->frameX  = (config->pictureX+15)&~0xF;
-  config->frameY  = (config->pictureY+15)&~0xF;
+  config.frameX  = (config.pictureX+15)&~0xF;
+  config.frameY  = (config.pictureY+15)&~0xF;
 
   // We force the offset to be even.
   // This ensures that the chroma samples align properly with the luma
   // samples.
 
-//  config->frameXOffset  = ((config->frameX - config->pictureX)/2)&~1;
-//  config->frameYOffset  = ((config->frameY - config->pictureY)/2)&~1;
-//  config->frameXOffset = 0;
-//  config->frameYOffset = 0;
+//  config.frameXOffset  = ((config.frameX - config.pictureX)/2)&~1;
+//  config.frameYOffset  = ((config.frameY - config.pictureY)/2)&~1;
+//  config.frameXOffset = 0;
+//  config.frameYOffset = 0;
 
   // let's initialize the theora encoder
   th_info_init(&theoraInfo);
 
-  theoraInfo.pic_width          = config->pictureX;
-  theoraInfo.pic_height         = config->pictureY;
-  theoraInfo.frame_width        = config->frameX;
-  theoraInfo.frame_height       = config->frameY;
-  theoraInfo.pic_x              = config->frameXOffset;
-  theoraInfo.pic_y              = config->frameYOffset;
-  theoraInfo.fps_numerator      = config->framerateNum;
-  theoraInfo.fps_denominator    = config->framerateDenom;
-  theoraInfo.aspect_numerator   = config->aspectRatioNum;
-  theoraInfo.aspect_denominator = config->aspectRatioDenom;
-  switch ( config->colorspace ) {
+  theoraInfo.pic_width          = config.pictureX;
+  theoraInfo.pic_height         = config.pictureY;
+  theoraInfo.frame_width        = config.frameX;
+  theoraInfo.frame_height       = config.frameY;
+  theoraInfo.pic_x              = config.frameXOffset;
+  theoraInfo.pic_y              = config.frameYOffset;
+  theoraInfo.fps_numerator      = config.framerateNum;
+  theoraInfo.fps_denominator    = config.framerateDenom;
+  theoraInfo.aspect_numerator   = config.aspectRatioNum;
+  theoraInfo.aspect_denominator = config.aspectRatioDenom;
+  switch ( config.colorspace ) {
   case TheoraStreamParameter::ITU_470M:
     theoraInfo.colorspace = TH_CS_ITU_REC_470M;
     break;
@@ -142,7 +144,7 @@ void TheoraEncoder::configureEncoder(StreamConfig& streamConf, std::vector<OggCo
     theoraInfo.colorspace = TH_CS_UNSPECIFIED;
     break;
   }
-  switch (config->pixel_fmt) {
+  switch (config.pixel_fmt) {
   case TheoraStreamParameter::pf_420:
     theoraInfo.pixel_fmt      = TH_PF_420;
     break;
@@ -157,9 +159,9 @@ void TheoraEncoder::configureEncoder(StreamConfig& streamConf, std::vector<OggCo
     break;
   }
 
-  theoraInfo.target_bitrate     = config->videoBitrate;
-  theoraInfo.quality            = config->videoQuality;
-  theoraInfo.keyframe_granule_shift = config->keyframeShift; // 6 bit to distinguish interframes
+  theoraInfo.target_bitrate     = config.videoBitrate;
+  theoraInfo.quality            = config.videoQuality;
+  theoraInfo.keyframe_granule_shift = config.keyframeShift; // 6 bit to distinguish interframes
 
   // TODO: Pixel Format should be available in config
   /* create a new theora encoder handle */
@@ -172,11 +174,10 @@ void TheoraEncoder::configureEncoder(StreamConfig& streamConf, std::vector<OggCo
 
   createHeader(streamConf.headerList, oggComments);
 
-  streamConf.serialNo = rand();
+  streamConf.serialNo = (uint32) rand();
   streamConf.streamNo = streamNo;
   streamConf.type = OggType::theora;
-  streamConf.numOfHeaderPackets = streamConf.headerList.size();
-
+  streamConf.numOfHeaderPackets = (uint8) streamConf.headerList.size();
 
   // reset the packet counter if encoder is reconfigured
   packetCounter = 0;
@@ -218,29 +219,30 @@ MediaInputEncoder& TheoraEncoder::operator <<(th_ycbcr_buffer buffer)
 
   while ( encodeRetID > 0) {
 
-    OggPacket packet = std::make_shared<OggPacketInternal>();
+    ogg_packet _packet;
+    encodeRetID = th_encode_packetout(theoraState, 0, &_packet);
+
+    /* Spec says:
+     * 	_op 	An ogg_packet structure to fill. All of the elements of this structure will be set,
+     * 	including a pointer to the video data. The memory for the video data is owned by libtheoraenc,
+     * 	and may be invalidated when the next encoder function is called.
+     * 	This means, data may be lost and cannot be used in a packet list, so we need to copy,
+     * 	this really kills performance ... */
+    if (encodeRetID > 0) {
+      OggPacket packet = std::make_shared<OggPacketInternal>(_packet);
 
-    encodeRetID = th_encode_packetout(theoraState, 0, packet->getUnderlayingOggPacketPtr());
 #ifdef DEBUG
-    logger.debug() << "Theora Packet Number: "<< packet.packetno<<std::endl;
-    logger.debug() << "Theora Packet Length: "<< packet.bytes<<std::endl;
+      logger.debug() << "Theora Packet Number: "<< packet.packetno<<std::endl;
+      logger.debug() << "Theora Packet Length: "<< packet.bytes<<std::endl;
 #endif
 
-    packet->setStreamType(OggType::theora);
-    packet->setStreamNo(streamNo);
-
-    packetList.push_back(packet);
+      packet->setStreamType(OggType::theora);
+      packet->setStreamNo(streamNo);
 
-
-    // This is not really nice, but there is no function available to tell us
-    // if any data is waiting in advance, so we have to allocate memory, even,
-    // if there might not be any data any more
-    //packet = new OggPacketInternal;
+      packetList.push_back(packet);
+    }
   }
 
-  // anyway the last packet request will always fail, so forget the last packet
-  //delete packet;
-
   if (encodeRetID == TH_EFAULT)
     throw OggException("TheoraEncoder::operator <<: encoder or packet are NULL");
 
diff --git a/src/ovt_theora/theoraExtractor.cpp b/src/ovt_theora/theoraExtractor.cpp
index 9b4b15e..49cf5f2 100644
--- a/src/ovt_theora/theoraExtractor.cpp
+++ b/src/ovt_theora/theoraExtractor.cpp
@@ -2,12 +2,10 @@
 #include <cstring>
 
 #include "theoraExtractor.h"
-#include "definition.h"
-#include "oggTypes.h"
+
 #include "oggHeader.h"
 #include "theoraHeader.h"
 #include "theoraStreamParameter.h"
-#include "theoraPosInterpreter.h"
 #include "log.h"
 
 TheoraExtractor::TheoraExtractor()
@@ -32,7 +30,7 @@ bool TheoraExtractor::_extract(uint8* data, ExtractorInformation& info)
   }
 
   // first extract the parameters
-  TheoraStreamParameter* param = new TheoraStreamParameter;
+  std::shared_ptr<TheoraStreamParameter> param = std::make_shared<TheoraStreamParameter>();
 
   // for all the calculation, we need to convert some fields
   theoraHeader->un.pleaseconvert = convert16(theoraHeader->un.pleaseconvert);
@@ -63,10 +61,6 @@ bool TheoraExtractor::_extract(uint8* data, ExtractorInformation& info)
   // to have the original packet, we recover the data
   theoraHeader->un.pleaseconvert = convert16(theoraHeader->un.pleaseconvert);
 
-  /* are there any old info stored, then delete them */
-  if (info.parameter)
-    delete info.parameter;
-
   info.parameter = param;
 
   /* set the ogg type and the number of header packets */
@@ -89,7 +83,7 @@ bool TheoraExtractor::extract(OggPage& oggPage, ExtractorInformation& informatio
   OggHeader* oggHeader  = (OggHeader*) dataPtr;
   uint8*     data       = dataPtr + sizeof(OggHeader) + oggHeader->tableSegments;
 
-  if (_extract(data, information) == false)
+  if (!_extract(data, information))
     return(false);
 
   information.serialNo = oggHeader->serial;
@@ -105,8 +99,6 @@ bool TheoraExtractor::extract(OggPacket& packet, ExtractorInformation& informati
     return(false);
   }
 
-  if (_extract(packet->data(), information) == false)
-    return(false);
+  return _extract(packet->data(), information);
 
-  return(true);
 }
diff --git a/src/ovt_theora/theoraPosInterpreter.cpp b/src/ovt_theora/theoraPosInterpreter.cpp
index 673e59c..2ea2e1d 100644
--- a/src/ovt_theora/theoraPosInterpreter.cpp
+++ b/src/ovt_theora/theoraPosInterpreter.cpp
@@ -91,11 +91,11 @@ void TheoraPosInterpreter::initialize(OggPage oggPage)
   initialized = true;
 }
 
-void TheoraPosInterpreter::initialize(OggPacket oggPacket)
+void TheoraPosInterpreter::initialize(OggPacket m_oggPacket)
 {
 
-  StreamType*   streamInformation = (StreamType*) (oggPacket.data());
-  TheoraHeader* theoraHeader      = (TheoraHeader*) (oggPacket.data() + sizeof(StreamType));
+  StreamType*   streamInformation = (StreamType*) (m_oggPacket.data());
+  TheoraHeader* theoraHeader      = (TheoraHeader*) (m_oggPacket.data() + sizeof(StreamType));
 
   if ((streamInformation->headerType != 0x80) ||
       (strncmp(streamInformation->typeName, "theora", 6) != 0)) {
diff --git a/src/ovt_vorbis/vorbisDecoder.cpp b/src/ovt_vorbis/vorbisDecoder.cpp
index f87b863..32e75e2 100644
--- a/src/ovt_vorbis/vorbisDecoder.cpp
+++ b/src/ovt_vorbis/vorbisDecoder.cpp
@@ -87,14 +87,14 @@ void VorbisDecoder::initDecoder(StreamConfig& config, std::vector<OggComment>& o
   vorbis_synthesis_init(&vorbisDspState,&vorbisInfo);
   vorbis_block_init(&vorbisDspState,&vorbisBlock);
 
-  VorbisStreamParameter* vorbisConfig = dynamic_cast<VorbisStreamParameter*>(config.parameter);
-
-  vorbisConfig->samplerate = vorbisInfo.rate;
-  vorbisConfig->channels   = vorbisInfo.channels;
-  vorbisConfig->datarate   = vorbisInfo.bitrate_nominal;
-  vorbisConfig->datarateMin = vorbisInfo.bitrate_lower;
-  vorbisConfig->datarateMax = vorbisInfo.bitrate_upper;
-  vorbisConfig->datarateWin = vorbisInfo.bitrate_window;
+  VorbisStreamParameter& vorbisConfig = dynamic_cast<VorbisStreamParameter&>(*config.parameter.get());
+
+  vorbisConfig.samplerate = vorbisInfo.rate;
+  vorbisConfig.channels   = vorbisInfo.channels;
+  vorbisConfig.datarate   = vorbisInfo.bitrate_nominal;
+  vorbisConfig.datarateMin = vorbisInfo.bitrate_lower;
+  vorbisConfig.datarateMax = vorbisInfo.bitrate_upper;
+  vorbisConfig.datarateWin = vorbisInfo.bitrate_window;
 
   /* set the state machine */
   setConfigured();
diff --git a/src/ovt_vorbis/vorbisDecoder.h b/src/ovt_vorbis/vorbisDecoder.h
index 3bcdfc2..515659f 100644
--- a/src/ovt_vorbis/vorbisDecoder.h
+++ b/src/ovt_vorbis/vorbisDecoder.h
@@ -49,8 +49,7 @@ public:
   virtual void clear();
 
   virtual double getTimeOfNextPacket();
-  virtual uint32 getPositionOfNextPacket()
-  {
+  virtual uint32 getPositionOfNextPacket() {
     return packetCount;
   }
 
diff --git a/src/ovt_vorbis/vorbisEncoder.cpp b/src/ovt_vorbis/vorbisEncoder.cpp
index fb8f881..aa519a7 100644
--- a/src/ovt_vorbis/vorbisEncoder.cpp
+++ b/src/ovt_vorbis/vorbisEncoder.cpp
@@ -18,7 +18,6 @@ VorbisEncoder::VorbisEncoder(uint8 _streamNo) :
 
 VorbisEncoder::~VorbisEncoder()
 {
-//  logger.debug() << "Vorbis Encoder produced "<<pktCnt<<" packets\n";
 
   if (isConfigured()) {
     vorbis_block_clear(&vorbisBlock);
@@ -40,16 +39,13 @@ void VorbisEncoder::configureEncoder(StreamConfig& streamConfig, std::vector<Ogg
 
   vorbis_info_init(&vorbisInfo);
 
-  VorbisStreamParameter* config = dynamic_cast<VorbisStreamParameter*>(streamConfig.parameter);
-
-  if (!config)
-    throw OggException("VorbisEncoder::configureEncoder: no valid vorbis config");
+  VorbisStreamParameter& config = dynamic_cast<VorbisStreamParameter&>(*streamConfig.parameter.get());
 
   /*	int32 ret = vorbis_encode_init(&vorbisInfo, config.channels,
    config.samplerate, config.datarate, config.datarate, config.datarate);
    */
-  int32 ret = vorbis_encode_init(&vorbisInfo, config->channels,
-                                 config->samplerate, -1, config->datarate, -1);
+  int32 ret = vorbis_encode_init(&vorbisInfo, config.channels,
+                                 config.samplerate, -1, config.datarate, -1);
 
   /* do not continue if setup failed; this can happen if we ask for a
    mode that libVorbis does not support (eg, too low a bitrate, etc,
@@ -151,14 +147,17 @@ MediaInputEncoder& VorbisEncoder::operator<<(AudioPacket& aPacket)
    block for encoding now */
   while ((vorbis_analysis_blockout(&vorbisState, &vorbisBlock))==1) {
 
-    OggPacket packet = std::make_shared<OggPacketInternal>();
-
+    //OggPacket packet = std::make_shared<OggPacketInternal>();
+    ogg_packet tmpPkt;
     /* analysis, assume we want to use bitrate management */
     vorbis_analysis(&vorbisBlock,0);
     vorbis_bitrate_addblock(&vorbisBlock);
 
-    while (vorbis_bitrate_flushpacket(&vorbisState, packet->getUnderlayingOggPacketPtr())) {
+    while (vorbis_bitrate_flushpacket(&vorbisState, &tmpPkt/*packet->getUnderlayingOggPacketPtr()*/)) {
 //			logger.debug() << "Position: "<<packet.granulepos<<std::endl;
+
+      //    ost::slog(ost::Slog::levelDebug) << "TheoraEncoder:: inserting header/n";
+      OggPacket packet = std::make_shared<OggPacketInternal>(tmpPkt);
       packet->setStreamType(OggType::vorbis);
       packet->setStreamNo(streamNo);
 #ifdef DEBUG
@@ -178,7 +177,7 @@ MediaInputEncoder& VorbisEncoder::operator<<(AudioPacket& aPacket)
 MediaInputEncoder& VorbisEncoder::operator >>(OggPacket& packet)
 {
   if (packetList.empty())
-    throw OggException("VorbisEncoder::operator>> PacketList is empty");
+    throw OggException("VorbisEncoder::operator>> PacketList is m_empty");
 
   packet = packetList.front();
   packetList.pop_front();
@@ -208,8 +207,11 @@ void VorbisEncoder::flush()
 
     while ( do_flush ) {
 //      logger.debug() << "Flush: "<<packet.granulepos<<std::endl;
-      OggPacket packet = std::make_shared<OggPacketInternal>();
-      do_flush = vorbis_bitrate_flushpacket(&vorbisState, packet->getUnderlayingOggPacketPtr());
+      ogg_packet tmpPkt;
+      do_flush = vorbis_bitrate_flushpacket(&vorbisState, &tmpPkt) == 1;
+
+      //    ost::slog(ost::Slog::levelDebug) << "TheoraEncoder:: inserting header/n";
+      OggPacket packet = std::make_shared<OggPacketInternal>(tmpPkt);
 
       packet->setStreamType(OggType::vorbis);
       packet->setStreamNo(streamNo);
diff --git a/src/ovt_vorbis/vorbisExtractor.cpp b/src/ovt_vorbis/vorbisExtractor.cpp
index 6cb12d6..42914b2 100644
--- a/src/ovt_vorbis/vorbisExtractor.cpp
+++ b/src/ovt_vorbis/vorbisExtractor.cpp
@@ -29,7 +29,7 @@ bool VorbisExtractor::_extract(uint8* data, ExtractorInformation& info)
   }
 
   // first extract the parameters
-  VorbisStreamParameter* param = new VorbisStreamParameter;
+  std::shared_ptr<VorbisStreamParameter> param = std::make_shared<VorbisStreamParameter>();
 
   param->channels    = vorbisHeader->audioChannels;
   param->samplerate  = vorbisHeader->sampleRate;
@@ -40,9 +40,6 @@ bool VorbisExtractor::_extract(uint8* data, ExtractorInformation& info)
   param->block0      = 1<<vorbisHeader->blocksize0;
   param->block1      = 1<<vorbisHeader->blocksize1;
 
-  if (info.parameter)
-    delete info.parameter;
-
   info.parameter = param;
 
   /* set the ogg type and the number of header packets */
@@ -65,7 +62,7 @@ bool VorbisExtractor::extract(OggPage& oggPage, ExtractorInformation& informatio
   OggHeader* oggHeader  = (OggHeader*) dataPtr;
   uint8*     data       = dataPtr + sizeof(OggHeader) + oggHeader->tableSegments;
 
-  if (_extract(data, information) == false)
+  if (!_extract(data, information))
     return(false);
 
   information.serialNo = oggHeader->serial;
@@ -81,8 +78,6 @@ bool VorbisExtractor::extract(OggPacket& packet, ExtractorInformation& informati
     return(false);
   }
 
-  if (_extract(packet->data(), information) == false)
-    return(false);
+  return _extract(packet->data(), information);
 
-  return(true);
 }
diff --git a/src/ovt_vorbis/vorbisPosInterpreter.cpp b/src/ovt_vorbis/vorbisPosInterpreter.cpp
index 89c2376..b982582 100644
--- a/src/ovt_vorbis/vorbisPosInterpreter.cpp
+++ b/src/ovt_vorbis/vorbisPosInterpreter.cpp
@@ -61,15 +61,15 @@ void VorbisPosInterpreter::initialize(OggPage oggPage)
 
 }
 
-void VorbisPosInterpreter::initialize(OggPacket oggPacket)
+void VorbisPosInterpreter::initialize(OggPacket m_oggPacket)
 {
-  if (oggPacket.length() < (sizeof(StreamType) + sizeof(VorbisHeader))) {
+  if (m_oggPacket.length() < (sizeof(StreamType) + sizeof(VorbisHeader))) {
     logger.error() << "VorbisPosInterpreter::initialize: Error: page is to small - cannot parse header\n";
     return;
   }
 
-  StreamType*   streamInformation = (StreamType*) (oggPacket.data());
-  VorbisHeader* vorbisHeader      = (VorbisHeader*) (oggPacket.data() + sizeof(StreamType));
+  StreamType*   streamInformation = (StreamType*) (m_oggPacket.data());
+  VorbisHeader* vorbisHeader      = (VorbisHeader*) (m_oggPacket.data() + sizeof(StreamType));
 
   if ((streamInformation->headerType != 0x01) ||
       (strncmp(streamInformation->typeName, "vorbis", 6) != 0)) {
diff --git a/src/tools.dox b/src/tools.dox
deleted file mode 100644
index 4ce7e2b..0000000
--- a/src/tools.dox
+++ /dev/null
@@ -1,1294 +0,0 @@
-# Doxyfile 1.5.3
-
-# This file describes the settings to be used by the documentation system
-# doxygen (www.doxygen.org) for a project
-#
-# All text after a hash (#) is considered a comment and will be ignored
-# The format is:
-#       TAG = value [value, ...]
-# For lists items can also be appended using:
-#       TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (" ")
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-
-# This tag specifies the encoding used for all characters in the config file that 
-# follow. The default is UTF-8 which is also the encoding used for all text before 
-# the first occurrence of this tag. Doxygen uses libiconv (or the iconv built into 
-# libc) for the transcoding. See http://www.gnu.org/software/libiconv for the list of 
-# possible encodings.
-
-DOXYFILE_ENCODING      = UTF-8
-
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded 
-# by quotes) that should identify the project.
-
-PROJECT_NAME           = Ogg Video Tools
-
-# The PROJECT_NUMBER tag can be used to enter a project or revision number. 
-# This could be handy for archiving the generated documentation or 
-# if some version control system is used.
-
-PROJECT_NUMBER         = 0.4
-
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
-# base path where the generated documentation will be put. 
-# If a relative path is entered, it will be relative to the location 
-# where doxygen was started. If left blank the current directory will be used.
-
-OUTPUT_DIRECTORY       = 
-
-# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 
-# 4096 sub-directories (in 2 levels) under the output directory of each output 
-# format and will distribute the generated files over these directories. 
-# Enabling this option can be useful when feeding doxygen a huge amount of 
-# source files, where putting all generated files in the same directory would 
-# otherwise cause performance problems for the file system.
-
-CREATE_SUBDIRS         = NO
-
-# The OUTPUT_LANGUAGE tag is used to specify the language in which all 
-# documentation generated by doxygen is written. Doxygen will use this 
-# information to generate all constant output in the proper language. 
-# The default language is English, other supported languages are: 
-# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, 
-# Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian, 
-# Italian, Japanese, Japanese-en (Japanese with English messages), Korean, 
-# Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, 
-# Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian.
-
-OUTPUT_LANGUAGE        = English
-
-# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 
-# include brief member descriptions after the members that are listed in 
-# the file and class documentation (similar to JavaDoc). 
-# Set to NO to disable this.
-
-BRIEF_MEMBER_DESC      = YES
-
-# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 
-# the brief description of a member or function before the detailed description. 
-# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 
-# brief descriptions will be completely suppressed.
-
-REPEAT_BRIEF           = YES
-
-# This tag implements a quasi-intelligent brief description abbreviator 
-# that is used to form the text in various listings. Each string 
-# in this list, if found as the leading text of the brief description, will be 
-# stripped from the text and the result after processing the whole list, is 
-# used as the annotated text. Otherwise, the brief description is used as-is. 
-# If left blank, the following values are used ("$name" is automatically 
-# replaced with the name of the entity): "The $name class" "The $name widget" 
-# "The $name file" "is" "provides" "specifies" "contains" 
-# "represents" "a" "an" "the"
-
-ABBREVIATE_BRIEF       = 
-
-# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 
-# Doxygen will generate a detailed section even if there is only a brief 
-# description.
-
-ALWAYS_DETAILED_SEC    = NO
-
-# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all 
-# inherited members of a class in the documentation of that class as if those 
-# members were ordinary class members. Constructors, destructors and assignment 
-# operators of the base classes will not be shown.
-
-INLINE_INHERITED_MEMB  = NO
-
-# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 
-# path before files name in the file list and in the header files. If set 
-# to NO the shortest path that makes the file name unique will be used.
-
-FULL_PATH_NAMES        = YES
-
-# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 
-# can be used to strip a user-defined part of the path. Stripping is 
-# only done if one of the specified strings matches the left-hand part of 
-# the path. The tag can be used to show relative paths in the file list. 
-# If left blank the directory from which doxygen is run is used as the 
-# path to strip.
-
-STRIP_FROM_PATH        = 
-
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of 
-# the path mentioned in the documentation of a class, which tells 
-# the reader which header file to include in order to use a class. 
-# If left blank only the name of the header file containing the class 
-# definition is used. Otherwise one should specify the include paths that 
-# are normally passed to the compiler using the -I flag.
-
-STRIP_FROM_INC_PATH    = 
-
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter 
-# (but less readable) file names. This can be useful is your file systems 
-# doesn't support long names like on DOS, Mac, or CD-ROM.
-
-SHORT_NAMES            = NO
-
-# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 
-# will interpret the first line (until the first dot) of a JavaDoc-style 
-# comment as the brief description. If set to NO, the JavaDoc 
-# comments will behave just like regular Qt-style comments 
-# (thus requiring an explicit @brief command for a brief description.)
-
-JAVADOC_AUTOBRIEF      = NO
-
-# If the QT_AUTOBRIEF tag is set to YES then Doxygen will 
-# interpret the first line (until the first dot) of a Qt-style 
-# comment as the brief description. If set to NO, the comments 
-# will behave just like regular Qt-style comments (thus requiring 
-# an explicit \brief command for a brief description.)
-
-QT_AUTOBRIEF           = NO
-
-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen 
-# treat a multi-line C++ special comment block (i.e. a block of //! or /// 
-# comments) as a brief description. This used to be the default behaviour. 
-# The new default is to treat a multi-line C++ comment block as a detailed 
-# description. Set this tag to YES if you prefer the old behaviour instead.
-
-MULTILINE_CPP_IS_BRIEF = NO
-
-# If the DETAILS_AT_TOP tag is set to YES then Doxygen 
-# will output the detailed description near the top, like JavaDoc.
-# If set to NO, the detailed description appears after the member 
-# documentation.
-
-DETAILS_AT_TOP         = NO
-
-# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 
-# member inherits the documentation from any documented member that it 
-# re-implements.
-
-INHERIT_DOCS           = YES
-
-# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce 
-# a new page for each member. If set to NO, the documentation of a member will 
-# be part of the file/class/namespace that contains it.
-
-SEPARATE_MEMBER_PAGES  = NO
-
-# The TAB_SIZE tag can be used to set the number of spaces in a tab. 
-# Doxygen uses this value to replace tabs by spaces in code fragments.
-
-TAB_SIZE               = 8
-
-# This tag can be used to specify a number of aliases that acts 
-# as commands in the documentation. An alias has the form "name=value". 
-# For example adding "sideeffect=\par Side Effects:\n" will allow you to 
-# put the command \sideeffect (or @sideeffect) in the documentation, which 
-# will result in a user-defined paragraph with heading "Side Effects:". 
-# You can put \n's in the value part of an alias to insert newlines.
-
-ALIASES                = 
-
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C 
-# sources only. Doxygen will then generate output that is more tailored for C. 
-# For instance, some of the names that are used will be different. The list 
-# of all members will be omitted, etc.
-
-OPTIMIZE_OUTPUT_FOR_C  = NO
-
-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java 
-# sources only. Doxygen will then generate output that is more tailored for Java. 
-# For instance, namespaces will be presented as packages, qualified scopes 
-# will look different, etc.
-
-OPTIMIZE_OUTPUT_JAVA   = NO
-
-# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to 
-# include (a tag file for) the STL sources as input, then you should 
-# set this tag to YES in order to let doxygen match functions declarations and 
-# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. 
-# func(std::string) {}). This also make the inheritance and collaboration 
-# diagrams that involve STL classes more complete and accurate.
-
-BUILTIN_STL_SUPPORT    = NO
-
-# If you use Microsoft's C++/CLI language, you should set this option to YES to
-# enable parsing support.
-
-CPP_CLI_SUPPORT        = NO
-
-# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 
-# tag is set to YES, then doxygen will reuse the documentation of the first 
-# member in the group (if any) for the other members of the group. By default 
-# all members of a group must be documented explicitly.
-
-DISTRIBUTE_GROUP_DOC   = NO
-
-# Set the SUBGROUPING tag to YES (the default) to allow class member groups of 
-# the same type (for instance a group of public functions) to be put as a 
-# subgroup of that type (e.g. under the Public Functions section). Set it to 
-# NO to prevent subgrouping. Alternatively, this can be done per class using 
-# the \nosubgrouping command.
-
-SUBGROUPING            = YES
-
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-
-# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 
-# documentation are documented, even if no documentation was available. 
-# Private class members and static file members will be hidden unless 
-# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
-
-EXTRACT_ALL            = YES
-
-# If the EXTRACT_PRIVATE tag is set to YES all private members of a class 
-# will be included in the documentation.
-
-EXTRACT_PRIVATE        = NO
-
-# If the EXTRACT_STATIC tag is set to YES all static members of a file 
-# will be included in the documentation.
-
-EXTRACT_STATIC         = YES
-
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) 
-# defined locally in source files will be included in the documentation. 
-# If set to NO only classes defined in header files are included.
-
-EXTRACT_LOCAL_CLASSES  = YES
-
-# This flag is only useful for Objective-C code. When set to YES local 
-# methods, which are defined in the implementation section but not in 
-# the interface are included in the documentation. 
-# If set to NO (the default) only methods in the interface are included.
-
-EXTRACT_LOCAL_METHODS  = NO
-
-# If this flag is set to YES, the members of anonymous namespaces will be extracted 
-# and appear in the documentation as a namespace called 'anonymous_namespace{file}', 
-# where file will be replaced with the base name of the file that contains the anonymous 
-# namespace. By default anonymous namespace are hidden.
-
-EXTRACT_ANON_NSPACES   = NO
-
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 
-# undocumented members of documented classes, files or namespaces. 
-# If set to NO (the default) these members will be included in the 
-# various overviews, but no documentation section is generated. 
-# This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_MEMBERS     = NO
-
-# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 
-# undocumented classes that are normally visible in the class hierarchy. 
-# If set to NO (the default) these classes will be included in the various 
-# overviews. This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_CLASSES     = NO
-
-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all 
-# friend (class|struct|union) declarations. 
-# If set to NO (the default) these declarations will be included in the 
-# documentation.
-
-HIDE_FRIEND_COMPOUNDS  = NO
-
-# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any 
-# documentation blocks found inside the body of a function. 
-# If set to NO (the default) these blocks will be appended to the 
-# function's detailed documentation block.
-
-HIDE_IN_BODY_DOCS      = NO
-
-# The INTERNAL_DOCS tag determines if documentation 
-# that is typed after a \internal command is included. If the tag is set 
-# to NO (the default) then the documentation will be excluded. 
-# Set it to YES to include the internal documentation.
-
-INTERNAL_DOCS          = NO
-
-# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 
-# file names in lower-case letters. If set to YES upper-case letters are also 
-# allowed. This is useful if you have classes or files whose names only differ 
-# in case and if your file system supports case sensitive file names. Windows 
-# and Mac users are advised to set this option to NO.
-
-CASE_SENSE_NAMES       = YES
-
-# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 
-# will show members with their full class and namespace scopes in the 
-# documentation. If set to YES the scope will be hidden.
-
-HIDE_SCOPE_NAMES       = NO
-
-# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 
-# will put a list of the files that are included by a file in the documentation 
-# of that file.
-
-SHOW_INCLUDE_FILES     = YES
-
-# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 
-# is inserted in the documentation for inline members.
-
-INLINE_INFO            = YES
-
-# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 
-# will sort the (detailed) documentation of file and class members 
-# alphabetically by member name. If set to NO the members will appear in 
-# declaration order.
-
-SORT_MEMBER_DOCS       = YES
-
-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the 
-# brief documentation of file, namespace and class members alphabetically 
-# by member name. If set to NO (the default) the members will appear in 
-# declaration order.
-
-SORT_BRIEF_DOCS        = NO
-
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be 
-# sorted by fully-qualified names, including namespaces. If set to 
-# NO (the default), the class list will be sorted only by class name, 
-# not including the namespace part. 
-# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
-# Note: This option applies only to the class list, not to the 
-# alphabetical list.
-
-SORT_BY_SCOPE_NAME     = NO
-
-# The GENERATE_TODOLIST tag can be used to enable (YES) or 
-# disable (NO) the todo list. This list is created by putting \todo 
-# commands in the documentation.
-
-GENERATE_TODOLIST      = YES
-
-# The GENERATE_TESTLIST tag can be used to enable (YES) or 
-# disable (NO) the test list. This list is created by putting \test 
-# commands in the documentation.
-
-GENERATE_TESTLIST      = YES
-
-# The GENERATE_BUGLIST tag can be used to enable (YES) or 
-# disable (NO) the bug list. This list is created by putting \bug 
-# commands in the documentation.
-
-GENERATE_BUGLIST       = YES
-
-# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or 
-# disable (NO) the deprecated list. This list is created by putting 
-# \deprecated commands in the documentation.
-
-GENERATE_DEPRECATEDLIST= YES
-
-# The ENABLED_SECTIONS tag can be used to enable conditional 
-# documentation sections, marked by \if sectionname ... \endif.
-
-ENABLED_SECTIONS       = 
-
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines 
-# the initial value of a variable or define consists of for it to appear in 
-# the documentation. If the initializer consists of more lines than specified 
-# here it will be hidden. Use a value of 0 to hide initializers completely. 
-# The appearance of the initializer of individual variables and defines in the 
-# documentation can be controlled using \showinitializer or \hideinitializer 
-# command in the documentation regardless of this setting.
-
-MAX_INITIALIZER_LINES  = 30
-
-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated 
-# at the bottom of the documentation of classes and structs. If set to YES the 
-# list will mention the files that were used to generate the documentation.
-
-SHOW_USED_FILES        = YES
-
-# If the sources in your project are distributed over multiple directories 
-# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy 
-# in the documentation. The default is NO.
-
-SHOW_DIRECTORIES       = NO
-
-# The FILE_VERSION_FILTER tag can be used to specify a program or script that 
-# doxygen should invoke to get the current version for each file (typically from the 
-# version control system). Doxygen will invoke the program by executing (via 
-# popen()) the command <command> <input-file>, where <command> is the value of 
-# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file 
-# provided by doxygen. Whatever the program writes to standard output 
-# is used as the file version. See the manual for examples.
-
-FILE_VERSION_FILTER    = 
-
-#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-
-# The QUIET tag can be used to turn on/off the messages that are generated 
-# by doxygen. Possible values are YES and NO. If left blank NO is used.
-
-QUIET                  = NO
-
-# The WARNINGS tag can be used to turn on/off the warning messages that are 
-# generated by doxygen. Possible values are YES and NO. If left blank 
-# NO is used.
-
-WARNINGS               = YES
-
-# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 
-# for undocumented members. If EXTRACT_ALL is set to YES then this flag will 
-# automatically be disabled.
-
-WARN_IF_UNDOCUMENTED   = YES
-
-# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for 
-# potential errors in the documentation, such as not documenting some 
-# parameters in a documented function, or documenting parameters that 
-# don't exist or using markup commands wrongly.
-
-WARN_IF_DOC_ERROR      = YES
-
-# This WARN_NO_PARAMDOC option can be abled to get warnings for 
-# functions that are documented, but have no documentation for their parameters 
-# or return value. If set to NO (the default) doxygen will only warn about 
-# wrong or incomplete parameter documentation, but not about the absence of 
-# documentation.
-
-WARN_NO_PARAMDOC       = NO
-
-# The WARN_FORMAT tag determines the format of the warning messages that 
-# doxygen can produce. The string should contain the $file, $line, and $text 
-# tags, which will be replaced by the file and line number from which the 
-# warning originated and the warning text. Optionally the format may contain 
-# $version, which will be replaced by the version of the file (if it could 
-# be obtained via FILE_VERSION_FILTER)
-
-WARN_FORMAT            = "$file:$line: $text"
-
-# The WARN_LOGFILE tag can be used to specify a file to which warning 
-# and error messages should be written. If left blank the output is written 
-# to stderr.
-
-WARN_LOGFILE           = 
-
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-
-# The INPUT tag can be used to specify the files and/or directories that contain 
-# documented source files. You may enter file names like "myfile.cpp" or 
-# directories like "/usr/src/myproject". Separate the files or directories 
-# with spaces.
-
-INPUT                  = 
-
-# This tag can be used to specify the character encoding of the source files that 
-# doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default 
-# input encoding. Doxygen uses libiconv (or the iconv built into libc) for the transcoding. 
-# See http://www.gnu.org/software/libiconv for the list of possible encodings.
-
-INPUT_ENCODING         = UTF-8
-
-# If the value of the INPUT tag contains directories, you can use the 
-# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
-# and *.h) to filter out the source-files in the directories. If left 
-# blank the following patterns are tested: 
-# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx 
-# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py
-
-FILE_PATTERNS          = 
-
-# The RECURSIVE tag can be used to turn specify whether or not subdirectories 
-# should be searched for input files as well. Possible values are YES and NO. 
-# If left blank NO is used.
-
-RECURSIVE              = NO
-
-# The EXCLUDE tag can be used to specify files and/or directories that should 
-# excluded from the INPUT source files. This way you can easily exclude a 
-# subdirectory from a directory tree whose root is specified with the INPUT tag.
-
-EXCLUDE                = 
-
-# The EXCLUDE_SYMLINKS tag can be used select whether or not files or 
-# directories that are symbolic links (a Unix filesystem feature) are excluded 
-# from the input.
-
-EXCLUDE_SYMLINKS       = NO
-
-# If the value of the INPUT tag contains directories, you can use the 
-# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 
-# certain files from those directories. Note that the wildcards are matched 
-# against the file with absolute path, so to exclude all test directories 
-# for example use the pattern */test/*
-
-EXCLUDE_PATTERNS       = 
-
-# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names 
-# (namespaces, classes, functions, etc.) that should be excluded from the output. 
-# The symbol name can be a fully qualified name, a word, or if the wildcard * is used, 
-# a substring. Examples: ANamespace, AClass, AClass::ANamespace, ANamespace::*Test
-
-EXCLUDE_SYMBOLS        = 
-
-# The EXAMPLE_PATH tag can be used to specify one or more files or 
-# directories that contain example code fragments that are included (see 
-# the \include command).
-
-EXAMPLE_PATH           = 
-
-# If the value of the EXAMPLE_PATH tag contains directories, you can use the 
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
-# and *.h) to filter out the source-files in the directories. If left 
-# blank all files are included.
-
-EXAMPLE_PATTERNS       = 
-
-# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 
-# searched for input files to be used with the \include or \dontinclude 
-# commands irrespective of the value of the RECURSIVE tag. 
-# Possible values are YES and NO. If left blank NO is used.
-
-EXAMPLE_RECURSIVE      = NO
-
-# The IMAGE_PATH tag can be used to specify one or more files or 
-# directories that contain image that are included in the documentation (see 
-# the \image command).
-
-IMAGE_PATH             = 
-
-# The INPUT_FILTER tag can be used to specify a program that doxygen should 
-# invoke to filter for each input file. Doxygen will invoke the filter program 
-# by executing (via popen()) the command <filter> <input-file>, where <filter> 
-# is the value of the INPUT_FILTER tag, and <input-file> is the name of an 
-# input file. Doxygen will then use the output that the filter program writes 
-# to standard output.  If FILTER_PATTERNS is specified, this tag will be 
-# ignored.
-
-INPUT_FILTER           = 
-
-# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern 
-# basis.  Doxygen will compare the file name with each pattern and apply the 
-# filter if there is a match.  The filters are a list of the form: 
-# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further 
-# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER 
-# is applied to all files.
-
-FILTER_PATTERNS        = 
-
-# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 
-# INPUT_FILTER) will be used to filter the input files when producing source 
-# files to browse (i.e. when SOURCE_BROWSER is set to YES).
-
-FILTER_SOURCE_FILES    = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to source browsing
-#---------------------------------------------------------------------------
-
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will 
-# be generated. Documented entities will be cross-referenced with these sources. 
-# Note: To get rid of all source code in the generated output, make sure also 
-# VERBATIM_HEADERS is set to NO. If you have enabled CALL_GRAPH or CALLER_GRAPH 
-# then you must also enable this option. If you don't then doxygen will produce 
-# a warning and turn it on anyway
-
-SOURCE_BROWSER         = NO
-
-# Setting the INLINE_SOURCES tag to YES will include the body 
-# of functions and classes directly in the documentation.
-
-INLINE_SOURCES         = NO
-
-# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 
-# doxygen to hide any special comment blocks from generated source code 
-# fragments. Normal C and C++ comments will always remain visible.
-
-STRIP_CODE_COMMENTS    = YES
-
-# If the REFERENCED_BY_RELATION tag is set to YES (the default) 
-# then for each documented function all documented 
-# functions referencing it will be listed.
-
-REFERENCED_BY_RELATION = YES
-
-# If the REFERENCES_RELATION tag is set to YES (the default) 
-# then for each documented function all documented entities 
-# called/used by that function will be listed.
-
-REFERENCES_RELATION    = YES
-
-# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
-# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
-# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
-# link to the source code.  Otherwise they will link to the documentstion.
-
-REFERENCES_LINK_SOURCE = YES
-
-# If the USE_HTAGS tag is set to YES then the references to source code 
-# will point to the HTML generated by the htags(1) tool instead of doxygen 
-# built-in source browser. The htags tool is part of GNU's global source 
-# tagging system (see http://www.gnu.org/software/global/global.html). You 
-# will need version 4.8.6 or higher.
-
-USE_HTAGS              = NO
-
-# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 
-# will generate a verbatim copy of the header file for each class for 
-# which an include is specified. Set to NO to disable this.
-
-VERBATIM_HEADERS       = YES
-
-#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 
-# of all compounds will be generated. Enable this if the project 
-# contains a lot of classes, structs, unions or interfaces.
-
-ALPHABETICAL_INDEX     = NO
-
-# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 
-# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 
-# in which this list will be split (can be a number in the range [1..20])
-
-COLS_IN_ALPHA_INDEX    = 5
-
-# In case all classes in a project start with a common prefix, all 
-# classes will be put under the same header in the alphabetical index. 
-# The IGNORE_PREFIX tag can be used to specify one or more prefixes that 
-# should be ignored while generating the index headers.
-
-IGNORE_PREFIX          = 
-
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_HTML tag is set to YES (the default) Doxygen will 
-# generate HTML output.
-
-GENERATE_HTML          = YES
-
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
-# put in front of it. If left blank `html' will be used as the default path.
-
-HTML_OUTPUT            = html
-
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for 
-# each generated HTML page (for example: .htm,.php,.asp). If it is left blank 
-# doxygen will generate files with .html extension.
-
-HTML_FILE_EXTENSION    = .html
-
-# The HTML_HEADER tag can be used to specify a personal HTML header for 
-# each generated HTML page. If it is left blank doxygen will generate a 
-# standard header.
-
-HTML_HEADER            = 
-
-# The HTML_FOOTER tag can be used to specify a personal HTML footer for 
-# each generated HTML page. If it is left blank doxygen will generate a 
-# standard footer.
-
-HTML_FOOTER            = 
-
-# The HTML_STYLESHEET tag can be used to specify a user-defined cascading 
-# style sheet that is used by each HTML page. It can be used to 
-# fine-tune the look of the HTML output. If the tag is left blank doxygen 
-# will generate a default style sheet. Note that doxygen will try to copy 
-# the style sheet file to the HTML output directory, so don't put your own 
-# stylesheet in the HTML output directory as well, or it will be erased!
-
-HTML_STYLESHEET        = 
-
-# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, 
-# files or namespaces will be aligned in HTML using tables. If set to 
-# NO a bullet list will be used.
-
-HTML_ALIGN_MEMBERS     = YES
-
-# If the GENERATE_HTMLHELP tag is set to YES, additional index files 
-# will be generated that can be used as input for tools like the 
-# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) 
-# of the generated HTML documentation.
-
-GENERATE_HTMLHELP      = NO
-
-# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML 
-# documentation will contain sections that can be hidden and shown after the 
-# page has loaded. For this to work a browser that supports 
-# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox 
-# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
-
-HTML_DYNAMIC_SECTIONS  = NO
-
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can 
-# be used to specify the file name of the resulting .chm file. You 
-# can add a path in front of the file if the result should not be 
-# written to the html output directory.
-
-CHM_FILE               = 
-
-# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can 
-# be used to specify the location (absolute path including file name) of 
-# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run 
-# the HTML help compiler on the generated index.hhp.
-
-HHC_LOCATION           = 
-
-# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag 
-# controls if a separate .chi index file is generated (YES) or that 
-# it should be included in the master .chm file (NO).
-
-GENERATE_CHI           = NO
-
-# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag 
-# controls whether a binary table of contents is generated (YES) or a 
-# normal table of contents (NO) in the .chm file.
-
-BINARY_TOC             = NO
-
-# The TOC_EXPAND flag can be set to YES to add extra items for group members 
-# to the contents of the HTML help documentation and to the tree view.
-
-TOC_EXPAND             = NO
-
-# The DISABLE_INDEX tag can be used to turn on/off the condensed index at 
-# top of each HTML page. The value NO (the default) enables the index and 
-# the value YES disables it.
-
-DISABLE_INDEX          = NO
-
-# This tag can be used to set the number of enum values (range [1..20]) 
-# that doxygen will group on one line in the generated HTML documentation.
-
-ENUM_VALUES_PER_LINE   = 4
-
-# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
-# generated containing a tree-like index structure (just like the one that 
-# is generated for HTML Help). For this to work a browser that supports 
-# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, 
-# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are 
-# probably better off using the HTML help feature.
-
-GENERATE_TREEVIEW      = NO
-
-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 
-# used to set the initial width (in pixels) of the frame in which the tree 
-# is shown.
-
-TREEVIEW_WIDTH         = 250
-
-#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 
-# generate Latex output.
-
-GENERATE_LATEX         = YES
-
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
-# put in front of it. If left blank `latex' will be used as the default path.
-
-LATEX_OUTPUT           = latex
-
-# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be 
-# invoked. If left blank `latex' will be used as the default command name.
-
-LATEX_CMD_NAME         = latex
-
-# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to 
-# generate index for LaTeX. If left blank `makeindex' will be used as the 
-# default command name.
-
-MAKEINDEX_CMD_NAME     = makeindex
-
-# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 
-# LaTeX documents. This may be useful for small projects and may help to 
-# save some trees in general.
-
-COMPACT_LATEX          = NO
-
-# The PAPER_TYPE tag can be used to set the paper type that is used 
-# by the printer. Possible values are: a4, a4wide, letter, legal and 
-# executive. If left blank a4wide will be used.
-
-PAPER_TYPE             = a4wide
-
-# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 
-# packages that should be included in the LaTeX output.
-
-EXTRA_PACKAGES         = 
-
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for 
-# the generated latex document. The header should contain everything until 
-# the first chapter. If it is left blank doxygen will generate a 
-# standard header. Notice: only use this tag if you know what you are doing!
-
-LATEX_HEADER           = 
-
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 
-# is prepared for conversion to pdf (using ps2pdf). The pdf file will 
-# contain links (just like the HTML output) instead of page references 
-# This makes the output suitable for online browsing using a pdf viewer.
-
-PDF_HYPERLINKS         = NO
-
-# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 
-# plain latex in the generated Makefile. Set this option to YES to get a 
-# higher quality PDF documentation.
-
-USE_PDFLATEX           = NO
-
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 
-# command to the generated LaTeX files. This will instruct LaTeX to keep 
-# running if errors occur, instead of asking the user for help. 
-# This option is also used when generating formulas in HTML.
-
-LATEX_BATCHMODE        = NO
-
-# If LATEX_HIDE_INDICES is set to YES then doxygen will not 
-# include the index chapters (such as File Index, Compound Index, etc.) 
-# in the output.
-
-LATEX_HIDE_INDICES     = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the RTF output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 
-# The RTF output is optimized for Word 97 and may not look very pretty with 
-# other RTF readers or editors.
-
-GENERATE_RTF           = NO
-
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
-# put in front of it. If left blank `rtf' will be used as the default path.
-
-RTF_OUTPUT             = rtf
-
-# If the COMPACT_RTF tag is set to YES Doxygen generates more compact 
-# RTF documents. This may be useful for small projects and may help to 
-# save some trees in general.
-
-COMPACT_RTF            = NO
-
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 
-# will contain hyperlink fields. The RTF file will 
-# contain links (just like the HTML output) instead of page references. 
-# This makes the output suitable for online browsing using WORD or other 
-# programs which support those fields. 
-# Note: wordpad (write) and others do not support links.
-
-RTF_HYPERLINKS         = NO
-
-# Load stylesheet definitions from file. Syntax is similar to doxygen's 
-# config file, i.e. a series of assignments. You only have to provide 
-# replacements, missing definitions are set to their default value.
-
-RTF_STYLESHEET_FILE    = 
-
-# Set optional variables used in the generation of an rtf document. 
-# Syntax is similar to doxygen's config file.
-
-RTF_EXTENSIONS_FILE    = 
-
-#---------------------------------------------------------------------------
-# configuration options related to the man page output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_MAN tag is set to YES (the default) Doxygen will 
-# generate man pages
-
-GENERATE_MAN           = NO
-
-# The MAN_OUTPUT tag is used to specify where the man pages will be put. 
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
-# put in front of it. If left blank `man' will be used as the default path.
-
-MAN_OUTPUT             = man
-
-# The MAN_EXTENSION tag determines the extension that is added to 
-# the generated man pages (default is the subroutine's section .3)
-
-MAN_EXTENSION          = .3
-
-# If the MAN_LINKS tag is set to YES and Doxygen generates man output, 
-# then it will generate one additional man file for each entity 
-# documented in the real man page(s). These additional files 
-# only source the real man page, but without them the man command 
-# would be unable to find the correct page. The default is NO.
-
-MAN_LINKS              = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the XML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_XML tag is set to YES Doxygen will 
-# generate an XML file that captures the structure of 
-# the code including all documentation.
-
-GENERATE_XML           = NO
-
-# The XML_OUTPUT tag is used to specify where the XML pages will be put. 
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
-# put in front of it. If left blank `xml' will be used as the default path.
-
-XML_OUTPUT             = xml
-
-# The XML_SCHEMA tag can be used to specify an XML schema, 
-# which can be used by a validating XML parser to check the 
-# syntax of the XML files.
-
-XML_SCHEMA             = 
-
-# The XML_DTD tag can be used to specify an XML DTD, 
-# which can be used by a validating XML parser to check the 
-# syntax of the XML files.
-
-XML_DTD                = 
-
-# If the XML_PROGRAMLISTING tag is set to YES Doxygen will 
-# dump the program listings (including syntax highlighting 
-# and cross-referencing information) to the XML output. Note that 
-# enabling this will significantly increase the size of the XML output.
-
-XML_PROGRAMLISTING     = YES
-
-#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will 
-# generate an AutoGen Definitions (see autogen.sf.net) file 
-# that captures the structure of the code including all 
-# documentation. Note that this feature is still experimental 
-# and incomplete at the moment.
-
-GENERATE_AUTOGEN_DEF   = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_PERLMOD tag is set to YES Doxygen will 
-# generate a Perl module file that captures the structure of 
-# the code including all documentation. Note that this 
-# feature is still experimental and incomplete at the 
-# moment.
-
-GENERATE_PERLMOD       = NO
-
-# If the PERLMOD_LATEX tag is set to YES Doxygen will generate 
-# the necessary Makefile rules, Perl scripts and LaTeX code to be able 
-# to generate PDF and DVI output from the Perl module output.
-
-PERLMOD_LATEX          = NO
-
-# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be 
-# nicely formatted so it can be parsed by a human reader.  This is useful 
-# if you want to understand what is going on.  On the other hand, if this 
-# tag is set to NO the size of the Perl module output will be much smaller 
-# and Perl will parse it just the same.
-
-PERLMOD_PRETTY         = YES
-
-# The names of the make variables in the generated doxyrules.make file 
-# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. 
-# This is useful so different doxyrules.make files included by the same 
-# Makefile don't overwrite each other's variables.
-
-PERLMOD_MAKEVAR_PREFIX = 
-
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor   
-#---------------------------------------------------------------------------
-
-# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 
-# evaluate all C-preprocessor directives found in the sources and include 
-# files.
-
-ENABLE_PREPROCESSING   = YES
-
-# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 
-# names in the source code. If set to NO (the default) only conditional 
-# compilation will be performed. Macro expansion can be done in a controlled 
-# way by setting EXPAND_ONLY_PREDEF to YES.
-
-MACRO_EXPANSION        = NO
-
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 
-# then the macro expansion is limited to the macros specified with the 
-# PREDEFINED and EXPAND_AS_DEFINED tags.
-
-EXPAND_ONLY_PREDEF     = NO
-
-# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 
-# in the INCLUDE_PATH (see below) will be search if a #include is found.
-
-SEARCH_INCLUDES        = YES
-
-# The INCLUDE_PATH tag can be used to specify one or more directories that 
-# contain include files that are not input files but should be processed by 
-# the preprocessor.
-
-INCLUDE_PATH           = 
-
-# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 
-# patterns (like *.h and *.hpp) to filter out the header-files in the 
-# directories. If left blank, the patterns specified with FILE_PATTERNS will 
-# be used.
-
-INCLUDE_FILE_PATTERNS  = 
-
-# The PREDEFINED tag can be used to specify one or more macro names that 
-# are defined before the preprocessor is started (similar to the -D option of 
-# gcc). The argument of the tag is a list of macros of the form: name 
-# or name=definition (no spaces). If the definition and the = are 
-# omitted =1 is assumed. To prevent a macro definition from being 
-# undefined via #undef or recursively expanded use the := operator 
-# instead of the = operator.
-
-PREDEFINED             = 
-
-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 
-# this tag can be used to specify a list of macro names that should be expanded. 
-# The macro definition that is found in the sources will be used. 
-# Use the PREDEFINED tag if you want to use a different macro definition.
-
-EXPAND_AS_DEFINED      = 
-
-# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 
-# doxygen's preprocessor will remove all function-like macros that are alone 
-# on a line, have an all uppercase name, and do not end with a semicolon. Such 
-# function macros are typically used for boiler-plate code, and will confuse 
-# the parser if not removed.
-
-SKIP_FUNCTION_MACROS   = YES
-
-#---------------------------------------------------------------------------
-# Configuration::additions related to external references   
-#---------------------------------------------------------------------------
-
-# The TAGFILES option can be used to specify one or more tagfiles. 
-# Optionally an initial location of the external documentation 
-# can be added for each tagfile. The format of a tag file without 
-# this location is as follows: 
-#   TAGFILES = file1 file2 ... 
-# Adding location for the tag files is done as follows: 
-#   TAGFILES = file1=loc1 "file2 = loc2" ... 
-# where "loc1" and "loc2" can be relative or absolute paths or 
-# URLs. If a location is present for each tag, the installdox tool 
-# does not have to be run to correct the links.
-# Note that each tag file must have a unique name
-# (where the name does NOT include the path)
-# If a tag file is not located in the directory in which doxygen 
-# is run, you must also specify the path to the tagfile here.
-
-TAGFILES               = 
-
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create 
-# a tag file that is based on the input files it reads.
-
-GENERATE_TAGFILE       = 
-
-# If the ALLEXTERNALS tag is set to YES all external classes will be listed 
-# in the class index. If set to NO only the inherited external classes 
-# will be listed.
-
-ALLEXTERNALS           = NO
-
-# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed 
-# in the modules index. If set to NO, only the current project's groups will 
-# be listed.
-
-EXTERNAL_GROUPS        = YES
-
-# The PERL_PATH should be the absolute path and name of the perl script 
-# interpreter (i.e. the result of `which perl').
-
-PERL_PATH              = /usr/bin/perl
-
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool   
-#---------------------------------------------------------------------------
-
-# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 
-# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base 
-# or super classes. Setting the tag to NO turns the diagrams off. Note that 
-# this option is superseded by the HAVE_DOT option below. This is only a 
-# fallback. It is recommended to install and use dot, since it yields more 
-# powerful graphs.
-
-CLASS_DIAGRAMS         = YES
-
-# You can define message sequence charts within doxygen comments using the \msc 
-# command. Doxygen will then run the mscgen tool (see http://www.mcternan.me.uk/mscgen/) to 
-# produce the chart and insert it in the documentation. The MSCGEN_PATH tag allows you to 
-# specify the directory where the mscgen tool resides. If left empty the tool is assumed to 
-# be found in the default search path.
-
-MSCGEN_PATH            = 
-
-# If set to YES, the inheritance and collaboration graphs will hide 
-# inheritance and usage relations if the target is undocumented 
-# or is not a class.
-
-HIDE_UNDOC_RELATIONS   = YES
-
-# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 
-# available from the path. This tool is part of Graphviz, a graph visualization 
-# toolkit from AT&T and Lucent Bell Labs. The other options in this section 
-# have no effect if this option is set to NO (the default)
-
-HAVE_DOT               = NO
-
-# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 
-# will generate a graph for each documented class showing the direct and 
-# indirect inheritance relations. Setting this tag to YES will force the 
-# the CLASS_DIAGRAMS tag to NO.
-
-CLASS_GRAPH            = YES
-
-# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 
-# will generate a graph for each documented class showing the direct and 
-# indirect implementation dependencies (inheritance, containment, and 
-# class references variables) of the class with other documented classes.
-
-COLLABORATION_GRAPH    = YES
-
-# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen 
-# will generate a graph for groups, showing the direct groups dependencies
-
-GROUP_GRAPHS           = YES
-
-# If the UML_LOOK tag is set to YES doxygen will generate inheritance and 
-# collaboration diagrams in a style similar to the OMG's Unified Modeling 
-# Language.
-
-UML_LOOK               = NO
-
-# If set to YES, the inheritance and collaboration graphs will show the 
-# relations between templates and their instances.
-
-TEMPLATE_RELATIONS     = NO
-
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 
-# tags are set to YES then doxygen will generate a graph for each documented 
-# file showing the direct and indirect include dependencies of the file with 
-# other documented files.
-
-INCLUDE_GRAPH          = YES
-
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and 
-# HAVE_DOT tags are set to YES then doxygen will generate a graph for each 
-# documented header file showing the documented files that directly or 
-# indirectly include this file.
-
-INCLUDED_BY_GRAPH      = YES
-
-# If the CALL_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will 
-# generate a call dependency graph for every global function or class method. 
-# Note that enabling this option will significantly increase the time of a run. 
-# So in most cases it will be better to enable call graphs for selected 
-# functions only using the \callgraph command.
-
-CALL_GRAPH             = NO
-
-# If the CALLER_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will 
-# generate a caller dependency graph for every global function or class method. 
-# Note that enabling this option will significantly increase the time of a run. 
-# So in most cases it will be better to enable caller graphs for selected 
-# functions only using the \callergraph command.
-
-CALLER_GRAPH           = NO
-
-# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 
-# will graphical hierarchy of all classes instead of a textual one.
-
-GRAPHICAL_HIERARCHY    = YES
-
-# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES 
-# then doxygen will show the dependencies a directory has on other directories 
-# in a graphical way. The dependency relations are determined by the #include
-# relations between the files in the directories.
-
-DIRECTORY_GRAPH        = YES
-
-# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 
-# generated by dot. Possible values are png, jpg, or gif
-# If left blank png will be used.
-
-DOT_IMAGE_FORMAT       = png
-
-# The tag DOT_PATH can be used to specify the path where the dot tool can be 
-# found. If left blank, it is assumed the dot tool can be found in the path.
-
-DOT_PATH               = 
-
-# The DOTFILE_DIRS tag can be used to specify one or more directories that 
-# contain dot files that are included in the documentation (see the 
-# \dotfile command).
-
-DOTFILE_DIRS           = 
-
-# The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of 
-# nodes that will be shown in the graph. If the number of nodes in a graph 
-# becomes larger than this value, doxygen will truncate the graph, which is 
-# visualized by representing a node as a red box. Note that doxygen if the number 
-# of direct children of the root node in a graph is already larger than 
-# MAX_DOT_GRAPH_NOTES then the graph will not be shown at all. Also note 
-# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
-
-DOT_GRAPH_MAX_NODES    = 50
-
-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the 
-# graphs generated by dot. A depth value of 3 means that only nodes reachable 
-# from the root by following a path via at most 3 edges will be shown. Nodes 
-# that lay further from the root node will be omitted. Note that setting this 
-# option to 1 or 2 may greatly reduce the computation time needed for large 
-# code bases. Also note that the size of a graph can be further restricted by 
-# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
-
-MAX_DOT_GRAPH_DEPTH    = 0
-
-# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent 
-# background. This is disabled by default, which results in a white background. 
-# Warning: Depending on the platform used, enabling this option may lead to 
-# badly anti-aliased labels on the edges of a graph (i.e. they become hard to 
-# read).
-
-DOT_TRANSPARENT        = NO
-
-# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output 
-# files in one run (i.e. multiple -o and -T options on the command line). This 
-# makes dot run faster, but since only newer versions of dot (>1.8.10) 
-# support this, this feature is disabled by default.
-
-DOT_MULTI_TARGETS      = NO
-
-# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 
-# generate a legend page explaining the meaning of the various boxes and 
-# arrows in the dot generated graphs.
-
-GENERATE_LEGEND        = YES
-
-# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will 
-# remove the intermediate dot files that are used to generate 
-# the various graphs.
-
-DOT_CLEANUP            = YES
-
-#---------------------------------------------------------------------------
-# Configuration::additions related to the search engine   
-#---------------------------------------------------------------------------
-
-# The SEARCHENGINE tag specifies whether or not a search engine should be 
-# used. If set to NO the values of all tags below this one will be ignored.
-
-SEARCHENGINE           = NO
diff --git a/src/wishList.h b/src/wishList.h
index eb33538..3138a48 100644
--- a/src/wishList.h
+++ b/src/wishList.h
@@ -45,8 +45,7 @@ struct WishList {
     changeAudioDatarate(false), audioSamplerate(0),
     changeAudioSamplerate(false), audioChannels(2),
     changeAudioChannels(false), stretch(false), withBlend(false),
-    ignoreVorbis(false), preview(1), pictureCounter(0), quality(2)
-  {
+    ignoreVorbis(false), preview(1), pictureCounter(0), quality(2) {
   }
 
 };
diff --git a/testsuite/testoggThumb.sh b/testsuite/testoggThumb.sh
index 878e986..9b4257e 100755
--- a/testsuite/testoggThumb.sh
+++ b/testsuite/testoggThumb.sh
@@ -1,4 +1,4 @@
 #!/bin/sh
-../build/src/oggThumb -t 0.4,0.7,1 -s200x0 -n ducks_%.png ../testvideos/ducks_take_off_444_720p25.ogg
-../build/src/oggThumb -t 0.4,0.7,1 -s0x200 -n aspect_%.png ../testvideos/pixel_aspect_ratio.ogg
-../build/src/oggThumb -t 0.4,0.7,1,200 -n stockholm_%.png ../testvideos/stockholm-vfr.ogg
+../build/src/binaries/oggThumb -t 0.4,0.7,1 -s200x0 -n ducks_%.png ../testvideos/ducks_take_off_444_720p25.ogg
+../build/src/binaries/oggThumb -t 0.4,0.7,1 -s0x200 -n aspect_%.png ../testvideos/pixel_aspect_ratio.ogg
+../build/src/binaries/oggThumb -t 0.4,0.7,1,200 -n stockholm_%.png ../testvideos/stockholm-vfr.ogg
diff --git a/win32/GD-COPYING.TXT b/win32/GD-COPYING.TXT
deleted file mode 100644
index 5e17d03..0000000
--- a/win32/GD-COPYING.TXT
+++ /dev/null
@@ -1,53 +0,0 @@
- 
-     Portions copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
-     2002 by Cold Spring Harbor Laboratory. Funded under Grant
-     P41-RR02188 by the National Institutes of Health. 
-
-     Portions copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 by
-     Boutell.Com, Inc. 
-
-     Portions relating to GD2 format copyright 1999, 2000, 2001, 2002
-     Philip Warner.
-     
-     Portions relating to PNG copyright 1999, 2000, 2001, 2002 Greg
-     Roelofs. 
-
-     Portions relating to gdttf.c copyright 1999, 2000, 2001, 2002 John  
-     Ellson (ellson at lucent.com).
-   
-     Portions relating to gdft.c copyright 2001, 2002 John Ellson  
-     (ellson at lucent.com).  
-
-     Portions copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
-		 Pierre-Alain Joye (pierre at libgd.org).  
-
-     Portions relating to JPEG and to color quantization copyright 2000,
-     2001, 2002, Doug Becker and copyright (C) 1994, 1995, 1996, 1997,
-     1998, 1999, 2000, 2001, 2002, Thomas G. Lane. This software is
-     based in part on the work of the Independent JPEG Group. See the
-     file README-JPEG.TXT for more information.
-
-     Portions relating to WBMP copyright 2000, 2001, 2002 Maurice
-     Szmurlo and Johan Van den Brande.
-
-     Permission has been granted to copy, distribute and modify gd in
-     any context without fee, including a commercial application,
-     provided that this notice is present in user-accessible supporting
-     documentation.
-
-     This does not affect your ownership of the derived work itself, and 
-     the intent is to assure proper credit for the authors of gd, not to
-     interfere with your productive use of gd. If you have questions,
-     ask. "Derived works" includes all programs that utilize the   
-     library. Credit must be given in user-accessible documentation.
-
-     This software is provided "AS IS." The copyright holders disclaim  
-     all warranties, either express or implied, including but not
-     limited to implied warranties of merchantability and fitness for a
-     particular purpose, with respect to this code and accompanying  
-     documentation.
-
-     Although their code does not appear in gd, the authors wish to thank
-     David Koblas, David Rowley, and Hutchison Avenue Software Corporation
-     for their prior contributions.
-
diff --git a/win32/getopt.c b/win32/getopt.c
deleted file mode 100644
index dad25b6..0000000
--- a/win32/getopt.c
+++ /dev/null
@@ -1,1047 +0,0 @@
-/* Getopt for GNU.
-   NOTE: getopt is now part of the C library, so if you don't know what
-   "Keep this file name-space clean" means, talk to drepper at gnu.org
-   before changing it!
-
-   Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99
-   	Free Software Foundation, Inc.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
-
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
-
-/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
-   Ditto for AIX 3.2 and <stdlib.h>.  */
-#ifndef _NO_PROTO
-# define _NO_PROTO
-#endif
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#if !defined __STDC__ || !__STDC__
-/* This is a separate conditional since some stdc systems
-   reject `defined (const)'.  */
-# ifndef const
-#  define const
-# endif
-#endif
-
-#include <stdio.h>
-
-/* Comment out all this code if we are using the GNU C Library, and are not
-   actually compiling the library itself.  This code is part of the GNU C
-   Library, but also included in many other GNU distributions.  Compiling
-   and linking in this code is a waste when using the GNU C library
-   (especially if it is a shared library).  Rather than having every GNU
-   program understand `configure --with-gnu-libc' and omit the object files,
-   it is simpler to just do this in the source for each such file.  */
-
-#define GETOPT_INTERFACE_VERSION 2
-#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2
-# include <gnu-versions.h>
-# if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
-#  define ELIDE_CODE
-# endif
-#endif
-
-#ifndef ELIDE_CODE
-
-
-/* This needs to come after some library #include
-   to get __GNU_LIBRARY__ defined.  */
-#ifdef	__GNU_LIBRARY__
-/* Don't include stdlib.h for non-GNU C libraries because some of them
-   contain conflicting prototypes for getopt.  */
-# include <stdlib.h>
-# include <unistd.h>
-#endif	/* GNU C library.  */
-
-#ifdef VMS
-# include <unixlib.h>
-# if HAVE_STRING_H - 0
-#  include <string.h>
-# endif
-#endif
-
-#ifndef _
-/* This is for other GNU distributions with internationalized messages.
-   When compiling libc, the _ macro is predefined.  */
-# ifdef HAVE_LIBINTL_H
-#  include <libintl.h>
-#  define _(msgid)	gettext (msgid)
-# else
-#  define _(msgid)	(msgid)
-# endif
-#endif
-
-/* This version of `getopt' appears to the caller like standard Unix `getopt'
-   but it behaves differently for the user, since it allows the user
-   to intersperse the options with the other arguments.
-
-   As `getopt' works, it permutes the elements of ARGV so that,
-   when it is done, all the options precede everything else.  Thus
-   all application programs are extended to handle flexible argument order.
-
-   Setting the environment variable POSIXLY_CORRECT disables permutation.
-   Then the behavior is completely standard.
-
-   GNU application programs can use a third alternative mode in which
-   they can distinguish the relative order of options and other arguments.  */
-
-#include "getopt_win.h"
-
-/* For communication from `getopt' to the caller.
-   When `getopt' finds an option that takes an argument,
-   the argument value is returned here.
-   Also, when `ordering' is RETURN_IN_ORDER,
-   each non-option ARGV-element is returned here.  */
-
-char *optarg;
-
-/* Index in ARGV of the next element to be scanned.
-   This is used for communication to and from the caller
-   and for communication between successive calls to `getopt'.
-
-   On entry to `getopt', zero means this is the first call; initialize.
-
-   When `getopt' returns -1, this is the index of the first of the
-   non-option elements that the caller should itself scan.
-
-   Otherwise, `optind' communicates from one call to the next
-   how much of ARGV has been scanned so far.  */
-
-/* 1003.2 says this must be 1 before any call.  */
-int optind = 1;
-
-/* Formerly, initialization of getopt depended on optind==0, which
-   causes problems with re-calling getopt as programs generally don't
-   know that. */
-
-int __getopt_initialized;
-
-/* The next char to be scanned in the option-element
-   in which the last option character we returned was found.
-   This allows us to pick up the scan where we left off.
-
-   If this is zero, or a null string, it means resume the scan
-   by advancing to the next ARGV-element.  */
-
-static char *nextchar;
-
-/* Callers store zero here to inhibit the error message
-   for unrecognized options.  */
-
-int opterr = 1;
-
-/* Set to an option character which was unrecognized.
-   This must be initialized on some systems to avoid linking in the
-   system's own getopt implementation.  */
-
-int optopt = '?';
-
-/* Describe how to deal with options that follow non-option ARGV-elements.
-
-   If the caller did not specify anything,
-   the default is REQUIRE_ORDER if the environment variable
-   POSIXLY_CORRECT is defined, PERMUTE otherwise.
-
-   REQUIRE_ORDER means don't recognize them as options;
-   stop option processing when the first non-option is seen.
-   This is what Unix does.
-   This mode of operation is selected by either setting the environment
-   variable POSIXLY_CORRECT, or using `+' as the first character
-   of the list of option characters.
-
-   PERMUTE is the default.  We permute the contents of ARGV as we scan,
-   so that eventually all the non-options are at the end.  This allows options
-   to be given in any order, even with programs that were not written to
-   expect this.
-
-   RETURN_IN_ORDER is an option available to programs that were written
-   to expect options and other ARGV-elements in any order and that care about
-   the ordering of the two.  We describe each non-option ARGV-element
-   as if it were the argument of an option with character code 1.
-   Using `-' as the first character of the list of option characters
-   selects this mode of operation.
-
-   The special argument `--' forces an end of option-scanning regardless
-   of the value of `ordering'.  In the case of RETURN_IN_ORDER, only
-   `--' can cause `getopt' to return -1 with `optind' != ARGC.  */
-
-static enum
-{
-  REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
-} ordering;
-
-/* Value of POSIXLY_CORRECT environment variable.  */
-static char *posixly_correct;
-

-#ifdef	__GNU_LIBRARY__
-/* We want to avoid inclusion of string.h with non-GNU libraries
-   because there are many ways it can cause trouble.
-   On some systems, it contains special magic macros that don't work
-   in GCC.  */
-# include <string.h>
-# define my_index	strchr
-#else
-
-#include <string.h>
-
-/* Avoid depending on library functions or files
-   whose names are inconsistent.  */
-
-#ifndef getenv
-extern char *getenv ();
-#endif
-
-static char *
-my_index (str, chr)
-     const char *str;
-     int chr;
-{
-  while (*str)
-    {
-      if (*str == chr)
-	return (char *) str;
-      str++;
-    }
-  return 0;
-}
-
-/* If using GCC, we can safely declare strlen this way.
-   If not using GCC, it is ok not to declare it.  */
-#ifdef __GNUC__
-/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h.
-   That was relevant to code that was here before.  */
-# if (!defined __STDC__ || !__STDC__) && !defined strlen
-/* gcc with -traditional declares the built-in strlen to return int,
-   and has done so at least since version 2.4.5. -- rms.  */
-extern int strlen (const char *);
-# endif /* not __STDC__ */
-#endif /* __GNUC__ */
-
-#endif /* not __GNU_LIBRARY__ */
-

-/* Handle permutation of arguments.  */
-
-/* Describe the part of ARGV that contains non-options that have
-   been skipped.  `first_nonopt' is the index in ARGV of the first of them;
-   `last_nonopt' is the index after the last of them.  */
-
-static int first_nonopt;
-static int last_nonopt;
-
-#ifdef _LIBC
-/* Bash 2.0 gives us an environment variable containing flags
-   indicating ARGV elements that should not be considered arguments.  */
-
-/* Defined in getopt_init.c  */
-extern char *__getopt_nonoption_flags;
-
-static int nonoption_flags_max_len;
-static int nonoption_flags_len;
-
-static int original_argc;
-static char *const *original_argv;
-
-/* Make sure the environment variable bash 2.0 puts in the environment
-   is valid for the getopt call we must make sure that the ARGV passed
-   to getopt is that one passed to the process.  */
-static void
-__attribute__ ((unused))
-store_args_and_env (int argc, char *const *argv)
-{
-  /* XXX This is no good solution.  We should rather copy the args so
-     that we can compare them later.  But we must not use malloc(3).  */
-  original_argc = argc;
-  original_argv = argv;
-}
-# ifdef text_set_element
-text_set_element (__libc_subinit, store_args_and_env);
-# endif /* text_set_element */
-
-# define SWAP_FLAGS(ch1, ch2) \
-  if (nonoption_flags_len > 0)						      \
-    {									      \
-      char __tmp = __getopt_nonoption_flags[ch1];			      \
-      __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2];	      \
-      __getopt_nonoption_flags[ch2] = __tmp;				      \
-    }
-#else	/* !_LIBC */
-# define SWAP_FLAGS(ch1, ch2)
-#endif	/* _LIBC */
-
-/* Exchange two adjacent subsequences of ARGV.
-   One subsequence is elements [first_nonopt,last_nonopt)
-   which contains all the non-options that have been skipped so far.
-   The other is elements [last_nonopt,optind), which contains all
-   the options processed since those non-options were skipped.
-
-   `first_nonopt' and `last_nonopt' are relocated so that they describe
-   the new indices of the non-options in ARGV after they are moved.  */
-
-#if defined __STDC__ && __STDC__
-static void exchange (char **);
-#endif
-
-static void
-exchange (argv)
-     char **argv;
-{
-  int bottom = first_nonopt;
-  int middle = last_nonopt;
-  int top = optind;
-  char *tem;
-
-  /* Exchange the shorter segment with the far end of the longer segment.
-     That puts the shorter segment into the right place.
-     It leaves the longer segment in the right place overall,
-     but it consists of two parts that need to be swapped next.  */
-
-#ifdef _LIBC
-  /* First make sure the handling of the `__getopt_nonoption_flags'
-     string can work normally.  Our top argument must be in the range
-     of the string.  */
-  if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len)
-    {
-      /* We must extend the array.  The user plays games with us and
-	 presents new arguments.  */
-      char *new_str = malloc (top + 1);
-      if (new_str == NULL)
-	nonoption_flags_len = nonoption_flags_max_len = 0;
-      else
-	{
-	  memset (__mempcpy (new_str, __getopt_nonoption_flags,
-			     nonoption_flags_max_len),
-		  '\0', top + 1 - nonoption_flags_max_len);
-	  nonoption_flags_max_len = top + 1;
-	  __getopt_nonoption_flags = new_str;
-	}
-    }
-#endif
-
-  while (top > middle && middle > bottom)
-    {
-      if (top - middle > middle - bottom)
-	{
-	  /* Bottom segment is the short one.  */
-	  int len = middle - bottom;
-	  register int i;
-
-	  /* Swap it with the top part of the top segment.  */
-	  for (i = 0; i < len; i++)
-	    {
-	      tem = argv[bottom + i];
-	      argv[bottom + i] = argv[top - (middle - bottom) + i];
-	      argv[top - (middle - bottom) + i] = tem;
-	      SWAP_FLAGS (bottom + i, top - (middle - bottom) + i);
-	    }
-	  /* Exclude the moved bottom segment from further swapping.  */
-	  top -= len;
-	}
-      else
-	{
-	  /* Top segment is the short one.  */
-	  int len = top - middle;
-	  register int i;
-
-	  /* Swap it with the bottom part of the bottom segment.  */
-	  for (i = 0; i < len; i++)
-	    {
-	      tem = argv[bottom + i];
-	      argv[bottom + i] = argv[middle + i];
-	      argv[middle + i] = tem;
-	      SWAP_FLAGS (bottom + i, middle + i);
-	    }
-	  /* Exclude the moved top segment from further swapping.  */
-	  bottom += len;
-	}
-    }
-
-  /* Update records for the slots the non-options now occupy.  */
-
-  first_nonopt += (optind - last_nonopt);
-  last_nonopt = optind;
-}
-
-/* Initialize the internal data when the first call is made.  */
-
-#if defined __STDC__ && __STDC__
-static const char *_getopt_initialize (int, char *const *, const char *);
-#endif
-static const char *
-_getopt_initialize (argc, argv, optstring)
-     int argc;
-     char *const *argv;
-     const char *optstring;
-{
-  /* Start processing options with ARGV-element 1 (since ARGV-element 0
-     is the program name); the sequence of previously skipped
-     non-option ARGV-elements is empty.  */
-
-  first_nonopt = last_nonopt = optind;
-
-  nextchar = NULL;
-
-  posixly_correct = getenv ("POSIXLY_CORRECT");
-
-  /* Determine how to handle the ordering of options and nonoptions.  */
-
-  if (optstring[0] == '-')
-    {
-      ordering = RETURN_IN_ORDER;
-      ++optstring;
-    }
-  else if (optstring[0] == '+')
-    {
-      ordering = REQUIRE_ORDER;
-      ++optstring;
-    }
-  else if (posixly_correct != NULL)
-    ordering = REQUIRE_ORDER;
-  else
-    ordering = PERMUTE;
-
-#ifdef _LIBC
-  if (posixly_correct == NULL
-      && argc == original_argc && argv == original_argv)
-    {
-      if (nonoption_flags_max_len == 0)
-	{
-	  if (__getopt_nonoption_flags == NULL
-	      || __getopt_nonoption_flags[0] == '\0')
-	    nonoption_flags_max_len = -1;
-	  else
-	    {
-	      const char *orig_str = __getopt_nonoption_flags;
-	      int len = nonoption_flags_max_len = strlen (orig_str);
-	      if (nonoption_flags_max_len < argc)
-		nonoption_flags_max_len = argc;
-	      __getopt_nonoption_flags =
-		(char *) malloc (nonoption_flags_max_len);
-	      if (__getopt_nonoption_flags == NULL)
-		nonoption_flags_max_len = -1;
-	      else
-		memset (__mempcpy (__getopt_nonoption_flags, orig_str, len),
-			'\0', nonoption_flags_max_len - len);
-	    }
-	}
-      nonoption_flags_len = nonoption_flags_max_len;
-    }
-  else
-    nonoption_flags_len = 0;
-#endif
-
-  return optstring;
-}
-

-/* Scan elements of ARGV (whose length is ARGC) for option characters
-   given in OPTSTRING.
-
-   If an element of ARGV starts with '-', and is not exactly "-" or "--",
-   then it is an option element.  The characters of this element
-   (aside from the initial '-') are option characters.  If `getopt'
-   is called repeatedly, it returns successively each of the option characters
-   from each of the option elements.
-
-   If `getopt' finds another option character, it returns that character,
-   updating `optind' and `nextchar' so that the next call to `getopt' can
-   resume the scan with the following option character or ARGV-element.
-
-   If there are no more option characters, `getopt' returns -1.
-   Then `optind' is the index in ARGV of the first ARGV-element
-   that is not an option.  (The ARGV-elements have been permuted
-   so that those that are not options now come last.)
-
-   OPTSTRING is a string containing the legitimate option characters.
-   If an option character is seen that is not listed in OPTSTRING,
-   return '?' after printing an error message.  If you set `opterr' to
-   zero, the error message is suppressed but we still return '?'.
-
-   If a char in OPTSTRING is followed by a colon, that means it wants an arg,
-   so the following text in the same ARGV-element, or the text of the following
-   ARGV-element, is returned in `optarg'.  Two colons mean an option that
-   wants an optional arg; if there is text in the current ARGV-element,
-   it is returned in `optarg', otherwise `optarg' is set to zero.
-
-   If OPTSTRING starts with `-' or `+', it requests different methods of
-   handling the non-option ARGV-elements.
-   See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above.
-
-   Long-named options begin with `--' instead of `-'.
-   Their names may be abbreviated as long as the abbreviation is unique
-   or is an exact match for some defined option.  If they have an
-   argument, it follows the option name in the same ARGV-element, separated
-   from the option name by a `=', or else the in next ARGV-element.
-   When `getopt' finds a long-named option, it returns 0 if that option's
-   `flag' field is nonzero, the value of the option's `val' field
-   if the `flag' field is zero.
-
-   The elements of ARGV aren't really const, because we permute them.
-   But we pretend they're const in the prototype to be compatible
-   with other systems.
-
-   LONGOPTS is a vector of `struct option' terminated by an
-   element containing a name which is zero.
-
-   LONGIND returns the index in LONGOPT of the long-named option found.
-   It is only valid when a long-named option has been found by the most
-   recent call.
-
-   If LONG_ONLY is nonzero, '-' as well as '--' can introduce
-   long-named options.  */
-
-int
-_getopt_internal (argc, argv, optstring, longopts, longind, long_only)
-     int argc;
-     char *const *argv;
-     const char *optstring;
-     const struct option *longopts;
-     int *longind;
-     int long_only;
-{
-  optarg = NULL;
-
-  if (optind == 0 || !__getopt_initialized)
-    {
-      if (optind == 0)
-	optind = 1;	/* Don't scan ARGV[0], the program name.  */
-      optstring = _getopt_initialize (argc, argv, optstring);
-      __getopt_initialized = 1;
-    }
-
-  /* Test whether ARGV[optind] points to a non-option argument.
-     Either it does not have option syntax, or there is an environment flag
-     from the shell indicating it is not an option.  The later information
-     is only used when the used in the GNU libc.  */
-#ifdef _LIBC
-# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0'	      \
-		      || (optind < nonoption_flags_len			      \
-			  && __getopt_nonoption_flags[optind] == '1'))
-#else
-# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0')
-#endif
-
-  if (nextchar == NULL || *nextchar == '\0')
-    {
-      /* Advance to the next ARGV-element.  */
-
-      /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been
-	 moved back by the user (who may also have changed the arguments).  */
-      if (last_nonopt > optind)
-	last_nonopt = optind;
-      if (first_nonopt > optind)
-	first_nonopt = optind;
-
-      if (ordering == PERMUTE)
-	{
-	  /* If we have just processed some options following some non-options,
-	     exchange them so that the options come first.  */
-
-	  if (first_nonopt != last_nonopt && last_nonopt != optind)
-	    exchange ((char **) argv);
-	  else if (last_nonopt != optind)
-	    first_nonopt = optind;
-
-	  /* Skip any additional non-options
-	     and extend the range of non-options previously skipped.  */
-
-	  while (optind < argc && NONOPTION_P)
-	    optind++;
-	  last_nonopt = optind;
-	}
-
-      /* The special ARGV-element `--' means premature end of options.
-	 Skip it like a null option,
-	 then exchange with previous non-options as if it were an option,
-	 then skip everything else like a non-option.  */
-
-      if (optind != argc && !strcmp (argv[optind], "--"))
-	{
-	  optind++;
-
-	  if (first_nonopt != last_nonopt && last_nonopt != optind)
-	    exchange ((char **) argv);
-	  else if (first_nonopt == last_nonopt)
-	    first_nonopt = optind;
-	  last_nonopt = argc;
-
-	  optind = argc;
-	}
-
-      /* If we have done all the ARGV-elements, stop the scan
-	 and back over any non-options that we skipped and permuted.  */
-
-      if (optind == argc)
-	{
-	  /* Set the next-arg-index to point at the non-options
-	     that we previously skipped, so the caller will digest them.  */
-	  if (first_nonopt != last_nonopt)
-	    optind = first_nonopt;
-	  return -1;
-	}
-
-      /* If we have come to a non-option and did not permute it,
-	 either stop the scan or describe it to the caller and pass it by.  */
-
-      if (NONOPTION_P)
-	{
-	  if (ordering == REQUIRE_ORDER)
-	    return -1;
-	  optarg = argv[optind++];
-	  return 1;
-	}
-
-      /* We have found another option-ARGV-element.
-	 Skip the initial punctuation.  */
-
-      nextchar = (argv[optind] + 1
-		  + (longopts != NULL && argv[optind][1] == '-'));
-    }
-
-  /* Decode the current option-ARGV-element.  */
-
-  /* Check whether the ARGV-element is a long option.
-
-     If long_only and the ARGV-element has the form "-f", where f is
-     a valid short option, don't consider it an abbreviated form of
-     a long option that starts with f.  Otherwise there would be no
-     way to give the -f short option.
-
-     On the other hand, if there's a long option "fubar" and
-     the ARGV-element is "-fu", do consider that an abbreviation of
-     the long option, just like "--fu", and not "-f" with arg "u".
-
-     This distinction seems to be the most useful approach.  */
-
-  if (longopts != NULL
-      && (argv[optind][1] == '-'
-	  || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1])))))
-    {
-      char *nameend;
-      const struct option *p;
-      const struct option *pfound = NULL;
-      int exact = 0;
-      int ambig = 0;
-      int indfound = -1;
-      int option_index;
-
-      for (nameend = nextchar; *nameend && *nameend != '='; nameend++)
-	/* Do nothing.  */ ;
-
-      /* Test all long options for either exact match
-	 or abbreviated matches.  */
-      for (p = longopts, option_index = 0; p->name; p++, option_index++)
-	if (!strncmp (p->name, nextchar, nameend - nextchar))
-	  {
-	    if ((unsigned int) (nameend - nextchar)
-		== (unsigned int) strlen (p->name))
-	      {
-		/* Exact match found.  */
-		pfound = p;
-		indfound = option_index;
-		exact = 1;
-		break;
-	      }
-	    else if (pfound == NULL)
-	      {
-		/* First nonexact match found.  */
-		pfound = p;
-		indfound = option_index;
-	      }
-	    else
-	      /* Second or later nonexact match found.  */
-	      ambig = 1;
-	  }
-
-      if (ambig && !exact)
-	{
-	  if (opterr)
-	    fprintf (stderr, _("%s: option `%s' is ambiguous\n"),
-		     argv[0], argv[optind]);
-	  nextchar += strlen (nextchar);
-	  optind++;
-	  optopt = 0;
-	  return '?';
-	}
-
-      if (pfound != NULL)
-	{
-	  option_index = indfound;
-	  optind++;
-	  if (*nameend)
-	    {
-	      /* Don't test has_arg with >, because some C compilers don't
-		 allow it to be used on enums.  */
-	      if (pfound->has_arg)
-		optarg = nameend + 1;
-	      else
-		{
-		  if (opterr)
-		    {
-		      if (argv[optind - 1][1] == '-')
-			/* --option */
-			fprintf (stderr,
-				 _("%s: option `--%s' doesn't allow an argument\n"),
-				 argv[0], pfound->name);
-		      else
-			/* +option or -option */
-			fprintf (stderr,
-				 _("%s: option `%c%s' doesn't allow an argument\n"),
-				 argv[0], argv[optind - 1][0], pfound->name);
-		    }
-
-		  nextchar += strlen (nextchar);
-
-		  optopt = pfound->val;
-		  return '?';
-		}
-	    }
-	  else if (pfound->has_arg == 1)
-	    {
-	      if (optind < argc)
-		optarg = argv[optind++];
-	      else
-		{
-		  if (opterr)
-		    fprintf (stderr,
-			   _("%s: option `%s' requires an argument\n"),
-			   argv[0], argv[optind - 1]);
-		  nextchar += strlen (nextchar);
-		  optopt = pfound->val;
-		  return optstring[0] == ':' ? ':' : '?';
-		}
-	    }
-	  nextchar += strlen (nextchar);
-	  if (longind != NULL)
-	    *longind = option_index;
-	  if (pfound->flag)
-	    {
-	      *(pfound->flag) = pfound->val;
-	      return 0;
-	    }
-	  return pfound->val;
-	}
-
-      /* Can't find it as a long option.  If this is not getopt_long_only,
-	 or the option starts with '--' or is not a valid short
-	 option, then it's an error.
-	 Otherwise interpret it as a short option.  */
-      if (!long_only || argv[optind][1] == '-'
-	  || my_index (optstring, *nextchar) == NULL)
-	{
-	  if (opterr)
-	    {
-	      if (argv[optind][1] == '-')
-		/* --option */
-		fprintf (stderr, _("%s: unrecognized option `--%s'\n"),
-			 argv[0], nextchar);
-	      else
-		/* +option or -option */
-		fprintf (stderr, _("%s: unrecognized option `%c%s'\n"),
-			 argv[0], argv[optind][0], nextchar);
-	    }
-	  nextchar = (char *) "";
-	  optind++;
-	  optopt = 0;
-	  return '?';
-	}
-    }
-
-  /* Look at and handle the next short option-character.  */
-
-  {
-    char c = *nextchar++;
-    char *temp = my_index (optstring, c);
-
-    /* Increment `optind' when we start to process its last character.  */
-    if (*nextchar == '\0')
-      ++optind;
-
-    if (temp == NULL || c == ':')
-      {
-	if (opterr)
-	  {
-	    if (posixly_correct)
-	      /* 1003.2 specifies the format of this message.  */
-	      fprintf (stderr, _("%s: illegal option -- %c\n"),
-		       argv[0], c);
-	    else
-	      fprintf (stderr, _("%s: invalid option -- %c\n"),
-		       argv[0], c);
-	  }
-	optopt = c;
-	return '?';
-      }
-    /* Convenience. Treat POSIX -W foo same as long option --foo */
-    if (temp[0] == 'W' && temp[1] == ';')
-      {
-	char *nameend;
-	const struct option *p;
-	const struct option *pfound = NULL;
-	int exact = 0;
-	int ambig = 0;
-	int indfound = 0;
-	int option_index;
-
-	/* This is an option that requires an argument.  */
-	if (*nextchar != '\0')
-	  {
-	    optarg = nextchar;
-	    /* If we end this ARGV-element by taking the rest as an arg,
-	       we must advance to the next element now.  */
-	    optind++;
-	  }
-	else if (optind == argc)
-	  {
-	    if (opterr)
-	      {
-		/* 1003.2 specifies the format of this message.  */
-		fprintf (stderr, _("%s: option requires an argument -- %c\n"),
-			 argv[0], c);
-	      }
-	    optopt = c;
-	    if (optstring[0] == ':')
-	      c = ':';
-	    else
-	      c = '?';
-	    return c;
-	  }
-	else
-	  /* We already incremented `optind' once;
-	     increment it again when taking next ARGV-elt as argument.  */
-	  optarg = argv[optind++];
-
-	/* optarg is now the argument, see if it's in the
-	   table of longopts.  */
-
-	for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++)
-	  /* Do nothing.  */ ;
-
-	/* Test all long options for either exact match
-	   or abbreviated matches.  */
-	for (p = longopts, option_index = 0; p->name; p++, option_index++)
-	  if (!strncmp (p->name, nextchar, nameend - nextchar))
-	    {
-	      if ((unsigned int) (nameend - nextchar) == strlen (p->name))
-		{
-		  /* Exact match found.  */
-		  pfound = p;
-		  indfound = option_index;
-		  exact = 1;
-		  break;
-		}
-	      else if (pfound == NULL)
-		{
-		  /* First nonexact match found.  */
-		  pfound = p;
-		  indfound = option_index;
-		}
-	      else
-		/* Second or later nonexact match found.  */
-		ambig = 1;
-	    }
-	if (ambig && !exact)
-	  {
-	    if (opterr)
-	      fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"),
-		       argv[0], argv[optind]);
-	    nextchar += strlen (nextchar);
-	    optind++;
-	    return '?';
-	  }
-	if (pfound != NULL)
-	  {
-	    option_index = indfound;
-	    if (*nameend)
-	      {
-		/* Don't test has_arg with >, because some C compilers don't
-		   allow it to be used on enums.  */
-		if (pfound->has_arg)
-		  optarg = nameend + 1;
-		else
-		  {
-		    if (opterr)
-		      fprintf (stderr, _("\
-%s: option `-W %s' doesn't allow an argument\n"),
-			       argv[0], pfound->name);
-
-		    nextchar += strlen (nextchar);
-		    return '?';
-		  }
-	      }
-	    else if (pfound->has_arg == 1)
-	      {
-		if (optind < argc)
-		  optarg = argv[optind++];
-		else
-		  {
-		    if (opterr)
-		      fprintf (stderr,
-			       _("%s: option `%s' requires an argument\n"),
-			       argv[0], argv[optind - 1]);
-		    nextchar += strlen (nextchar);
-		    return optstring[0] == ':' ? ':' : '?';
-		  }
-	      }
-	    nextchar += strlen (nextchar);
-	    if (longind != NULL)
-	      *longind = option_index;
-	    if (pfound->flag)
-	      {
-		*(pfound->flag) = pfound->val;
-		return 0;
-	      }
-	    return pfound->val;
-	  }
-	  nextchar = NULL;
-	  return 'W';	/* Let the application handle it.   */
-      }
-    if (temp[1] == ':')
-      {
-	if (temp[2] == ':')
-	  {
-	    /* This is an option that accepts an argument optionally.  */
-	    if (*nextchar != '\0')
-	      {
-		optarg = nextchar;
-		optind++;
-	      }
-	    else
-	      optarg = NULL;
-	    nextchar = NULL;
-	  }
-	else
-	  {
-	    /* This is an option that requires an argument.  */
-	    if (*nextchar != '\0')
-	      {
-		optarg = nextchar;
-		/* If we end this ARGV-element by taking the rest as an arg,
-		   we must advance to the next element now.  */
-		optind++;
-	      }
-	    else if (optind == argc)
-	      {
-		if (opterr)
-		  {
-		    /* 1003.2 specifies the format of this message.  */
-		    fprintf (stderr,
-			   _("%s: option requires an argument -- %c\n"),
-			   argv[0], c);
-		  }
-		optopt = c;
-		if (optstring[0] == ':')
-		  c = ':';
-		else
-		  c = '?';
-	      }
-	    else
-	      /* We already incremented `optind' once;
-		 increment it again when taking next ARGV-elt as argument.  */
-	      optarg = argv[optind++];
-	    nextchar = NULL;
-	  }
-      }
-    return c;
-  }
-}
-
-int
-getopt (argc, argv, optstring)
-     int argc;
-     char *const *argv;
-     const char *optstring;
-{
-  return _getopt_internal (argc, argv, optstring,
-			   (const struct option *) 0,
-			   (int *) 0,
-			   0);
-}
-
-#endif	/* Not ELIDE_CODE.  */
-

-#ifdef TEST
-
-/* Compile with -DTEST to make an executable for use in testing
-   the above definition of `getopt'.  */
-
-int
-main (argc, argv)
-     int argc;
-     char **argv;
-{
-  int c;
-  int digit_optind = 0;
-
-  while (1)
-    {
-      int this_option_optind = optind ? optind : 1;
-
-      c = getopt (argc, argv, "abc:d:0123456789");
-      if (c == -1)
-	break;
-
-      switch (c)
-	{
-	case '0':
-	case '1':
-	case '2':
-	case '3':
-	case '4':
-	case '5':
-	case '6':
-	case '7':
-	case '8':
-	case '9':
-	  if (digit_optind != 0 && digit_optind != this_option_optind)
-	    printf ("digits occur in two different argv-elements.\n");
-	  digit_optind = this_option_optind;
-	  printf ("option %c\n", c);
-	  break;
-
-	case 'a':
-	  printf ("option a\n");
-	  break;
-
-	case 'b':
-	  printf ("option b\n");
-	  break;
-
-	case 'c':
-	  printf ("option c with value `%s'\n", optarg);
-	  break;
-
-	case '?':
-	  break;
-
-	default:
-	  printf ("?? getopt returned character code 0%o ??\n", c);
-	}
-    }
-
-  if (optind < argc)
-    {
-      printf ("non-option ARGV-elements: ");
-      while (optind < argc)
-	printf ("%s ", argv[optind++]);
-      printf ("\n");
-    }
-
-  exit (0);
-}
-
-#endif /* TEST */
diff --git a/win32/getopt1.c b/win32/getopt1.c
deleted file mode 100644
index dee6325..0000000
--- a/win32/getopt1.c
+++ /dev/null
@@ -1,188 +0,0 @@
-/* getopt_long and getopt_long_only entry points for GNU getopt.
-   Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98
-     Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
-
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "getopt_win.h"
-
-#if !defined __STDC__ || !__STDC__
-/* This is a separate conditional since some stdc systems
-   reject `defined (const)'.  */
-#ifndef const
-#define const
-#endif
-#endif
-
-#include <stdio.h>
-
-/* Comment out all this code if we are using the GNU C Library, and are not
-   actually compiling the library itself.  This code is part of the GNU C
-   Library, but also included in many other GNU distributions.  Compiling
-   and linking in this code is a waste when using the GNU C library
-   (especially if it is a shared library).  Rather than having every GNU
-   program understand `configure --with-gnu-libc' and omit the object files,
-   it is simpler to just do this in the source for each such file.  */
-
-#define GETOPT_INTERFACE_VERSION 2
-#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2
-#include <gnu-versions.h>
-#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
-#define ELIDE_CODE
-#endif
-#endif
-
-#ifndef ELIDE_CODE
-
-
-/* This needs to come after some library #include
-   to get __GNU_LIBRARY__ defined.  */
-#ifdef __GNU_LIBRARY__
-#include <stdlib.h>
-#endif
-
-#ifndef	NULL
-#define NULL 0
-#endif
-
-int
-getopt_long (argc, argv, options, long_options, opt_index)
-     int argc;
-     char *const *argv;
-     const char *options;
-     const struct option *long_options;
-     int *opt_index;
-{
-  return _getopt_internal (argc, argv, options, long_options, opt_index, 0);
-}
-
-/* Like getopt_long, but '-' as well as '--' can indicate a long option.
-   If an option that starts with '-' (not '--') doesn't match a long option,
-   but does match a short option, it is parsed as a short option
-   instead.  */
-
-int
-getopt_long_only (argc, argv, options, long_options, opt_index)
-     int argc;
-     char *const *argv;
-     const char *options;
-     const struct option *long_options;
-     int *opt_index;
-{
-  return _getopt_internal (argc, argv, options, long_options, opt_index, 1);
-}
-
-
-#endif	/* Not ELIDE_CODE.  */
-

-#ifdef TEST
-
-#include <stdio.h>
-
-int
-main (argc, argv)
-     int argc;
-     char **argv;
-{
-  int c;
-  int digit_optind = 0;
-
-  while (1)
-    {
-      int this_option_optind = optind ? optind : 1;
-      int option_index = 0;
-      static struct option long_options[] =
-      {
-	{"add", 1, 0, 0},
-	{"append", 0, 0, 0},
-	{"delete", 1, 0, 0},
-	{"verbose", 0, 0, 0},
-	{"create", 0, 0, 0},
-	{"file", 1, 0, 0},
-	{0, 0, 0, 0}
-      };
-
-      c = getopt_long (argc, argv, "abc:d:0123456789",
-		       long_options, &option_index);
-      if (c == -1)
-	break;
-
-      switch (c)
-	{
-	case 0:
-	  printf ("option %s", long_options[option_index].name);
-	  if (optarg)
-	    printf (" with arg %s", optarg);
-	  printf ("\n");
-	  break;
-
-	case '0':
-	case '1':
-	case '2':
-	case '3':
-	case '4':
-	case '5':
-	case '6':
-	case '7':
-	case '8':
-	case '9':
-	  if (digit_optind != 0 && digit_optind != this_option_optind)
-	    printf ("digits occur in two different argv-elements.\n");
-	  digit_optind = this_option_optind;
-	  printf ("option %c\n", c);
-	  break;
-
-	case 'a':
-	  printf ("option a\n");
-	  break;
-
-	case 'b':
-	  printf ("option b\n");
-	  break;
-
-	case 'c':
-	  printf ("option c with value `%s'\n", optarg);
-	  break;
-
-	case 'd':
-	  printf ("option d with value `%s'\n", optarg);
-	  break;
-
-	case '?':
-	  break;
-
-	default:
-	  printf ("?? getopt returned character code 0%o ??\n", c);
-	}
-    }
-
-  if (optind < argc)
-    {
-      printf ("non-option ARGV-elements: ");
-      while (optind < argc)
-	printf ("%s ", argv[optind++]);
-      printf ("\n");
-    }
-
-  exit (0);
-}
-
-#endif /* TEST */
diff --git a/win32/getopt_win.h b/win32/getopt_win.h
deleted file mode 100644
index ea78b30..0000000
--- a/win32/getopt_win.h
+++ /dev/null
@@ -1,168 +0,0 @@
-/* Declarations for getopt.
-   Copyright (C) 1989,90,91,92,93,94,96,97,98 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
-
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
-
-#ifndef _GETOPT_H
-
-#ifndef __need_getopt
-# define _GETOPT_H 1
-#endif
-
-#ifdef	__cplusplus
-extern "C" {
-#endif
-
-/* For communication from `getopt' to the caller.
-   When `getopt' finds an option that takes an argument,
-   the argument value is returned here.
-   Also, when `ordering' is RETURN_IN_ORDER,
-   each non-option ARGV-element is returned here.  */
-
-extern char *optarg;
-
-/* Index in ARGV of the next element to be scanned.
-   This is used for communication to and from the caller
-   and for communication between successive calls to `getopt'.
-
-   On entry to `getopt', zero means this is the first call; initialize.
-
-   When `getopt' returns -1, this is the index of the first of the
-   non-option elements that the caller should itself scan.
-
-   Otherwise, `optind' communicates from one call to the next
-   how much of ARGV has been scanned so far.  */
-
-extern int optind;
-
-/* Callers store zero here to inhibit the error message `getopt' prints
-   for unrecognized options.  */
-
-extern int opterr;
-
-/* Set to an option character which was unrecognized.  */
-
-extern int optopt;
-
-#ifndef __need_getopt
-/* Describe the long-named options requested by the application.
-   The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
-   of `struct option' terminated by an element containing a name which is
-   zero.
-
-   The field `has_arg' is:
-   no_argument		(or 0) if the option does not take an argument,
-   required_argument	(or 1) if the option requires an argument,
-   optional_argument 	(or 2) if the option takes an optional argument.
-
-   If the field `flag' is not NULL, it points to a variable that is set
-   to the value given in the field `val' when the option is found, but
-   left unchanged if the option is not found.
-
-   To have a long-named option do something other than set an `int' to
-   a compiled-in constant, such as set a value from `optarg', set the
-   option's `flag' field to zero and its `val' field to a nonzero
-   value (the equivalent single-letter option character, if there is
-   one).  For long options that have a zero `flag' field, `getopt'
-   returns the contents of the `val' field.  */
-
-struct option {
-# if defined __STDC__ && __STDC__
-  const char *name;
-# else
-  char *name;
-# endif
-  /* has_arg can't be an enum because some compilers complain about
-     type mismatches in all the code that assumes it is an int.  */
-  int has_arg;
-  int *flag;
-  int val;
-};
-
-/* Names for the values of the `has_arg' field of `struct option'.  */
-
-# define no_argument		0
-# define required_argument	1
-# define optional_argument	2
-#endif	/* need getopt */
-
-
-/* Get definitions and prototypes for functions to process the
-   arguments in ARGV (ARGC of them, minus the program name) for
-   options given in OPTS.
-
-   Return the option character from OPTS just read.  Return -1 when
-   there are no more options.  For unrecognized options, or options
-   missing arguments, `optopt' is set to the option letter, and '?' is
-   returned.
-
-   The OPTS string is a list of characters which are recognized option
-   letters, optionally followed by colons, specifying that that letter
-   takes an argument, to be placed in `optarg'.
-
-   If a letter in OPTS is followed by two colons, its argument is
-   optional.  This behavior is specific to the GNU `getopt'.
-
-   The argument `--' causes premature termination of argument
-   scanning, explicitly telling `getopt' that there are no more
-   options.
-
-   If OPTS begins with `--', then non-option arguments are treated as
-   arguments to the option '\0'.  This behavior is specific to the GNU
-   `getopt'.  */
-
-#if defined __STDC__ && __STDC__
-# ifdef __GNU_LIBRARY__
-/* Many other libraries have conflicting prototypes for getopt, with
-   differences in the consts, in stdlib.h.  To avoid compilation
-   errors, only prototype getopt for the GNU C library.  */
-extern int getopt (int __argc, char *const *__argv, const char *__shortopts);
-# else /* not __GNU_LIBRARY__ */
-extern int getopt ();
-# endif /* __GNU_LIBRARY__ */
-
-# ifndef __need_getopt
-extern int getopt_long (int __argc, char *const *__argv, const char *__shortopts,
-                        const struct option *__longopts, int *__longind);
-extern int getopt_long_only (int __argc, char *const *__argv,
-                             const char *__shortopts,
-                             const struct option *__longopts, int *__longind);
-
-/* Internal only.  Users should not call this directly.  */
-extern int _getopt_internal (int __argc, char *const *__argv,
-                             const char *__shortopts,
-                             const struct option *__longopts, int *__longind,
-                             int __long_only);
-# endif
-#else /* not __STDC__ */
-extern int getopt ();
-# ifndef __need_getopt
-extern int getopt_long ();
-extern int getopt_long_only ();
-
-extern int _getopt_internal ();
-# endif
-#endif /* __STDC__ */
-
-#ifdef	__cplusplus
-}
-#endif
-
-/* Make sure we later can get all the definitions and declarations.  */
-#undef __need_getopt
-
-#endif /* getopt.h */

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-xiph/oggvideotools.git



More information about the pkg-xiph-commits mailing list