Adapt neutrino-mp for CST hardware part #2

- libtuxtxt: Add extra directory libtuxtxt_mp for neutrino-mp
 - Workaround, tuxtxt neutrino-hd incompatible to
 framebuffer_ng from neutrino-mp


Origin commit data
------------------
Branch: ni/coolstream
Commit: 9d18316676
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2016-01-15 (Fri, 15 Jan 2016)

Origin message was:
------------------
Adapt neutrino-mp for CST hardware part #2

 - libtuxtxt: Add extra directory libtuxtxt_mp for neutrino-mp
 - Workaround, tuxtxt neutrino-hd incompatible to
  framebuffer_ng from neutrino-mp


------------------
This commit was generated by Migit
This commit is contained in:
Michael Liebmann
2016-01-15 16:19:53 +01:00
parent 8db42dd287
commit 517b71f613
18 changed files with 10223 additions and 283 deletions

View File

@@ -1,6 +1,12 @@
/* tuxtxt_common.h
* for license info see the other tuxtxt files
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#if !HAVE_COOL_HARDWARE
#include <libtuxtxt_mp/tuxtxt_common.h>
#else
#include <sys/ioctl.h>
#include <fcntl.h>
#include <pthread.h>
@@ -17,7 +23,6 @@
tuxtxt_cache_struct tuxtxt_cache;
static pthread_mutex_t tuxtxt_cache_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_mutex_t tuxtxt_cache_biglock = PTHREAD_MUTEX_INITIALIZER;
int tuxtxt_get_zipsize(int p,int sp)
{
tstCachedPage* pg = tuxtxt_cache.astCachetable[p][sp];
@@ -353,7 +358,6 @@ int tuxtxt_GetSubPage(int page, int subpage, int offset)
void tuxtxt_clear_cache(void)
{
pthread_mutex_lock(&tuxtxt_cache_biglock);
pthread_mutex_lock(&tuxtxt_cache_lock);
int clear_page, clear_subpage, d26;
tuxtxt_cache.maxadippg = -1;
@@ -417,7 +421,6 @@ void tuxtxt_clear_cache(void)
printf("TuxTxt cache cleared\n");
#endif
pthread_mutex_unlock(&tuxtxt_cache_lock);
pthread_mutex_unlock(&tuxtxt_cache_biglock);
}
/******************************************************************************
* init_demuxer *
@@ -545,7 +548,6 @@ void tuxtxt_allocate_cache(int magazine)
// Lock here as we have a possible race here with
// tuxtxt_clear_cache(). We should not be allocating and
// freeing at the same time.
// *** this is probably worked around by tuxtxt_cacehe_biglock now *** --seife
pthread_mutex_lock(&tuxtxt_cache_lock);
/* check cachetable and allocate memory if needed */
@@ -618,13 +620,6 @@ void *tuxtxt_CacheThread(void * /*arg*/)
continue;
}
/* this "big hammer lock" is a hack: it avoids a crash if
* tuxtxt_clear_cache() is called while the cache thread is in the
* middle of the following loop, leading to tuxtxt_cache.current_page[]
* etc. being set to -1 and tuxtxt_cache.astCachetable[] etc. being set
* to NULL
* it probably also avoids the possible race in tuxtxt_allocate_cache() */
pthread_mutex_lock(&tuxtxt_cache_biglock);
/* analyze it */
for (line = 0; line < readcnt/0x2e /*4*/; line++)
{
@@ -1066,7 +1061,6 @@ void *tuxtxt_CacheThread(void * /*arg*/)
printf("line %d row %X %X, continue\n", line, vtx_rowbyte[0], vtx_rowbyte[1]);
#endif
}
pthread_mutex_unlock(&tuxtxt_cache_biglock);
}
pthread_exit(NULL);
@@ -1144,3 +1138,4 @@ int tuxtxt_stop_thread()
#endif
return 1;
}
#endif