MediaTomb再導入

先日のTrusty化したGT110bで忘れていたMediaTomb昨年2月以来の再戦。

昨年2月に導入したリビジョン 2104にfix_libav_0.7_support.patch、libavformat_0.11_support.patch、mediatomb-seek.patchの3パッチを適用したソースツリーをrebuildしたところ

yano@GT110b:~/software/MediaTomb/mediatomb-r2104$ make
~~ 中略 ~~
g++ -DHAVE_CONFIG_H -I. -I.. -I../tombupnp/upnp/inc    -I../src -I../tombupnp/ixml/inc -I../tombupnp/threadutil/inc -I../tombupnp/upnp/inc -I..  -I/usr/include/mysql -DBIG_JOINS=1  -fno-strict-aliasing   -g -DNDEBUG         -pthread        -g -O2 -MT libmediatomb_a-autoscan.o -MD -MP -MF .deps/libmediatomb_a-autoscan.Tpo -c -o libmediatomb_a-autoscan.o `test -f '../src/autoscan.cc' || echo './'`../src/autoscan.cc
In file included from ../src/zmm/zmm.h:37:0,
                 from ../src/zmmf/zmmf.h:35,
                 from ../src/autoscan.h:36,
                 from ../src/autoscan.cc:36:
../src/zmm/object.h:51:32: **error: declaration of ‘operator new’ as non-function**
     static void* operator new (size_t size);
                                ^
../src/zmm/object.h:51:27: **error: expected ‘;’ at end of member declaration**
     static void* operator new (size_t size);
                           ^
../src/zmm/object.h:51:39: **error: expected ‘)’ before ‘size’**
     static void* operator new (size_t size);
                                       ^
make[2]: *** [libmediatomb_a-autoscan.o] Error 1
make[2]: Leaving directory `/home/yano/software/MediaTomb/mediatomb-r2104/build'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/yano/software/MediaTomb/mediatomb-r2104'
make: *** [all] Error 2

というエラーで止ってしまった。どうやらGCC 4.6由来の問題らしく、MediaTomb / Patches / #25 Fix build error with GCC 4.6に倣ってmediatomb-0.12.1-gcc46.patchを適用。すると、今度は

yano@GT110b:~/software/MediaTomb/mediatomb-r2104$ make
~~ 中略 ~~
make[2]: Entering directory `/home/yano/software/MediaTomb/mediatomb-r2104/build'
g++ -DHAVE_CONFIG_H -I. -I.. -I../tombupnp/upnp/inc    -I../src -I../tombupnp/ixml/inc -I../tombupnp/threadutil/inc -I../tombupnp/upnp/inc -I..  -I/usr/include/mysql -DBIG_JOINS=1  -fno-strict-aliasing   -g -DNDEBUG         -pthread        -g -O2 -MT libmediatomb_a-action_request.o -MD -MP -MF .deps/libmediatomb_a-action_request.Tpo -c -o libmediatomb_a-action_request.o `test -f '../src/action_request.cc' || echo './'`../src/action_request.cc
mv -f .deps/libmediatomb_a-action_request.Tpo .deps/libmediatomb_a-action_request.Po
g++ -DHAVE_CONFIG_H -I. -I.. -I../tombupnp/upnp/inc    -I../src -I../tombupnp/ixml/inc -I../tombupnp/threadutil/inc -I../tombupnp/upnp/inc -I..  -I/usr/include/mysql -DBIG_JOINS=1  -fno-strict-aliasing   -g -DNDEBUG         -pthread        -g -O2 -MT libmediatomb_a-autoscan.o -MD -MP -MF .deps/libmediatomb_a-autoscan.Tpo -c -o libmediatomb_a-autoscan.o `test -f '../src/autoscan.cc' || echo './'`../src/autoscan.cc
mv -f .deps/libmediatomb_a-autoscan.Tpo .deps/libmediatomb_a-autoscan.Po
g++ -DHAVE_CONFIG_H -I. -I.. -I../tombupnp/upnp/inc    -I../src -I../tombupnp/ixml/inc -I../tombupnp/threadutil/inc -I../tombupnp/upnp/inc -I..  -I/usr/include/mysql -DBIG_JOINS=1  -fno-strict-aliasing   -g -DNDEBUG         -pthread        -g -O2 -MT libmediatomb_a-autoscan_inotify.o -MD -MP -MF .deps/libmediatomb_a-autoscan_inotify.Tpo -c -o libmediatomb_a-autoscan_inotify.o `test -f '../src/autoscan_inotify.cc' || echo './'`../src/autoscan_inotify.cc
In file included from ../src/hash.h:49:0,
                 from ../src/autoscan_inotify.h:36,
                 from ../src/autoscan_inotify.cc:38:
../src/hash/dbo_hash.h: In instantiation of ‘zmm::Ref<VT> DBOHash<KT, VT>::get(KT) [with KT = int; VT = AutoscanInotify::Wd]’:
../src/autoscan_inotify.cc:229:48:   required from here
../src/hash/dbo_hash.h:165:39: **error: ‘search’ was not declared in this scope**, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
         bool found = search(key, &slot);
                                       ^
