summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorhandbrake <[email protected]>2006-01-14 13:11:35 +0000
committerhandbrake <[email protected]>2006-01-14 13:11:35 +0000
commit4beb6a8b483c9d84677b21cc271ce315f136335c (patch)
treee0ac0d4d1748ddde2ccc9a3310c3168474f266d9 /core
parent5bfcc1c3cf9baed140c62c37a13c5087bbd3d5cf (diff)
HandBrake 0.5.2
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@9 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'core')
-rw-r--r--core/AviMux.c4
-rw-r--r--core/HandBrake.c9
-rw-r--r--core/Mpeg2Dec.c3
-rw-r--r--core/Thread.c18
-rw-r--r--core/Utils.c9
5 files changed, 22 insertions, 21 deletions
diff --git a/core/AviMux.c b/core/AviMux.c
index bd0551217..ca34d3cab 100644
--- a/core/AviMux.c
+++ b/core/AviMux.c
@@ -1,4 +1,4 @@
-/* $Id: AviMux.c,v 1.5 2003/11/06 18:35:53 titer Exp $
+/* $Id: AviMux.c,v 1.6 2003/11/13 01:18:52 titer Exp $
This file is part of the HandBrake source code.
Homepage: <http://handbrake.m0k.org/>.
@@ -605,7 +605,7 @@ static void IndexAddInt32( HBBuffer * b, uint32_t val )
{
HBLog( "HBAviMux: reallocing index (%d MB)",
1 + b->alloc / 1024 / 1024 );
- HBBufferReAlloc( b, b->alloc + 1024 + 1024 );
+ HBBufferReAlloc( b, b->alloc + 1024 * 1024 );
}
b->data[b->size++] = val & 0xFF;
diff --git a/core/HandBrake.c b/core/HandBrake.c
index b7670bad8..c76a27b3c 100644
--- a/core/HandBrake.c
+++ b/core/HandBrake.c
@@ -1,4 +1,4 @@
-/* $Id: HandBrake.c,v 1.16 2003/11/09 21:26:52 titer Exp $
+/* $Id: HandBrake.c,v 1.18 2003/11/13 01:17:33 titer Exp $
This file is part of the HandBrake source code.
Homepage: <http://handbrake.m0k.org/>.
@@ -117,6 +117,7 @@ HBHandle * HBInit( int debug, int cpuCount )
h->lock = HBLockInit();
h->modeChanged = 1;
h->status.mode = HB_MODE_NEED_DEVICE;
+ h->status.titleList = NULL;
h->curTitle = NULL;
h->curAudio = NULL;
h->curOptAudio = NULL;
@@ -191,16 +192,16 @@ void HBStartRip( HBHandle * h, HBTitle * t,
FixPictureSettings( t );
/* Create fifos */
- t->mpeg2Fifo = HBFifoInit( 512 );
+ t->mpeg2Fifo = HBFifoInit( 1024 );
t->rawFifo = HBFifoInit( 1 );
t->scaledFifo = HBFifoInit( 1 );
t->mpeg4Fifo = HBFifoInit( 1 );
- a1->ac3Fifo = HBFifoInit( 512 );
+ a1->ac3Fifo = HBFifoInit( 1024 );
a1->rawFifo = HBFifoInit( 1 );
a1->mp3Fifo = HBFifoInit( 1 );
if( a2 )
{
- a2->ac3Fifo = HBFifoInit( 512 );
+ a2->ac3Fifo = HBFifoInit( 1024 );
a2->rawFifo = HBFifoInit( 1 );
a2->mp3Fifo = HBFifoInit( 1 );
}
diff --git a/core/Mpeg2Dec.c b/core/Mpeg2Dec.c
index d6ce22b3f..fb81f8080 100644
--- a/core/Mpeg2Dec.c
+++ b/core/Mpeg2Dec.c
@@ -1,4 +1,4 @@
-/* $Id: Mpeg2Dec.c,v 1.3 2003/11/06 12:33:11 titer Exp $
+/* $Id: Mpeg2Dec.c,v 1.4 2003/11/12 21:46:59 titer Exp $
This file is part of the HandBrake source code.
Homepage: <http://handbrake.m0k.org/>.
@@ -169,7 +169,6 @@ static int Mpeg2DecWork( HBWork * w )
tmpBuffer = HBBufferInit( rawBuffer->size );
tmpBuffer->position = rawBuffer->position;
tmpBuffer->pass = rawBuffer->pass;
- tmpBuffer->last = rawBuffer->last;
memcpy( tmpBuffer->data, rawBuffer->data,
tmpBuffer->size );
HBListAdd( m->rawBufferList, tmpBuffer );
diff --git a/core/Thread.c b/core/Thread.c
index 77caa0ee5..f0d8e628b 100644
--- a/core/Thread.c
+++ b/core/Thread.c
@@ -1,10 +1,13 @@
-/* $Id: Thread.c,v 1.4 2003/11/06 15:51:36 titer Exp $
+/* $Id: Thread.c,v 1.5 2003/11/12 16:09:34 titer Exp $
This file is part of the HandBrake source code.
Homepage: <http://handbrake.m0k.org/>.
It may be used under the terms of the GNU General Public License. */
#include "Thread.h"
+#ifdef SYS_CYGWIN
+# include <windows.h>
+#endif
struct HBThread
{
@@ -18,14 +21,11 @@ struct HBThread
#elif defined( SYS_MACOSX ) || defined( SYS_LINUX )
pthread_t thread;
#elif defined( SYS_CYGWIN )
- /* TODO */
- int thread;
+ HANDLE thread;
#endif
};
-#ifndef SYS_CYGWIN
static void ThreadFunc( void * t );
-#endif
HBThread * HBThreadInit( char * name, void (* function)(void *),
void * arg, int priority )
@@ -50,8 +50,8 @@ HBThread * HBThreadInit( char * name, void (* function)(void *),
pthread_create( &t->thread, NULL,
(void * (*)( void * )) ThreadFunc, t );
#elif defined( SYS_CYGWIN )
- /* TODO */
- t->thread = 0;
+ t->thread = CreateThread( NULL, 0,
+ (LPTHREAD_START_ROUTINE) ThreadFunc, t, 0, NULL );
#endif
HBLog( "HBThreadInit: thread %d started (\"%s\")",
@@ -60,7 +60,6 @@ HBThread * HBThreadInit( char * name, void (* function)(void *),
return t;
}
-#ifndef SYS_CYGWIN
static void ThreadFunc( void * _t )
{
HBThread * t = (HBThread*) _t;
@@ -77,7 +76,6 @@ static void ThreadFunc( void * _t )
t->function( t->arg );
}
-#endif
void HBThreadClose( HBThread ** _t )
{
@@ -89,7 +87,7 @@ void HBThreadClose( HBThread ** _t )
#elif defined( SYS_MACOSX ) || defined( SYS_LINUX )
pthread_join( t->thread, NULL );
#elif defined( SYS_CYGWIN )
- /* TODO */
+ WaitForSingleObject( t->thread, INFINITE );
#endif
HBLog( "HBThreadClose: thread %d stopped (\"%s\")",
diff --git a/core/Utils.c b/core/Utils.c
index 94b3b1e07..566979901 100644
--- a/core/Utils.c
+++ b/core/Utils.c
@@ -1,4 +1,4 @@
-/* $Id: Utils.c,v 1.7 2003/11/09 14:27:56 titer Exp $
+/* $Id: Utils.c,v 1.8 2003/11/12 16:09:34 titer Exp $
This file is part of the HandBrake source code.
Homepage: <http://handbrake.m0k.org/>.
@@ -7,6 +7,9 @@
#include <stdarg.h>
#include <time.h>
#include <sys/time.h>
+#ifdef SYS_CYGWIN
+# include <windows.h>
+#endif
#include "Utils.h"
#include "Fifo.h"
@@ -25,7 +28,7 @@ void HBSnooze( int time )
#elif defined( SYS_MACOSX ) || defined( SYS_LINUX )
usleep( time );
#elif defined( SYS_CYGWIN )
- /* TODO */
+ Sleep( time / 1000 );
#endif
}
@@ -68,7 +71,7 @@ uint64_t HBGetDate()
gettimeofday( &tv, NULL );
return( (uint64_t) tv.tv_sec * 1000000 + (uint64_t) tv.tv_usec );
#else
- return 0;
+ return( 1000 * GetTickCount() );
#endif
}