else
-LDFLAGS1 = -export-dynamic
+LDFLAGS1 = -Wl,-export-dynamic -g
LDFLAGS2 =
-LINKER = g++ -o $(OUTPUT)
+LINKER = $(CXX) -o $(OUTPUT)
endif
delete bits_title;
delete oss_bits;
- if(oss_path)
- {
- for(int i = 0; i < MAXDEVICES; i++)
- {
- delete oss_path[i];
- break;
- }
- }
+ for(int i = 0; i < MAXDEVICES; i++)
+ delete oss_path[i];
return 0;
}
#define GET_8BIT(i) ((double)(buffer[(i)]))
#define GET_16BIT(i) ((double)(*(int16_t*)&buffer[(i)]))
-#define GET_24BIT(i) (zi=(i), ((zi&1) ? \
- ((double)((*(uint8_t*)&buffer[zi]) | (*(int16_t*)&buffer[zi+1] << 8))) : \
- ((double)((*(uint16_t*)&buffer[zi]) | (*(int8_t*)&buffer[zi+2] << 16)))))
+#define GET_24BIT(i) ((i&1) ? \
+ ((double)((*(uint8_t*)&buffer[i]) | (*(int16_t*)&buffer[i+1] << 8))) : \
+ ((double)((*(uint16_t*)&buffer[i]) | (*(int8_t*)&buffer[i+2] << 16))))
#define GET_32BIT(i) ((double)(*(int32_t *)&buffer[(i)]))
#define GET_8BITS(j,k) { double sample = gain*GET_8BIT(k); STORE(j); }
int xfr_samples = xfr_size / frame_size;
for( int ich=0; ich<channels; ++ich ) {
- int zi;
int over_count = 0;
double *input_channel = data[ich]->get_data() + input_offset;
if( map51_2 ) {
void OSSThread::run()
{
+// this makes the longest (blocking) write 1024 samples
+// if this is not done, the video can be jerky
+ AudioDevice *audio_device = device->device;
+ int frame_size = audio_device->get_ochannels() * audio_device->get_obits()/8;
+ int maxsz = 1024*frame_size, blksz = maxsz;
+ ioctl(fd, SNDCTL_DSP_GETBLKSIZE, &blksz);
+ if( blksz > maxsz ) blksz = maxsz;
+
while(!done) {
input_lock->lock("OSSThread::run 1");
if(done) return;
read_lock->unlock();
}
else if(wr) {
+ if( !bytes_written )
+ timer->update();
int count = bytes;
unsigned char *bp = data;
- while( count > 0 ) {
+ while( count > 0 && !done ) {
Thread::enable_cancel();
- int ret = write(fd, bp, bytes);
+ int len = count>blksz ? blksz : count;
+ int ret = write(fd, bp, len);
Thread::disable_cancel();
if( ret < 0 ) break;
bp += ret;
if( !ioctl(fd, SNDCTL_DSP_GETODELAY, &delay) )
this->delay = delay;
bytes_written += ret;
+ timer->update();
timer_lock->unlock();
}
write_lock->unlock();
int64_t AudioOSS::device_position()
{
+ for (int i = 0; i < MAXDEVICES; i++) {
+ if( thread[i] ) {
+ int frame_size = device->get_ochannels() * device->get_obits()/8;
+ int64_t pos = thread[i]->device_position() / frame_size;
+ int64_t tmr = thread[i]->timer->get_scaled_difference(device->out_samplerate);
+ return pos + tmr;
+ }
+ }
count_info info;
if(!ioctl(get_output(0), SNDCTL_DSP_GETOPTR, &info))
{
// the problem is that if the first write to sound device was not full lenght fragment then
// _GETOPTR returns insanely large numbers at first moments of play
if (info.bytes > 2100000000) return 0;
- int frame = device->get_ochannels() * device->get_obits()/8;
- return info.bytes / frame;
- }
- for (int i = 0; i < MAXDEVICES; i++)
- {
- if (thread[i])
- return thread[i]->device_position() /
- device->get_ochannels() /
- (device->get_obits()/8) +
- thread[i]->timer->get_scaled_difference(device->out_samplerate);
+ int frame_size = device->get_ochannels() * device->get_obits()/8;
+ return info.bytes / frame_size;
}
return 0;
}
return 0;
}
+int64_t AudioOSS::samples_output()
+{
+ for( int i=0; i<MAXDEVICES; ++i ) {
+ if( thread[i] ) {
+ int frame_size = device->get_ochannels() * device->get_obits()/8;
+ return thread[i]->bytes_written / frame_size;
+ }
+ }
+ return 0;
+}
+
int AudioOSS::read_buffer(char *buffer, int bytes)
{
int sample_size = device->get_ibits() / 8;
int64_t device_position();
int flush_device();
int interrupt_playback();
+ int stop_output() { return interrupt_playback(); }
+ int64_t samples_output();
private:
int get_fmt(int bits);
if( picon->edl )
dst[1].append(item2 = new BC_ListBoxItem(picon->edl->local_session->clip_notes));
else
- if( picon->label && picon->label->textstr )
+ if( picon->label )
dst[1].append(item2 = new BC_ListBoxItem(picon->label->textstr));
else if( picon->mtime ) {
char date_time[BCSTRLEN];
inline int swap_bytes(int wordsize, unsigned char *buffer, long len)
{
- register unsigned char byte1, byte2, byte3, byte4;
- register unsigned char *buffer1 = buffer;
- register unsigned char *buffer2 = buffer + 1;
- register unsigned char *buffer3 = buffer + 2;
- register unsigned char *buffer4 = buffer + 3;
- register long i = 0;
+ unsigned char byte1, byte2, byte3, byte4;
+ unsigned char *buffer1 = buffer;
+ unsigned char *buffer2 = buffer + 1;
+ unsigned char *buffer3 = buffer + 2;
+ unsigned char *buffer4 = buffer + 3;
+ long i = 0;
//printf("swap bytes\n");
return n; \
}
-extern long timezone;
+extern long cin_timezone;
CmprFn(id_dn, ap->id - bp->id)
CmprFn(id_up, bp->id - ap->id)
CmprFn(title_dn, strcmp(ap->title, bp->title))
CmprFn(Title_up, strcasecmp(bp->title, ap->title))
CmprFn(title_up, strcmp(bp->title, ap->title))
-CmprFn(start_time_dn, fmod(ap->start_time-timezone,24*3600) - fmod(bp->start_time-timezone,24*3600))
-CmprFn(start_time_up, fmod(bp->start_time-timezone,24*3600) - fmod(ap->start_time-timezone,24*3600))
+CmprFn(start_time_dn, fmod(ap->start_time-cin_timezone,24*3600) - fmod(bp->start_time-cin_timezone,24*3600))
+CmprFn(start_time_up, fmod(bp->start_time-cin_timezone,24*3600) - fmod(ap->start_time-cin_timezone,24*3600))
CmprFn(access_time_dn, ap->access_time - bp->access_time)
CmprFn(access_time_up, bp->access_time - ap->access_time)
CmprFn(access_count_dn, ap->access_count - bp->access_count)
pix[2] = rp[0] + rp[1];
pix[1] = rp[0] + ((-778*rp[1] - (rp[2] << 11)) >> 12);
}
- FORC3 rp[c] = CLIP(pix[c] * sraw_mul[c] >> 10);
+ FORC3 rp[c] = (int)CLIP(pix[c] * sraw_mul[c] >> 10);
}
ljpeg_end (&jh);
maximum = 0x3fff;
parse_fuji (get4());
if (thumb_offset > 120) {
fseek (ifp, 120, SEEK_SET);
- is_raw += (i = get4()) && 1;
+ is_raw += (i = get4()) ? 1 : 0;
if (is_raw == 2 && shot_select)
parse_fuji (i);
}
else if (output_tiff && write_fun == &CLASS write_ppm_tiff)
write_ext = ".tiff";
else
- write_ext = ".pgm\0.ppm\0.ppm\0.pam" + colors*5-5;
+ write_ext = &".pgm\0.ppm\0.ppm\0.pam"[colors*5-5];
ofname = (char *) malloc (strlen(ifname) + 64);
merror (ofname, "main()");
if (write_to_stdout)
{
if(!use_brender) {
post_item(FILE_FFMPEG);
+#ifdef HAVE_LIBZMPEG
post_item(FILE_AC3);
+#endif
post_item(FILE_AIFF);
post_item(FILE_AU);
post_item(FILE_FLAC);
#endif
post_item(FILE_WAV);
post_item(FILE_RAWDV);
+#ifdef HAVE_LIBZMPEG
post_item(FILE_AMPEG);
post_item(FILE_VMPEG);
+#endif
post_item(FILE_VORBIS);
post_item(FILE_OGG);
post_item(FILE_PCM);
unsigned int FFT::reverse_bits(unsigned int index, unsigned int bits)
{
unsigned char b;
- union { unsigned int u; uint8_t b[sizeof(u)]; } data;
+ union { unsigned int u; uint8_t b[sizeof(unsigned int)]; } data;
data.u = index;
if( bits <= 8 ) {
index = rev_bytes[data.b[0]] >> (8-bits);
ArrayList<char*> *filenames;
};
+long cin_timezone;
int main(int argc, char *argv[])
{
ArrayList<char*> filenames;
FileSystem fs;
+ time_t st; time(&st);
+ struct tm ltm, gtm;
+ localtime_r(&st, <m);
+ gmtime_r(&st, >m);
+ int tzofs = ltm.tm_hour - gtm.tm_hour;
+ cin_timezone = tzofs * 60*60;
int operation = DO_GUI;
int deamon_port = DEAMON_PORT;
filenames.remove_all_objects();
Units::finit();
+ time_t et; time(&et);
+ long dt = et - st;
+ printf("Session time: %ld:%02ld:%02ld\n", dt/3600, dt%3600/60, dt%60);
return 0;
}
}
+extern long cin_timezone;
ArrayList<PluginServer*>* MWindow::plugindb = 0;
Commercials* MWindow::commercials = 0;
}
}
-//__timezone: Seconds west of UTC. 240sec/deg
- double tz_deg = -__timezone / 240.;
+// cin_timezone: Seconds west of UTC. 240sec/deg
+ double tz_deg = -cin_timezone / 240.;
// from Honolulu = -10, to New York = -5, 15deg/hr lat -150..-75
return tz_deg >= -10*15 && tz_deg <= -5*15 ? "NTSC" : "PAL";
}
render_active->lock("RenderEngine::run");
start_render_threads();
start_lock->unlock();
- interrupt_lock->unlock();
+ interrupt_lock->reset();
wait_render_threads();
#include <unistd.h>
+#ifndef AF_FILE
+#define AF_FILE AF_LOCAL
+#endif
RenderFarmServer::RenderFarmServer(
#include <unistd.h>
-
+#ifndef AF_FILE
+#define AF_FILE AF_LOCAL
+#endif
// The render client waits for connections from the server.
// Then it starts a thread for each connection.
*/
#ifndef RESIZETRACKTHREAD_H
-#define RESIZETRACKTHREAD_h
+#define RESIZETRACKTHREAD_H
// Level of change. Changes have to be inclusive of all the lesser changes.
// Delete cache
-#define CHANGE_ALL 0xffffffff
+#define CHANGE_ALL 0x7fffffff
// Delete render engines
#define CHANGE_EDL 0x11
// Search EDL and synchronize parameters.
#define __DB_H__
#include <cstring>
#include <stdint.h>
-#include <malloc.h>
+#include <stdlib.h>
#include <limits.h>
#include <sys/types.h>
ifeq ($(OBJDIR), x86_64)
BOOTSTRAPFLAGS := -DBOOTSTRAP="\"objcopy -B i386 -I binary -O elf64-x86-64\""
endif
+ifeq ($(OBJDIR), amd64)
+BOOTSTRAPFLAGS := -DBOOTSTRAP="\"objcopy -B i386 -I binary -O elf64-x86-64\""
+endif
$(shell mkdir -p $(OBJDIR) )
ar rs $(OUTPUT) `ls -1 $(dir $(BCXFER))/xfer*.o`
$(OBJDIR)/bootstrap:
- gcc -O2 $(BOOTSTRAPFLAGS) bootstrap.c -o $(OBJDIR)/bootstrap
+ $(CC) -O2 $(BOOTSTRAPFLAGS) bootstrap.c -o $(OBJDIR)/bootstrap
$(OBJDIR)/pngtoh: pngtoh.c
- gcc -O2 pngtoh.c -o $(OBJDIR)/pngtoh
+ $(CC) -O2 pngtoh.c -o $(OBJDIR)/pngtoh
$(OBJDIR)/pngtoraw: pngtoraw.c
- gcc -O2 pngtoraw.c -o $(OBJDIR)/pngtoraw -lpng -lz
+ $(CC) -O2 pngtoraw.c -o $(OBJDIR)/pngtoraw -lpng -lz
clean:
rm -rf $(OBJDIR)
entry->registry = cstrdup("utf");
entry->encoding = cstrdup("8");
- if(!FcPatternGetString(font, FC_STYLE, 0, &style) == FcResultMatch)
+ if( FcPatternGetString(font, FC_STYLE, 0, &style) != FcResultMatch )
force_style = 0;
// If font has a style unmanaged by titler plugin, force style to be displayed on name
const char *title;
};
-class cLock
-{
- Condition &cond;
-public:
- cLock(Condition &c) : cond(c) { cond.lock(); }
- cLock(Condition *c) : cond(*c) { cond.lock(); }
- ~cLock() { cond.unlock(); }
-};
-
-
#endif
int RotateEngine::create_matrix()
{
// Polar coords of pixel
- register double k, l, magnitude, angle, offset_angle, offset_angle2;
- register double x_offset, y_offset;
- register int i, j;
+ double k, l, magnitude, angle, offset_angle, offset_angle2;
+ double x_offset, y_offset;
+ int i, j;
int *int_row = 0;
SourceCoord *float_row = 0;
int input_x_i, input_y_i;
unsigned long Thread::get_tid()
{
- return tid;
+ return (unsigned long)tid;
}
int zaudio_decoder_layer_t::
dct64_1(float *out0, float *out1, float *b1, float *b2, float *samples)
{
- register float *costab = pnts[0];
+ float *costab = pnts[0];
b1[0x00] = samples[0x00] + samples[0x1F];
b1[0x01] = samples[0x01] + samples[0x1E];
b1[0x1C] = (b2[0x1C] - b2[0x1B]) * costab[3];
{
- register float const cos0 = pnts[3][0];
- register float const cos1 = pnts[3][1];
+ float const cos0 = pnts[3][0];
+ float const cos1 = pnts[3][1];
b2[0x00] = b1[0x00] + b1[0x03];
b2[0x03] = (b1[0x00] - b1[0x03]) * cos0;
}
{
- register float const cos0 = pnts[4][0];
+ float const cos0 = pnts[4][0];
b1[0x00] = b2[0x00] + b2[0x01];
b1[0x01] = (b2[0x00] - b2[0x01]) * cos0;
out1[0x10*14] = b1[0x0F];
{
- register float tmp;
+ float tmp;
tmp = b1[0x18] + b1[0x1C];
out0[0x10*15] = tmp + b1[0x10];
out0[0x10*13] = tmp + b1[0x14];
float tmp[18];
{
- register float *in = inbuf;
+ float *in = inbuf;
in[17]+=in[16]; in[16]+=in[15]; in[15]+=in[14];
in[14]+=in[13]; in[13]+=in[12]; in[12]+=in[11];
ts[SBLIMIT*(9+(v))] = out1[9+(v)] + tmpval * w[9+(v)]; \
}
{
- register float *out2 = o2;
- register float *w = wintab;
- register float *out1 = o1;
- register float *ts = tsbuf;
+ float *out2 = o2;
+ float *w = wintab;
+ float *out1 = o1;
+ float *ts = tsbuf;
MACRO(0);
MACRO(1);
* new DCT12
*/
int zaudio_decoder_layer_t::
-dct12(float *in,float *rawout1,float *rawout2,register float *wi,register float *ts)
+dct12(float *in,float *rawout1,float *rawout2,float *wi,float *ts)
{
#define DCT12_PART1 \
in5 = in[5*3]; \
{
float in0,in1,in2,in3,in4,in5;
- register float *out1 = rawout1;
+ float *out1 = rawout1;
ts[SBLIMIT*0] = out1[0]; ts[SBLIMIT*1] = out1[1]; ts[SBLIMIT*2] = out1[2];
ts[SBLIMIT*3] = out1[3]; ts[SBLIMIT*4] = out1[4]; ts[SBLIMIT*5] = out1[5];
{
float in0,in1,in2,in3,in4,in5;
- register float *out2 = rawout2;
+ float *out2 = rawout2;
DCT12_PART1
{
float in0,in1,in2,in3,in4,in5;
- register float *out2 = rawout2;
+ float *out2 = rawout2;
out2[12]=out2[13]=out2[14]=out2[15]=out2[16]=out2[17]=0.0;
DCT12_PART1
synth_stereo(float *bandPtr, int channel, float *out, int *pnt)
{
float *samples = out + *pnt;
- register float sum;
+ float sum;
float *b0, (*buf)[0x110];
int j, bo1;
5 if AMD MMX and 3DNow! instructions are supported
0 if hardware does not support any of these
*/
- register int rval = 0;
+ int rval = 0;
__asm__ __volatile__ (
/* See if CPUID instruction is supported ... */
#define fabsshift ((8*sizeof(unsigned int))-1)
#ifdef P6_CPU
-static __inline__ int intmax( register int x, register int y )
+static __inline__ int intmax( int x, int y )
{
asm( "cmpl %1, %0\n"
"cmovl %1, %0\n"
return x;
}
-static __inline__ int intmin( register int x, register int y )
+static __inline__ int intmin( int x, int y )
{
asm( "cmpl %1, %0\n"
"cmovg %1, %0\n"
return x;
}
-static __inline__ int intabs( register int x )
+static __inline__ int intabs( int x )
{
- register int neg = -x;
+ int neg = -x;
asm( "cmpl %1, %0\n"
"cmovl %1, %0\n"
: "+r" (x) : "r" (neg)
void fdct(block)
short *block;
{
- register int i, j;
+ int i, j;
double s;
double tmp[64];
uint8_t *p1,*p2;
int j;
int s;
- register int v;
+ int v;
s = 0;
p1 = blk1;
uint8_t *p1,*p2;
int i,j;
int s;
- register int v;
+ int v;
s = 0;
p1 = blk1;
uint8_t *p1,*p1a,*p2;
int i,j;
int s;
- register int v;
+ int v;
s = 0;
p1 = blk1;
uint8_t *p1,*p1a,*p2;
int i,j;
int s;
- register int v;
+ int v;
s = 0;
p1 = blk1;
for( j = 0; j < fh; ++j )
{
- register int diff;
+ int diff;
#define pipestep(o) diff = p1[o]-p2[o]; s += abs(diff)
pipestep(0); pipestep(1);
pipestep(2); pipestep(3);
static int dist44( uint8_t *s44blk1, uint8_t *s44blk2,int qlx,int qh)
{
- register uint8_t *p1 = s44blk1;
- register uint8_t *p2 = s44blk2;
+ uint8_t *p1 = s44blk1;
+ uint8_t *p2 = s44blk2;
int s = 0;
- register int diff;
+ int diff;
/* #define pipestep(o) diff = p1[o]-p2[o]; s += abs(diff) */
#define pipestep(o) diff = p1[o]-p2[o]; s += diff < 0 ? -diff : diff;
unsigned char *blk1,*blk2;
int lx,hx,hy,h;
{
- register unsigned char *p1,*p1a,*p2;
- register int v, s;
+ unsigned char *p1,*p1a,*p2;
+ int v, s;
int j;
s = 0;
unsigned char *pf,*pb,*p2;
int lx,hxf,hyf,hxb,hyb,h;
{
- register unsigned char *pfa,*pfb,*pfc,*pba,*pbb,*pbc;
+ unsigned char *pfa,*pfb,*pfc,*pba,*pbb,*pbc;
int j;
- register int i, s, v;
+ int i, s, v;
pfa = pf + hxf;
pfb = pf + lx*hyf;
int lx;
{
int i, j;
- register unsigned int v, s, s2;
+ unsigned int v, s, s2;
s = s2 = 0;
int lx;
{
int j;
- register unsigned int v, s, s2;
+ unsigned int v, s, s2;
s = s2 = 0;
int lx,
short *blk)
{
- register int j;
+ int j;
for (j=0; j<8; j++)
{
int lx,
short *blk)
{
- register int j;
+ int j;
for (j=0; j<8; j++)
{
CFLAGS += $(static_incs)
LFLAGS += $(static_libs)
-LDLINKER ?= g++ -shared
+LDLINKER ?= $(CXX) -shared
$(shell mkdir -p $(OBJDIR))
PLUGIN_DIR := $(BINDIR)/plugins
int BlurEngine::multiply_alpha(pixel_f *row, int size)
{
-// register int i;
-// register double alpha;
+// int i;
+// double alpha;
// for(i = 0; i < size; i++)
// {
int BlurEngine::separate_alpha(pixel_f *row, int size)
{
-// register int i;
-// register double alpha;
-// register double result;
+// int i;
+// double alpha;
+// double result;
// for(i = 0; i < size; i++)
// {
int length,
int levels)
{
- register int i, j, k, l, m;
+ int i, j, k, l, m;
for(i = 0, k = 1; k < levels; i++, k++)
{
// insert zeros between each element of the input sequence and
// convolve with the filter to interpolate the data
{
- register int i, j;
+ int i, j;
int endpoint = length + filtlen - 2;
if (sum_output)
if(config->level <= INFINITYGAIN) return 0;
double result;
- register double x;
+ double x;
double power = this->db.fromdb(config->level) * normalize_constant;
double phase_offset = config->phase * this->period;
double x3 = x1 + phase_offset;