../src/hash/dbo_hash.h:165:39: note: declarations in dependent base ‘DHashBase<int, dbo_hash_slot<int, AutoscanInotify::Wd> >’ are not found by unqualified lookup
../src/hash/dbo_hash.h:165:39: note: use ‘this->search’ instead
../src/hash/dbo_hash.h: In instantiation of ‘bool DBOHash<KT, VT>::remove(KT) [with KT = int; VT = AutoscanInotify::Wd]’:
../src/autoscan_inotify.cc:329:39:   required from here
../src/hash/dbo_hash.h:109:32: **error: ‘search’ was not declared in this scope**, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
         if (! search(key, &slot))
                                ^
../src/hash/dbo_hash.h:109:32: note: declarations in dependent base ‘DHashBase<int, dbo_hash_slot<int, AutoscanInotify::Wd> >’ are not found by unqualified lookup
../src/hash/dbo_hash.h:109:32: note: use ‘this->search’ instead
../src/hash/dbo_hash.h: In instantiation of ‘void DBOHash<KT, VT>::put(KT, zmm::Ref<VT>) [with KT = int; VT = AutoscanInotify::Wd]’:
../src/autoscan_inotify.cc:392:35:   required from here
../src/hash/dbo_hash.h:139:26: **error: ‘search’ was not declared in this scope**, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
         search(key, &slot);
                          ^
../src/hash/dbo_hash.h:139:26: note: declarations in dependent base ‘DHashBase<int, dbo_hash_slot<int, AutoscanInotify::Wd> >’ are not found by unqualified lookup
../src/hash/dbo_hash.h:139:26: note: use ‘this->search’ instead
make[2]: *** [libmediatomb_a-autoscan_inotify.o] Error 1
make[2]: Leaving directory `/home/yano/software/MediaTomb/mediatomb-r2104/build'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/yano/software/MediaTomb/mediatomb-r2104'
make: *** [all] Error 2

というエラー発生。特にパッチが出ているような雰囲気は無いので、use ‘this->search’ insteadと言われるとおり**this->**を付与して解決。 ./src/hash/dbo_hash.hだけでなく./src/hash/dbr_hash.h./src/hash/dso_hash.hも同様だったので、mediatomb-hash_socpe.patchを作っておく。

cite=“mediatomb-hash_socpe.patch”>*** ./src/hash/dbo_hash.h.orig 2012-10-22 00:50:27.000000000 +0900

— ./src/hash/dbo_hash.h 2014-07-25 16:30:36.721645351 +0900


*** 106,112 ****

  inline bool remove(KT key)  

  {  

      struct dbo_hash_slotKT, VT *slot;  

! if (! search(key, slot))

          return false;  

      slot-key = deletedKey;  

      slot-value-release();  

— 106,112 —-

  inline bool remove(KT key)  

  {  

      struct dbo_hash_slotKT, VT *slot;  

! if (! this-search(key, slot))

          return false;  

      slot-key = deletedKey;  

      slot-value-release();  

*** 136,142 ****

  inline void put(KT key, zmm::RefVT value)  

  {  

      struct dbo_hash_slotKT, VT *slot;  

! search(key, slot);

      put(key, (hash_slot_t)slot, value);  

  }  

  void put(KT key, hash_slot_t destSlot, zmm::RefVT value)  

— 136,142 —-

  inline void put(KT key, zmm::RefVT value)  

  {  

      struct dbo_hash_slotKT, VT *slot;  

! this-search(key, slot);

      put(key, (hash_slot_t)slot, value);  

  }  

  void put(KT key, hash_slot_t destSlot, zmm::RefVT value)  

*** 162,168 ****

  inline zmm::RefVT get(KT key)  

  {  

      struct dbo_hash_slotKT, VT *slot;  

! bool found = search(key, slot);

      if (found)  

          return zmm::RefVT(slot-value);  

      else  

— 162,168 —-

  inline zmm::RefVT get(KT key)  

  {  

      struct dbo_hash_slotKT, VT *slot;  

! bool found = this-search(key, slot);

      if (found)  

          return zmm::RefVT(slot-value);  

      else  

*** 174,180 ****

  inline zmm::RefVT get(KT key, hash_slot_t *destSlot)  

  {  

      struct dbo_hash_slotKT, VT **slot = (struct dbo_hash_slotKT, VT **)destSlot;  

! bool found = search(key, slot);

      if (found)  

          return zmm::RefVT((*slot)-value);  

      else  

— 174,180 —-

  inline zmm::RefVT get(KT key, hash_slot_t *destSlot)  

  {  

      struct dbo_hash_slotKT, VT **slot = (struct dbo_hash_slotKT, VT **)destSlot;  

! bool found = this-search(key, slot);

      if (found)  

          return zmm::RefVT((*slot)-value);  

      else  

*** ./src/hash/dbr_hash.h.orig 2012-10-22 00:50:27.000000000 +0900

— ./src/hash/dbr_hash.h 2014-07-25 16:31:48.843639371 +0900


*** 124,130 ****

  inline bool remove(KT key)  

  {  

      struct dbr_hash_slotKT *slot;  

! if (! search(key, slot))

          return false;  

      slot-key = deletedKey;  

      int array_slot = slot-array_slot;  

— 124,130 —-

  inline bool remove(KT key)  

  {  

      struct dbr_hash_slotKT *slot;  

! if (! this-search(key, slot))

          return false;  

      slot-key = deletedKey;  

      int array_slot = slot-array_slot;  

*** 134,140 ****

          return true;  

      }  

      data_array[array_slot] = data_array[--this-count];  

! if (! search(data_array[array_slot], slot))

      {  

          log_debug(DBR-Hash-Error: (%d; array_slot=%d; count=%d)\n, data_array[array_slot], array_slot, this-count);  

          throw zmm::Exception(_(DBR-Hash-Error: key in data_array not found in hashtable));  

— 134,140 —-

          return true;  

      }  

      data_array[array_slot] = data_array[--this-count];  

! if (! this-search(data_array[array_slot], slot))

      {  

          log_debug(DBR-Hash-Error: (%d; array_slot=%d; count=%d)\n, data_array[array_slot], array_slot, this-count);  

          throw zmm::Exception(_(DBR-Hash-Error: key in data_array not found in hashtable));  

*** 146,152 ****

  inline void put(KT key)  

  {  

      struct dbr_hash_slotKT *slot;  

! if (! search(key, slot))

      {  

#ifdef TOMBDEBUG

          if (this-count = realCapacity)  

— 146,152 —-

  inline void put(KT key)  

  {  

      struct dbr_hash_slotKT *slot;  

! if (! this-search(key, slot))

      {  

#ifdef TOMBDEBUG

          if (this-count = realCapacity)  

*** 194,200 ****

  inline bool exists(KT key)  

  {  

      struct dbr_hash_slotKT *slot;  

! return search(key, slot);

  }  



  /*  

— 194,200 —-

  inline bool exists(KT key)  

  {  

      struct dbr_hash_slotKT *slot;  

! return this-search(key, slot);

  }  



  /*  

*** 202,208 ****

  inline bool exists(KT key, hash_slot_t *destSlot)  

  {  

! return search(key, (KT **)destSlot);

  }  

  */  

};

— 202,208 —-

  inline bool exists(KT key, hash_slot_t *destSlot)  

  {  

! return this-search(key, (KT **)destSlot);

  }  

  */  

};

*** ./src/hash/dso_hash.h.orig 2012-10-22 00:50:27.000000000 +0900

— ./src/hash/dso_hash.h 2014-07-25 16:33:00.461619216 +0900


*** 100,106 ****

  inline bool remove(zmm::String key)  

  {  

      struct dso_hash_slotVT *slot;  

! if (! search(key, slot))

          return false;  

      slot-key-release();  

      slot-value-release();  

— 100,106 —-

  inline bool remove(zmm::String key)  

  {  

      struct dso_hash_slotVT *slot;  

! if (! this-search(key, slot))

          return false;  

      slot-key-release();  

      slot-value-release();  

*** 112,118 ****

  inline void put(zmm::String key, zmm::RefVT value)  

  {  

      struct dso_hash_slotVT *slot;  

! search(key, slot);

      put(key, (hash_slot_t)slot, value);  

  }  

  void put(zmm::String key, hash_slot_t destSlot, zmm::RefVT value)  

— 112,118 —-

  inline void put(zmm::String key, zmm::RefVT value)  

  {  

      struct dso_hash_slotVT *slot;  

! this-search(key, slot);

      put(key, (hash_slot_t)slot, value);  

  }  

  void put(zmm::String key, hash_slot_t destSlot, zmm::RefVT value)  

*** 141,147 ****

  inline zmm::RefVT get(zmm::String key)  

  {  

      struct dso_hash_slotVT *slot;  

! bool found = search(key, slot);

      if (found)  

          return zmm::RefVT(slot-value);  

      else  

— 141,147 —-

  inline zmm::RefVT get(zmm::String key)  

  {  

      struct dso_hash_slotVT *slot;  

! bool found = this-search(key, slot);

      if (found)  

          return zmm::RefVT(slot-value);  

      else  

*** 153,159 ****

  inline zmm::RefVT get(zmm::String key, hash_slot_t *destSlot)  

  {  

      struct dso_hash_slotVT **slot = (struct dso_hash_slotVT **)destSlot;  

! bool found = search(key, slot);

      if (found)  

          return zmm::RefVT((*slot)-value);  

      else  

— 153,159 —-

  inline zmm::RefVT get(zmm::String key, hash_slot_t *destSlot)  

  {  

      struct dso_hash_slotVT **slot = (struct dso_hash_slotVT **)destSlot;  

! bool found = this-search(key, slot);

      if (found)  

          return zmm::RefVT((*slot)-value);  

      else