diff options
author | handbrake <[email protected]> | 2006-01-14 13:27:00 +0000 |
---|---|---|
committer | handbrake <[email protected]> | 2006-01-14 13:27:00 +0000 |
commit | b69e82fd960103c41979e00beb9b1c9fac78083b (patch) | |
tree | 264c5b637fd261c67d17e1d3649d4526c585e663 | |
parent | 951be4e0b69aa652c992124025c862c4f1660937 (diff) |
HandBrake 0.6.0-test3
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@12 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | AUTHORS | 3 | ||||
-rw-r--r-- | Jamfile | 28 | ||||
-rw-r--r-- | Jamrules | 5 | ||||
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | THANKS | 6 | ||||
-rw-r--r-- | TODO | 93 | ||||
-rw-r--r-- | TRANSLATIONS | 20 | ||||
-rw-r--r-- | core/Ac3Dec.c | 8 | ||||
-rw-r--r-- | core/Fifo.c | 17 | ||||
-rw-r--r-- | core/HBInternal.h | 4 | ||||
-rw-r--r-- | core/HandBrake.c | 42 | ||||
-rw-r--r-- | core/Jamfile | 3 | ||||
-rw-r--r-- | core/LpcmDec.c | 148 | ||||
-rw-r--r-- | core/Mp4Mux.c | 4 | ||||
-rw-r--r-- | core/OgmMux.c | 4 | ||||
-rw-r--r-- | core/Scale.c | 114 | ||||
-rw-r--r-- | core/Scan.c | 19 | ||||
-rw-r--r-- | core/Thread.c | 4 | ||||
-rw-r--r-- | core/Utils.c | 20 | ||||
-rw-r--r-- | core/Utils.h | 14 | ||||
-rw-r--r-- | core/VorbisEnc.c | 17 | ||||
-rw-r--r-- | doc/faq.html | 180 | ||||
-rw-r--r-- | doc/faq.txt | 11 | ||||
-rw-r--r-- | macosx/Controller.mm | 32 | ||||
-rw-r--r-- | macosx/English.lproj/InfoPlist.strings | bin | 520 -> 520 bytes | |||
-rw-r--r-- | macosx/English.lproj/MainMenu.nib/info.nib | 11 | ||||
-rw-r--r-- | macosx/English.lproj/MainMenu.nib/objects.nib | bin | 19603 -> 19527 bytes | |||
-rw-r--r-- | macosx/HandBrake.xcode/project.pbxproj | 8 | ||||
-rw-r--r-- | macosx/PictureGLView.mm | 32 | ||||
-rw-r--r-- | macosx/i18n/nl.strings | bin | 0 -> 10106 bytes | |||
-rw-r--r-- | test/test.c | 6 |
31 files changed, 496 insertions, 360 deletions
@@ -1,4 +1,4 @@ -$Id: AUTHORS,v 1.2 2004/03/01 19:09:38 titer Exp $ +$Id: AUTHORS,v 1.3 2004/03/08 11:32:48 titer Exp $ AUTHORS file for HandBrake <http://handbrake.m0k.org/> @@ -6,6 +6,7 @@ Eric Petit <[email protected]> + Core (construct, multithreading, BeOS/OS X/Linux ports) + MPEG demuxer + MPEG-2 and AC3 decoders (w/ libmpeg2/liba52) + + LPCM "decoder" + MPEG-4, MP3 and AAC encoders (w/ libavcodec/libxvidcore/libmp3lame/ libfaac) + AVI muxer @@ -1,4 +1,4 @@ -# $Id: Jamfile,v 1.39 2004/02/18 17:21:00 titer Exp $ +# $Id: Jamfile,v 1.40 2004/03/08 11:32:48 titer Exp $ # # This file is part of the HandBrake source code. # Homepage: <http://handbrake.m0k.org/>. @@ -7,13 +7,14 @@ SubDir TOP ; HB_PACKAGES = ; +HB_LIBS = libhb.a liba52.a libavcodec.a libdvdplay.a libdvdread.a + libdvdcss.a libfaac.a libmp3lame.a libmp4v2.a libmpeg2.a + libvorbis.a libvorbisenc.a libogg.a libx264.a + libxvidcore.a ; # CLI app ObjectCcFlags test/test.c : -I$(TOP)/core -g -Wall ; -LinkLibraries HBTest : - libhb.a liba52.a libavcodec.a libdvdplay.a libdvdread.a libdvdcss.a - libfaac.a libmp3lame.a libmp4v2.a libmpeg2.a libvorbis.a - libvorbisenc.a libogg.a libx264.a libxvidcore.a ; +LinkLibraries HBTest : $(HB_LIBS) ; Main HBTest : test/test.c ; # BeOS @@ -23,10 +24,7 @@ if $(OS) = BEOS ObjectC++Flags $(SOURCES_BEOS) : -I$(TOP)/core -I$(TOP)/beos/liblayout -g -Wall ; LINKLIBS on HandBrake = $(LINKLIBS) -L$(TOP)/lib -llayout -lbe ; - LinkLibraries HandBrake : - libhb.a liba52.a libavcodec.a libdvdplay.a libdvdread.a libdvdcss.a - libfaac.a libmp3lame.a libmp4v2.a libmpeg2.a libvorbis.a - libvorbisenc.a libogg.a libx264.a libxvidcore.a ; + LinkLibraries HandBrake : $(HB_LIBS) ; Main HandBrake : $(SOURCES_BEOS) ; } @@ -35,10 +33,9 @@ if $(OS) = MACOSX { # Build the app OSXApp HandBrake.app ; - Depends HandBrake.app : - libhb.a liba52.a libavcodec.a libdvdplay.a libdvdread.a - libdvdcss.a libfaac.a libmp3lame.a libmp4v2.a libmpeg2.a - libvorbis.a libvorbisenc.a libogg.a libx264.a libxvidcore.a ; + Depends HandBrake.app : $(HB_LIBS) macosx/Controller.h + macosx/Controller.mm macosx/PictureGLView.h + macosx/PictureGLView.mm ; Depends all : HandBrake.app ; # Package @@ -55,10 +52,7 @@ if $(OS) = LINUX ObjectCcFlags $(SOURCES_GTK2) : -I$(TOP)/core `pkg-config gtk+-2.0 --cflags` ; LINKLIBS on gtk2HB = $(LINKLIBS) `pkg-config gtk+-2.0 --libs` ; - LinkLibraries gtk2HB : - libhb.a liba52.a libavcodec.a libdvdplay.a libdvdread.a libdvdcss.a - libfaac.a libmp3lame.a libmp4v2.a libmpeg2.a libvorbis.a - libvorbisenc.a libogg.a libx264.a libxvidcore.a ; + LinkLibraries gtk2HB : $(HB_LIBS) ; Main gtk2HB : $(SOURCES_GTK2) ; } @@ -8,7 +8,7 @@ LINK = g++ ; OPTIM = -O3 -funroll-loops ; # HandBrake defines -HB_VERSION = 0.6.0-test2 ; +HB_VERSION = 0.6.0-test3 ; DEFINES = HB_$(OS) HB_VERSION=\\\"$(HB_VERSION)\\\" ; #DEFINES += HB_NOMMX ; @@ -24,6 +24,7 @@ else if $(OS) = LINUX } else if $(OS) = MACOSX { + # To clean HandBrake.app RM = rm -rf ; } @@ -103,7 +104,7 @@ actions BuildOSXApp $(RM) $(1) && \ ( cd macosx && xcodebuild ) && \ cp -r macosx/build/HandBrake.app $(1) && \ - for i in French German it pl ru; do \ + for i in French German it pl ru nl; do \ ( cd $(1)/Contents/Resources && \ cp -r English.lproj $i.lproj && \ cp ../../../macosx/i18n/$i.strings \ @@ -1,4 +1,4 @@ -$Id: NEWS,v 1.11 2004/03/01 21:36:36 titer Exp $ +$Id: NEWS,v 1.12 2004/03/08 11:32:48 titer Exp $ NEWS file for HandBrake <http://handbrake.m0k.org/> @@ -6,6 +6,7 @@ Changes between 0.5.2 and 0.6.0 + MP4 and OGM output + AAC and Vorbis encoding + Experimental H264 encoding + + LPCM DVDs support + Autocrop + GTK2 linux interface + OS X interface localization @@ -1,4 +1,4 @@ -$Id: THANKS,v 1.6 2004/03/01 19:09:38 titer Exp $ +$Id: THANKS,v 1.7 2004/03/04 17:57:17 titer Exp $ THANKS file for HandBrake <http://handbrake.m0k.org/> @@ -19,3 +19,7 @@ Adam Nik Roby + Russian translation + +Leendert + + Dutch translation + @@ -1,50 +1,49 @@ -$Id: TODO,v 1.29 2004/03/01 21:36:36 titer Exp $ +$Id: TODO,v 1.32 2004/03/08 11:32:48 titer Exp $ TODO file for HandBrake <http://handbrake.m0k.org/> -Features to be added are written in no particular order. - -- Core - + Remove some duplicate code here and here - + Should be able to boost or normalize the audio volume - + Allow the intf to preview the latest encoded picture - + Finish and test the MPEG audio decoder - + PCM - + More encoding options: B-frames, type of estimation etc etc - + Subtitle support - + Allow the user to split the file in x parts - + AC3 pass-through - + MKV muxing support - + Manual aspect ratio - + Rotate the movie - + Rip only a few chapters, or rip X seconds from a given starting - point - + Network shared processing (using RendezVous?) - + Do some DVD buffering so the drive can rest most of the time - + Custom framerate - + Homemade resampler - + VCD/DVD-R output - + Better remaining time calculation - + Theora encoding - -- All interfaces - + Use the DVD name in popup and for the name of the created file - + Nice 'About...' box with link to homepage & faq - + Add a 'Cancel' button in the crop & scale panel - + Allow to launch rips of several titles - -- BeOS interface - + Redo the picture panel (liblayout?) - + Add warnings (invalid bitrate, file already exists etc) - + i18n - -- Mac OS X interface - + Warning when the user quit the app while encoding - + Progress bar in the dock icon - + Send a mail when rip is done - + Turn the computer off when done - + Collapse interface when rip starts - -- Bugs - + OSX - crash when trying to encode a DVD from mounted toast image - + OSX - opengl effects somtimes mess up the picture's brightness +This is a roadmap for future releases of HandBrake. It has to be taken +as an indication, as it may change as any time. + +0.6.0 + + Make sure the deadlock at the end of the rip is gone + +Maybe in 0.6.0 + + New, up-to-date BeOS GUI [if I get some help] + +0.7.x + + Homemade resampler + + Audio volume normalizing + + AC3 pass-through + + Subtitle support + + Rip only a few chapters or rip X seconds from a given starting point + + Allow to launch rips of several titles + +Maybe in 0.7.x + + MPEG audio decoding [if I have a DVD to test it] + + B-frames, bla bla + + MKV muxing support + + Manual aspect ratio + + Better remaining time calculation + + Nice 'About...' box with link to homepage & faq + + [OSX] Progress bar in the dock icon + +After 0.7.0 + + Preview the latest encoded picture in GUI + + Split output file in x parts + + Picture rotation + + Custom framerate + + Network shared processing (using RendezVous?) + + VCD/DVD-R output + + Theora encoding + + Raw MPEG/AC3 output + + DVD folder output + + Use the DVD name in popup and for the name of the created file + + Send a mail when rip is done + + Turn the computer off when done + + Collapse interface when rip starts + +Misc known bugs: + + [OSX] crash when trying to encode a DVD from mounted toast image + + [OSX] opengl effects somtimes mess up the picture's brightness + diff --git a/TRANSLATIONS b/TRANSLATIONS new file mode 100644 index 000000000..63e140253 --- /dev/null +++ b/TRANSLATIONS @@ -0,0 +1,20 @@ +$Id: TRANSLATIONS,v 1.1 2004/03/08 12:22:46 titer Exp $ + +TRANSLATIONS file for HandBrake <http://handbrake.m0k.org/> + +Translating HandBrake +===================== + +Only the OS X interface of HandBrake can be translated at the moment. +Localization is not implemented in BeOS and GTK GUIs. + +HandBrake uses the NSLocalizedString() OS X function to translate every +item in the interface. Therefore, you don't need (and mustn't) modify +the nib files. All you have to do is to write a Localizable.strings for +your language. You can get it (for the latest release) at +<http://handbrake.m0k.org/Localizable.strings>. + +Edit it with Xcode, save it to HandBrake/macosx/i18n/xx.strings (where +'xx' are the two letters representing your language), then add 'xx' to +the language list in the Jamrules file (in the 'BuildOSXApp' action). + diff --git a/core/Ac3Dec.c b/core/Ac3Dec.c index e1b027887..3fb4cc0ae 100644 --- a/core/Ac3Dec.c +++ b/core/Ac3Dec.c @@ -1,4 +1,4 @@ -/* $Id: Ac3Dec.c,v 1.12 2004/01/16 19:04:03 titer Exp $ +/* $Id: Ac3Dec.c,v 1.13 2004/03/08 11:32:48 titer Exp $ This file is part of the HandBrake source code. Homepage: <http://handbrake.m0k.org/>. @@ -58,13 +58,13 @@ HBWork * HBAc3DecInit( HBHandle * handle, HBAudio * audio ) /* Let it do the downmixing */ a->outFlags = A52_STEREO; - if( audio->codec == HB_CODEC_MP3 ) + if( audio->outCodec == HB_CODEC_MP3 ) /* Lame wants 16 bits samples */ a->sampleLevel = 32768.0; - else if( audio->codec == HB_CODEC_AAC ) + else if( audio->outCodec == HB_CODEC_AAC ) /* Faac wants 24 bits samples */ a->sampleLevel = 8388608.0; - else if( audio->codec == HB_CODEC_VORBIS ) + else if( audio->outCodec == HB_CODEC_VORBIS ) /* Vorbis wants FIXME bits samples */ a->sampleLevel = 32768.0; diff --git a/core/Fifo.c b/core/Fifo.c index 06aed08cb..7e7433e01 100644 --- a/core/Fifo.c +++ b/core/Fifo.c @@ -1,10 +1,13 @@ -/* $Id: Fifo.c,v 1.9 2004/02/24 21:55:53 titer Exp $ +/* $Id: Fifo.c,v 1.12 2004/03/04 17:35:52 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 "Fifo.h" +#if defined( HB_BEOS ) || defined( HB_LINUX ) +#include <malloc.h> +#endif HBBuffer * HBBufferInit( int size ) { @@ -45,15 +48,19 @@ HBBuffer * HBBufferInit( int size ) void HBBufferReAlloc( HBBuffer * b, int size ) { - b->alloc = size; #if defined( HB_BEOS ) || defined( HB_LINUX ) b->data = realloc( b->data, size ); #elif defined( HB_MACOSX ) - b->dataOrig = realloc( b->dataOrig, size ); - b->data = b->dataOrig; + /* Ugly */ + uint8_t * new = malloc( size ); + memcpy( new, b->data, b->size ); + free( b->dataOrig ); + b->dataOrig = new; + b->data = new; #elif defined( HB_CYGWIN ) /* TODO */ #endif + b->alloc = size; if( !b->data ) { @@ -106,8 +113,10 @@ HBFifo * HBFifoInit( int capacity ) void HBFifoDie( HBFifo * f ) { + HBLockLock( f->lock ); f->die = 1; HBCondSignal( f->cond ); + HBLockUnlock( f->lock ); } void HBFifoClose( HBFifo ** _f ) diff --git a/core/HBInternal.h b/core/HBInternal.h index 169451980..a8adb4d44 100644 --- a/core/HBInternal.h +++ b/core/HBInternal.h @@ -1,4 +1,4 @@ -/* $Id: HBInternal.h,v 1.4 2004/01/16 20:55:21 titer Exp $ +/* $Id: HBInternal.h,v 1.5 2004/03/08 11:32:48 titer Exp $ This file is part of the HandBrake source code. Homepage: <http://handbrake.m0k.org/>. @@ -21,6 +21,8 @@ HBWork * HBMpeg2DecInit( HBHandle *, HBTitle * ); void HBMpeg2DecClose( HBWork ** ); HBWork * HBAc3DecInit( HBHandle *, HBAudio * ); void HBAc3DecClose( HBWork ** ); +HBWork * HBLpcmDecInit( HBHandle *, HBAudio * ); +void HBLpcmDecClose( HBWork ** ); HBWork * HBMadDecInit( HBHandle *, HBAudio * ); void HBMadDecClose( HBWork ** ); diff --git a/core/HandBrake.c b/core/HandBrake.c index 010f1a3cf..5eca5a78d 100644 --- a/core/HandBrake.c +++ b/core/HandBrake.c @@ -1,4 +1,4 @@ -/* $Id: HandBrake.c,v 1.42 2004/02/18 17:07:20 titer Exp $ +/* $Id: HandBrake.c,v 1.44 2004/03/08 11:32:48 titer Exp $ This file is part of the HandBrake source code. Homepage: <http://handbrake.m0k.org/>. @@ -147,12 +147,16 @@ void HBStartRip( HBHandle * h, HBTitle * title ) audio->outFifo = HBFifoInit( 4 ); /* At least 4 for Vorbis */ /* Audio work objects */ - audio->decoder = HBAc3DecInit( h, audio ); - if( audio->codec == HB_CODEC_MP3 ) + if( audio->inCodec == HB_CODEC_AC3 ) + audio->decoder = HBAc3DecInit( h, audio ); + else if( audio->inCodec == HB_CODEC_LPCM ) + audio->decoder = HBLpcmDecInit( h, audio ); + + if( audio->outCodec == HB_CODEC_MP3 ) audio->encoder = HBMp3EncInit( h, audio ); - else if( audio->codec == HB_CODEC_AAC ) + else if( audio->outCodec == HB_CODEC_AAC ) audio->encoder = HBFaacEncInit( h, audio ); - else if( audio->codec == HB_CODEC_VORBIS ) + else if( audio->outCodec == HB_CODEC_VORBIS ) audio->encoder = HBVorbisEncInit( h, audio ); } @@ -551,6 +555,13 @@ static void _StopRip( HBHandle * h ) HBAudio * audio; int i; + /* Stop input and work threads */ + HBDVDReadClose( &title->dvdRead ); + for( i = 0; i < h->cpuCount; i++ ) + { + HBWorkThreadClose( &title->workThreads[h->cpuCount-i-1] ); + } + /* Invalidate fifos */ HBFifoDie( title->outFifo ); for( i = 0; i < HBListCount( title->ripAudioList ); i++ ) @@ -559,9 +570,7 @@ static void _StopRip( HBHandle * h ) HBFifoDie( audio->outFifo ); } - /* Stop threads */ - HBDVDReadClose( &title->dvdRead ); - + /* Stop mux thread */ if( title->mux == HB_MUX_AVI ) HBAviMuxClose( &title->aviMux ); else if( title->mux == HB_MUX_MP4 ) @@ -569,11 +578,6 @@ static void _StopRip( HBHandle * h ) else if( title->mux == HB_MUX_OGM ) HBOgmMuxClose( &title->ogmMux ); - for( i = 0; i < h->cpuCount; i++ ) - { - HBWorkThreadClose( &title->workThreads[h->cpuCount-i-1] ); - } - /* Clean up */ HBMpeg2DecClose( &title->decoder ); HBScaleClose( &title->scale ); @@ -595,12 +599,16 @@ static void _StopRip( HBHandle * h ) audio = HBListItemAt( title->ripAudioList, i ); /* Audio work objects */ - HBAc3DecClose( &audio->decoder ); - if( audio->codec == HB_CODEC_MP3 ) + if( audio->inCodec == HB_CODEC_AC3 ) + HBAc3DecClose( &audio->decoder ); + else if( audio->inCodec == HB_CODEC_LPCM ) + HBLpcmDecClose( &audio->decoder ); + + if( audio->outCodec == HB_CODEC_MP3 ) HBMp3EncClose( &audio->encoder ); - else if( audio->codec == HB_CODEC_AAC ) + else if( audio->outCodec == HB_CODEC_AAC ) HBFaacEncClose( &audio->encoder ); - else if( audio->codec == HB_CODEC_VORBIS ) + else if( audio->outCodec == HB_CODEC_VORBIS ) HBVorbisEncClose( &audio->encoder ); /* Audio fifos */ diff --git a/core/Jamfile b/core/Jamfile index d33688722..949e24388 100644 --- a/core/Jamfile +++ b/core/Jamfile @@ -1,4 +1,4 @@ -# $Id: Jamfile,v 1.5 2004/01/16 19:04:04 titer Exp $ +# $Id: Jamfile,v 1.6 2004/03/08 11:32:48 titer Exp $ # # This file is part of the HandBrake source code. # Homepage: <http://handbrake.m0k.org/>. @@ -14,6 +14,7 @@ FaacEnc.c FfmpegEnc.c Fifo.c HandBrake.c +LpcmDec.c MadDec.c Mp3Enc.c Mp4Mux.c diff --git a/core/LpcmDec.c b/core/LpcmDec.c new file mode 100644 index 000000000..53b56d8f2 --- /dev/null +++ b/core/LpcmDec.c @@ -0,0 +1,148 @@ +/* $Id: LpcmDec.c,v 1.1 2004/03/08 11:32:48 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 "HBInternal.h" + +typedef struct HBLpcmDec +{ + HB_WORK_COMMON_MEMBERS + + HBHandle * handle; + HBAudio * audio; + + int initDone; + int channels; + float sampleLevel; + HBBuffer * rawBuffer; +} HBLpcmDec; + +/* Local prototypes */ +static int LpcmDecWork( HBWork * ); + +HBWork * HBLpcmDecInit( HBHandle * handle, HBAudio * audio ) +{ + HBLpcmDec * l; + if( !( l = calloc( sizeof( HBLpcmDec ), 1 ) ) ) + { + HBLog( "HBLpcmDecInit: malloc() failed, gonna crash" ); + return NULL; + } + + l->name = strdup( "LpcmDec" ); + l->work = LpcmDecWork; + + l->handle = handle; + l->audio = audio; + + if( audio->outCodec & ( HB_CODEC_MP3 | HB_CODEC_VORBIS ) ) + { + /* 16 bits samples */ + l->sampleLevel = 1.0; + } + else if( audio->outCodec & HB_CODEC_AAC ) + { + /* 24 bits samples */ + l->sampleLevel = 256.0; + } + + return (HBWork*) l; +} + +void HBLpcmDecClose( HBWork ** _l ) +{ + HBLpcmDec * l = (HBLpcmDec*) *_l; + + /* Clean up */ + if( l->rawBuffer ) + { + HBBufferClose( &l->rawBuffer ); + } + free( l->name ); + free( l ); + + *_l = NULL; +} + +static int LpcmDecWork( HBWork * w ) +{ + HBLpcmDec * l = (HBLpcmDec*) w; + HBAudio * audio = l->audio; + HBBuffer * lpcmBuffer; + int16_t * int16data; + + int i; + int samples; + int didSomething = 0; + + /* Push decoded buffer */ + if( l->rawBuffer ) + { + if( HBFifoPush( audio->rawFifo, &l->rawBuffer ) ) + { + didSomething = 1; + } + else + { + return 0; + } + } + + /* Get a new LPCM buffer */ + lpcmBuffer = HBFifoPop( audio->inFifo ); + if( !lpcmBuffer ) + { + return didSomething; + } + + if( !l->initDone ) + { + /* SampleRate */ + switch( ( lpcmBuffer->data[4] >> 4 ) & 0x3 ) + { + case 0: + audio->inSampleRate = 48000; + break; + case 1: + audio->inSampleRate = 32000; + break; + default: + HBLog( "LpcmDec: unknown samplerate (%d)", + ( lpcmBuffer->data[4] >> 4 ) & 0x3 ); + } + HBLog( "LpcmDec: samplerate = %d Hz", audio->inSampleRate ); + + /* Channels */ + HBLog( "LpcmDec: %d channels", + ( lpcmBuffer->data[4] & 0x7 ) + 1 ); + + l->initDone = 1; + } + + if( lpcmBuffer->data[5] != 0x80 ) + { + HBLog( "LpcmDec: no frame synx (%02x�", lpcmBuffer->data[5] ); + } + + samples = ( lpcmBuffer->size - 6 ) / sizeof( int16_t ) / 2; + int16data = (int16_t*) ( lpcmBuffer->data + 6 ); + + l->rawBuffer = HBBufferInit( samples * sizeof( float ) * 2 ); + l->rawBuffer->left = (float*) l->rawBuffer->data; + l->rawBuffer->right = l->rawBuffer->left + samples; + l->rawBuffer->position = lpcmBuffer->position; + l->rawBuffer->samples = samples; + + for( i = 0; i < samples; i++ ) + { + l->rawBuffer->left[i] = (float) int16data[2*i] * l->sampleLevel; + l->rawBuffer->right[i] = (float) int16data[2*i+1] * l->sampleLevel; + } + + HBBufferClose( &lpcmBuffer ); + + return 1; +} + diff --git a/core/Mp4Mux.c b/core/Mp4Mux.c index e1b8e9e64..c545c96fc 100644 --- a/core/Mp4Mux.c +++ b/core/Mp4Mux.c @@ -1,4 +1,4 @@ -/* $Id: Mp4Mux.c,v 1.23 2004/02/18 19:36:35 titer Exp $ +/* $Id: Mp4Mux.c,v 1.24 2004/03/08 13:42:29 titer Exp $ This file is part of the HandBrake source code. Homepage: <http://handbrake.m0k.org/>. @@ -195,11 +195,13 @@ static void Mp4MuxThread( void * _m ) MP4Close( file ); + HBLog( "HBMp4Mux: making the file ISMA compliant" ); if( !MP4MakeIsmaCompliant( title->file, 0 /*MP4_DETAILS_ALL*/, 1 ) ) { HBLog( "HBMp4Mux: MP4MakeIsmaCompliant() failed" ); } + HBLog( "HBMp4Mux: optimizing" ); sprintf( tmpFile, "%s.tmp", title->file ); tmpFile[strlen( title->file ) + 4] = '\0'; if( !MP4Optimize( title->file, tmpFile, 0 /*MP4_DETAILS_ALL*/ ) ) diff --git a/core/OgmMux.c b/core/OgmMux.c index d4712594b..fef1ae01b 100644 --- a/core/OgmMux.c +++ b/core/OgmMux.c @@ -1,4 +1,4 @@ -/* $Id: OgmMux.c,v 1.6 2004/02/13 15:12:09 titer Exp $ +/* $Id: OgmMux.c,v 1.7 2004/03/08 11:32:48 titer Exp $ This file is part of the HandBrake source code. Homepage: <http://handbrake.m0k.org/>. @@ -303,7 +303,7 @@ static int OgmStart( HBOgmMux *ogm ) { HBAudio *audio = HBListItemAt( title->ripAudioList, i - 1 ); - ogm->tk[i].codec = audio->codec; + ogm->tk[i].codec = audio->outCodec; ogm->tk[i].fifo = audio->outFifo; ogm->tk[i].i_packet_no = 0; ogg_stream_init (&ogm->tk[i].os, i ); diff --git a/core/Scale.c b/core/Scale.c index 464623c1e..527882539 100644 --- a/core/Scale.c +++ b/core/Scale.c @@ -1,4 +1,4 @@ -/* $Id: Scale.c,v 1.9 2004/01/16 19:39:23 titer Exp $ +/* $Id: Scale.c,v 1.10 2004/03/08 11:32:48 titer Exp $ This file is part of the HandBrake source code. Homepage: <http://handbrake.m0k.org/>. @@ -6,7 +6,11 @@ #include "HBInternal.h" +#define USE_FFMPEG + +#ifdef USE_FFMPEG #include "ffmpeg/avcodec.h" +#endif typedef struct HBScale { @@ -15,16 +19,25 @@ typedef struct HBScale HBHandle * handle; HBTitle * title; + HBBuffer * deintBuffer; + HBList * scaledBufferList; +#ifdef USE_FFMPEG ImgReSampleContext * context; AVPicture rawPicture; - HBBuffer * deintBuffer; AVPicture deintPicture; - HBList * scaledBufferList; AVPicture scaledPicture; +#endif } HBScale; /* Local prototypes */ static int ScaleWork( HBWork * ); +#ifndef USE_FFMPEG +static void Deinterlace( uint8_t * in, uint8_t * out, int w, int h, + int tcrop, int bcrop, int lcrop, int rcrop ); +static void Resample( uint8_t * in, uint8_t * out, int oldw, int oldh, + int neww, int newh, int tcrop, int bcrop, + int lcrop, int rcrop ); +#endif HBWork * HBScaleInit( HBHandle * handle, HBTitle * title ) { @@ -41,18 +54,21 @@ HBWork * HBScaleInit( HBHandle * handle, HBTitle * title ) s->handle = handle; s->title = title; + /* Allocate a constant buffer used for deinterlacing */ + s->deintBuffer = HBBufferInit( 3 * title->inWidth * + title->inHeight / 2 ); + +#ifdef USE_FFMPEG + avpicture_fill( &s->deintPicture, s->deintBuffer->data, + PIX_FMT_YUV420P, title->inWidth, title->inHeight ); + /* Init libavcodec */ s->context = img_resample_full_init( title->outWidth, title->outHeight, title->inWidth, title->inHeight, title->topCrop, title->bottomCrop, title->leftCrop, title->rightCrop ); - - /* Allocate a constant buffer used for deinterlacing */ - s->deintBuffer = HBBufferInit( 3 * title->inWidth * - title->inHeight / 2 ); - avpicture_fill( &s->deintPicture, s->deintBuffer->data, - PIX_FMT_YUV420P, title->inWidth, title->inHeight ); +#endif s->scaledBufferList = HBListInit(); @@ -63,7 +79,9 @@ void HBScaleClose( HBWork ** _s ) { HBScale * s = (HBScale*) *_s; +#ifdef USE_FFMPEG img_resample_close( s->context ); +#endif HBListClose( &s->scaledBufferList ); HBBufferClose( &s->deintBuffer ); free( s->name ); @@ -79,6 +97,10 @@ static int ScaleWork( HBWork * w ) HBBuffer * rawBuffer; HBBuffer * scaledBuffer; HBBuffer * tmpBuffer; +#ifndef USE_FFMPEG + uint8_t * in, * out; + int plane, shift; +#endif int didSomething = 0; @@ -114,6 +136,7 @@ static int ScaleWork( HBWork * w ) scaledBuffer->position = rawBuffer->position; scaledBuffer->pass = rawBuffer->pass; +#ifdef USE_FFMPEG /* libavcodec stuff */ avpicture_fill( &s->rawPicture, rawBuffer->data, PIX_FMT_YUV420P, title->inWidth, title->inHeight ); @@ -134,6 +157,39 @@ static int ScaleWork( HBWork * w ) { img_resample( s->context, &s->scaledPicture, &s->rawPicture ); } +#else + if( title->deinterlace ) + { + in = rawBuffer->data; + out = s->deintBuffer->data; + for( plane = 0; plane < 3; plane++ ) + { + shift = plane ? 1 : 0; + Deinterlace( in, out, title->inWidth >> shift, + title->inHeight >> shift, + title->topCrop >> shift, + title->bottomCrop >> shift, + title->leftCrop >> shift, + title->rightCrop >> shift ); + in += title->inWidth * title->inHeight >> ( 2 * shift ); + out += title->inWidth * title->inHeight >> ( 2 * shift ); + } + } + + in = title->deinterlace ? s->deintBuffer->data : rawBuffer->data; + out = scaledBuffer->data; + for( plane = 0; plane < 3; plane++ ) + { + shift = plane ? 1 : 0; + Resample( in, out, title->inWidth >> shift, + title->inHeight >> shift, title->outWidth >> shift, + title->outHeight >> shift, title->topCrop >> shift, + title->bottomCrop >> shift, title->leftCrop >> shift, + title->rightCrop >> shift ); + in += title->inWidth * title->inHeight >> ( 2 * shift ); + out += title->outWidth * title->outHeight >> ( 2 * shift );; + } +#endif HBListAdd( s->scaledBufferList, scaledBuffer ); @@ -154,3 +210,43 @@ static int ScaleWork( HBWork * w ) return didSomething; } +#ifndef USE_FFMPEG +static void Deinterlace( uint8_t * in, uint8_t * out, int w, int h, + int tcrop, int bcrop, int lcrop, int rcrop ) +{ + int i, j; + + /* First line */ + if( !tcrop ) + { + memcpy( out, in + lcrop, w - lcrop - rcrop ); + } + + /* Merge lines */ + for( i = MAX( 1, tcrop ); i < h - bcrop; i++ ) + { + for( j = lcrop; j < w - rcrop; j++ ) + { + out[i*w+j] = ( in[(i-1)*w+j] + in[i*w+j] ) / 2; + } + } +} + +static void Resample( uint8_t * in, uint8_t * out, int oldw, int oldh, + int neww, int newh, int tcrop, int bcrop, + int lcrop, int rcrop ) +{ + int i, j; + int cropw = oldw - lcrop - rcrop; + int croph = oldh - tcrop - bcrop; + for( i = 0; i < newh; i++ ) + { + for( j = 0; j < neww; j++ ) + { + out[i*neww+j] = in[(tcrop+i*croph/newh)*oldw + + lcrop+j*cropw/neww]; + } + } +} +#endif + diff --git a/core/Scan.c b/core/Scan.c index f2afd5e6c..8f19a138d 100644 --- a/core/Scan.c +++ b/core/Scan.c @@ -1,4 +1,4 @@ -/* $Id: Scan.c,v 1.14 2004/01/18 13:21:12 titer Exp $ +/* $Id: Scan.c,v 1.15 2004/03/08 11:32:48 titer Exp $ This file is part of the HandBrake source code. Homepage: <http://handbrake.m0k.org/>. @@ -149,7 +149,7 @@ static HBTitle * ScanTitle( HBScan * s, dvdplay_ptr vmg, int index ) for( i = 0; i < audio_nr; i++ ) { - int id, j; + int id, j, codec; if( s->die ) { @@ -163,10 +163,18 @@ static HBTitle * ScanTitle( HBScan * s, dvdplay_ptr vmg, int index ) continue; } - if( ( id & 0xF0FF ) != 0x80BD ) + if( ( id & 0xF0FF ) == 0x80BD ) { - HBLog( "HBScan: title %d: non-AC3 audio track detected, " - "ignoring", index ); + codec = HB_CODEC_AC3; + } + else if( ( id & 0xF0FF ) == 0xA0BD ) + { + codec = HB_CODEC_LPCM; + } + else + { + HBLog( "HBScan: title %d: unknown audio codec (%x), " + "ignoring", index, id ); continue; } @@ -194,6 +202,7 @@ static HBTitle * ScanTitle( HBScan * s, dvdplay_ptr vmg, int index ) attr = dvdplay_audio_attr( vmg, j ); audio = HBAudioInit( id, LanguageForCode( attr->lang_code ) ); + audio->inCodec = codec; HBLog( "HBScan: title %d: new language (%x, %s)", index, id, audio->language ); HBListAdd( title->audioList, audio ); diff --git a/core/Thread.c b/core/Thread.c index 413ff8b6e..b5635116e 100644 --- a/core/Thread.c +++ b/core/Thread.c @@ -1,4 +1,4 @@ -/* $Id: Thread.c,v 1.11 2004/02/19 17:59:13 titer Exp $ +/* $Id: Thread.c,v 1.12 2004/03/04 17:57:17 titer Exp $ This file is part of the HandBrake source code. Homepage: <http://handbrake.m0k.org/>. @@ -33,7 +33,7 @@ struct HBThread /* HBThreadInit actually starts this routine because pthread_setschedparam() might fail if called from an external - thread (typically, because the thread exited immediatly. This isn't + thread (typically, because the thread exited immediatly). This isn't really necessary, but I find it nicer that way */ static void ThreadFunc( void * _t ) { diff --git a/core/Utils.c b/core/Utils.c index f9451bb9a..81aeebea5 100644 --- a/core/Utils.c +++ b/core/Utils.c @@ -1,4 +1,4 @@ -/* $Id: Utils.c,v 1.14 2004/01/16 19:04:04 titer Exp $ +/* $Id: Utils.c,v 1.16 2004/03/08 11:32:48 titer Exp $ This file is part of the HandBrake source code. Homepage: <http://handbrake.m0k.org/>. @@ -38,7 +38,6 @@ void HBLog( char * log, ... ) time_t _now; struct tm * now; va_list args; - int ret; if( !getenv( "HB_DEBUG" ) ) { @@ -53,12 +52,11 @@ void HBLog( char * log, ... ) /* Convert the message to a string */ va_start( args, log ); - ret = vsnprintf( string + 11, 67, log, args ); + vsnprintf( string + 11, 67, log, args ); va_end( args ); /* Add the end of line */ - string[ret+11] = '\n'; - string[ret+12] = '\0'; + strcat( string, "\n" ); /* Print it */ fprintf( stderr, "%s", string ); @@ -155,9 +153,17 @@ int HBPStoES( HBBuffer ** _psBuffer, HBList * esBufferList ) if( streamId == 0xBD ) { - /* A52: don't ask */ streamId |= ( d[pos] << 8 ); - pos += 4; + if( ( streamId & 0xF0FF ) == 0x80BD ) + { + /* A52 */ + pos += 4; + } + else if( ( streamId & 0xF0FF ) == 0xA0BD ) + { + /* LPCM */ + pos += 1; + } } /* Sanity check */ diff --git a/core/Utils.h b/core/Utils.h index a83c36c65..2d1a06b92 100644 --- a/core/Utils.h +++ b/core/Utils.h @@ -1,4 +1,4 @@ -/* $Id: Utils.h,v 1.22 2004/01/21 18:40:36 titer Exp $ +/* $Id: Utils.h,v 1.23 2004/03/08 11:32:48 titer Exp $ This file is part of the HandBrake source code. Homepage: <http://handbrake.m0k.org/>. @@ -100,10 +100,11 @@ void HBAudioClose( HBAudio ** ); #define HB_CODEC_FFMPEG 0x01 #define HB_CODEC_XVID 0x02 #define HB_CODEC_AC3 0x04 -#define HB_CODEC_MP3 0x08 -#define HB_CODEC_AAC 0x10 -#define HB_CODEC_X264 0x20 -#define HB_CODEC_VORBIS 0x40 +#define HB_CODEC_LPCM 0x08 +#define HB_CODEC_MP3 0x10 +#define HB_CODEC_AAC 0x20 +#define HB_CODEC_X264 0x40 +#define HB_CODEC_VORBIS 0x80 /* Possible muxers */ #define HB_MUX_AVI 0x00 @@ -191,7 +192,8 @@ struct HBAudio char * language; /* Settings */ - int codec; + int inCodec; + int outCodec; int inSampleRate; int outSampleRate; int inBitrate; diff --git a/core/VorbisEnc.c b/core/VorbisEnc.c index a4f305720..c75b36850 100644 --- a/core/VorbisEnc.c +++ b/core/VorbisEnc.c @@ -1,4 +1,4 @@ -/* $Id: VorbisEnc.c,v 1.4 2003/12/26 20:03:27 titer Exp $ +/* $Id: VorbisEnc.c,v 1.5 2004/03/08 11:32:49 titer Exp $ This file is part of the HandBrake source code. Homepage: <http://handbrake.m0k.org/>. @@ -119,16 +119,17 @@ static int VorbisEncWork( HBWork *w ) /* init */ vorbis_info_init( &enc->vi ); - if( vorbis_encode_setup_vbr( &enc->vi, 2 /* channel */, audio->inSampleRate, 1.0/* quality 0.0 -> 1.0*/ ) ) + if( vorbis_encode_setup_managed( &enc->vi, 2, + audio->inSampleRate, -1, 1000 * audio->outBitrate, -1 ) || + vorbis_encode_ctl( &enc->vi, OV_ECTL_RATEMANAGE_AVG, NULL ) || + vorbis_encode_setup_init( &enc->vi ) ) { - HBLog( "VorbisEnc: vorbis_encode_setup_vbr failed" ); + HBLog( "VorbisEnc: vorbis_encode_setup_managed failed" ); return 0; } - vorbis_encode_setup_init( &enc->vi ); - /* add a comment */ vorbis_comment_init( &enc->vc ); - vorbis_comment_add_tag( &enc->vc, "ENCODER", "Handbrake"); + vorbis_comment_add_tag( &enc->vc, "ENCODER", "HandBrake"); /* set up the analysis state and auxiliary encoding storage */ vorbis_analysis_init( &enc->vd, &enc->vi); @@ -197,14 +198,14 @@ static int VorbisEncWork( HBWork *w ) } } - didSomething = 1; - /* FUCK -Werror ! */ if( !GetSamples( enc ) ) { return didSomething; } + didSomething = 1; + buffer = vorbis_analysis_buffer( &enc->vd, OGGVORBIS_FRAME_SIZE ); for( i = 0; i < OGGVORBIS_FRAME_SIZE; i++ ) { diff --git a/doc/faq.html b/doc/faq.html deleted file mode 100644 index 2c1961b4d..000000000 --- a/doc/faq.html +++ /dev/null @@ -1,180 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html> -<head> -<title>HandBrake FAQ</title> -<style type="text/css"> -body,p,th,td { font-family: Verdana,Arial,Helvetica,sans-serif; - font-size: 8pt; - font-weight: normal; - color: #000000; } -body { margin-left: 10; - margin-top: 10; - margin-right: 10; - margin-bottom: 10; - background-color: #FFFFFF; } -a { color: #000000; - text-decoration: underline; } -a:hover { color: #888888; } -</style> -</head> -<body bgcolor="#ffffff"> - -<p> -Last updated: 2004/03/01 19:09:38<br> -The latest version of this FAQ can be found <a -href="http://handbrake.m0k.org/faq.php">here</a>. -</p> - -<h2>HandBrake FAQ</h2> - -<h4>1. Troubleshooting</h4> -<p><a href="#A001001">1.1. Encoding seemed to work fine, but I don't -get any sound</a></p> -<p><a href="#A001002">1.2. Not every title of the DVD shows up in -HandBrake</a></p> -<p><a href="#A001003">1.3. Rip exits after a while with a AC3 error. -What does that mean?</a></p> -<p><a href="#A001004">1.4. Why does HandBrake get stucked at -100%?</a></p> - -<h4>2. Features</h4> -<p><a href="#A002001">2.1 I want to convert a movie so I can burn it on -a VCD or a DVD-R. Is HandBrake the right application to do this?</a></p> -<p><a href="#A002002">2.2. I want to to convert a movie so I can edit it -in iMovie. Is HandBrake the right application to do this?</a></p> -<p><a href="#A002003">2.3. I wish HandBrake could support subtitles, rip -a 30 seconds sample, [...]</a></p> -<p><a href="#A002004">2.4. Any plan to include 3ivx / DivX 5 -encoding?</a></p> - -<h4>3. Technical</h4> -<p><a href="#A003001">3.1 What's the difference between Ffmpeg and -XviD?</a></p> -<p><a href="#A003002">3.2 What is 2-pass encoding?</a></p> - -<h4>4. Misc</h4> -<p><a href="#A004001">4.1. How do I donate for HandBrake?</a></p> -<p><a href="#A004002">4.2. Where do this stupid name / icon come -from?</a></p> - -<hr> - -<h3>1. Troubleshooting</h3> - -<a name="A001001"></a> -<h4>1.1 Encoding seemed to work fine, but I don't get any sound</h4> -<p>I guess you are trying to read an AVI file with OS X -/ Quicktime. Try installing the latest DivX codec from -<a href="http://www.divx.com/divx/mac/">DivX.com</a>, -or use <a href="http://videolan.org/vlc/">VLC</a>.</p> - -<a name="A001002"></a> -<h4>1.2. Not every title of the DVD shows up in HandBrake</h4> -<p>There are 3 reasons why HandBrake might not show a title: it is a -menu, it has no audio track HandBrake can handle (only AC3 is supported) -or there was a problem when trying to decode data from it (e.g. a -decryption problem). There is no way to workaround this, these titles -don't show up just because you can't rip them. You might check HandBrake -logs in a terminal to know what's happening on your particular DVD.</p> - -<a name="A001003"></a> -<h4>1.3. Rip exits after a while with a AC3 error. What does that -mean?</h4> -<p>It means HandBrake had to deal with corrupted data. It usually -happens when your DVD drive is over-heating after a X-hours long rip. -Though it is handy to directly rip from the DVD, I recommend that you -copy it first to the hard drive whenever possible (for example with -OSEx, using the "DVD Folders" fmt) then you can open the folder with -HandBrake. You have to keep the DVD folder organization (multiple VOB -and IFO files), HandBrake won't open single VOB files.</p> - -<a name="A001004"></a> -<h4>1.4. Why does HandBrake get stucked at 100%?</h4> -<p>When ripping to an mp4 file, HandBrake (actually libmp4v2) optimizes -the file and makes it compliant at the end of the rip. This might take -some time with big files. Also, make sure you have enough space -available on your hard drive before you start (twice the asked size) or -you might end with an unreadable file.</p> - -<h3>2. Features</h3> - -<a name="A002001"></a> -<h4>2.1 I want to convert a movie so I can burn it on a VCD or a DVD-R. -Is HandBrake the right application to do this?</h4> -<p>No. HandBrake only outputs MPEG-4, no MPEG-1 or MPEG-2. If you are -using OS X, have a look at <a -href="http://www.versiontracker.com/dyn/moreinfo/macosx/18193"> -forty-two</a>, <a -href="http://www.versiontracker.com/dyn/moreinfo/macosx/15473"> -ffmpegX</a>, <a -href="http://www.versiontracker.com/dyn/moreinfo/macosx/20778"> -DVDRemaster</a> or <a -href="http://www.versiontracker.com/dyn/moreinfo/macosx/19238"> -DVD2oneX</a>. This will save you time and quality.</p> - -<a name="A002002"></a> -<h4>2.2 I want to to convert a movie so I can edit it in iMovie. Is -HandBrake the right application to do this?</h4> -<p>No. MPEG-4 isn't a good format for editing, you'd better find a way -to extract it as MJPEG or something, or edit the MPEG-2 directly.</p> - -<a name="A002003"></a> -<h4>2.3. I wish HandBrake could support subtitles, rip a 30 seconds -sample, [...]</h4> -<p>Check the <a href="http://handbrake.m0k.org/TODO">TODO</a> list to -see what's on the roadmap. If you wish to see a feature which isn't -already in it, mail me and, if I think I can do it someday, I'll add -it to the list.</p> - -<a name="A002004"></a> -<h4>2.4 Any plan to include 3ivx / DivX 5 encoding?</h4> -<p>No. 3ivx/DivX aren't free software and have no multi-platform -API.</p> - -<h3>3. Technical</h3> - -<a name="A003001"></a> -<h4>3.1 What's the difference between Ffmpeg and XviD?</h4> -<p>Both are MPEG-4 compliant encoders, so you may choose whichever you -want. However, I would recommend Ffmpeg as it is pretty faster on BeOS -and OS X.</p> - -<a name="A003002"></a> -<h4>3.2 What is 2-pass encoding?</h4> -<p>It performs a slower but better compression - basically it makes -sure you'll get a constant quality so you won't see blocks in fast -motion scenes. Though it's disabled by default, I would strongly -recommend to use it except if you really care about time.</p> - -<h3>4. Misc</h3> - -<a name="A004001"></a> -<h4>4.1. How do I donate for HandBrake?</h4> - -<p>I'm working on HandBrake for fun, therefore I haven't set up a -paypal account or anything (and I won't). Thanks anyway to people who -wanted to give me money ;p<br> -There are still two ways to make me happy:</p> -<ul> -<li>Send me a friendly email</li> -<li>You may send me a DVD (for example, a DVD HandBrake has problems -with so I can work it out). Sending a DVD through the world isn't really -handy though (the cheapest way is probably to order it online in a -french store with my address for shipping), so if it's a problem, you -can just fall back on the friendly mail ;)<br> -<br> -Here's the address:<br> -Eric Petit<br> -R�sidence ECP - H211<br> -2 avenue Sully Prudhomme<br> -92290 Chatenay Malabry<br> -France<br> -</li> -</ul> - -<a name="A004002"></a> -<h4>4.2 Where do this stupid name / icon come from?</h4> -<p>Don't ask.</p> - -</body> -</html> diff --git a/doc/faq.txt b/doc/faq.txt index 1e0ddec16..17c4a21d3 100644 --- a/doc/faq.txt +++ b/doc/faq.txt @@ -1,4 +1,4 @@ -$Id: faq.txt,v 1.10 2004/03/01 19:09:38 titer Exp $ +$Id: faq.txt,v 1.11 2004/03/03 16:53:44 titer Exp $ <h2>HandBrake FAQ</h2> @@ -9,8 +9,7 @@ get any sound</a></p> HandBrake</a></p> <p><a href="#A001003">1.3. Rip exits after a while with a AC3 error. What does that mean?</a></p> -<p><a href="#A001004">1.4. Why does HandBrake get stucked at -100%?</a></p> +<p><a href="#A001004">1.4. Why does HandBrake get stuck at 100%?</a></p> <h4>2. Features</h4> <p><a href="#A002001">2.1 I want to convert a movie so I can burn it on @@ -29,7 +28,7 @@ XviD?</a></p> <h4>4. Misc</h4> <p><a href="#A004001">4.1. How do I donate for HandBrake?</a></p> -<p><a href="#A004002">4.2. Where do this stupid name / icon come +<p><a href="#A004002">4.2. Where does this stupid name / icon come from?</a></p> <hr> @@ -64,7 +63,7 @@ HandBrake. You have to keep the DVD folder organization (multiple VOB and IFO files), HandBrake won't open single VOB files.</p> <a name="A001004"></a> -<h4>1.4. Why does HandBrake get stucked at 100%?</h4> +<h4>1.4. Why does HandBrake get stuck at 100%?</h4> <p>When ripping to an mp4 file, HandBrake (actually libmp4v2) optimizes the file and makes it compliant at the end of the rip. This might take some time with big files. Also, make sure you have enough space @@ -148,6 +147,6 @@ France<br> </ul> <a name="A004002"></a> -<h4>4.2 Where do this stupid name / icon come from?</h4> +<h4>4.2 Where does this stupid name / icon come from?</h4> <p>Don't ask.</p> diff --git a/macosx/Controller.mm b/macosx/Controller.mm index 206c76369..1a3655d4b 100644 --- a/macosx/Controller.mm +++ b/macosx/Controller.mm @@ -1,4 +1,4 @@ -/* $Id: Controller.mm,v 1.27 2004/02/18 17:07:20 titer Exp $ +/* $Id: Controller.mm,v 1.29 2004/03/08 12:39:49 titer Exp $ This file is part of the HandBrake source code. Homepage: <http://handbrake.m0k.org/>. @@ -50,6 +50,13 @@ static void _RipDone( void * data, int result ); - (NSApplicationTerminateReply) applicationShouldTerminate: (NSApplication *) app { + if( [[fRipRipButton title] compare: _( @"Cancel" ) ] + == NSOrderedSame ) + { + [self Cancel: self]; + return NSTerminateCancel; + } + /* Clean up */ HBClose( &fHandle ); @@ -160,6 +167,13 @@ static void _RipDone( void * data, int result ); - (BOOL) windowShouldClose: (id) sender { + if( [[fRipRipButton title] compare: _( @"Cancel" ) ] + == NSOrderedSame ) + { + [self Cancel: self]; + return NO; + } + /* Stop the application when the user closes the window */ [NSApp terminate: self]; return YES; @@ -310,11 +324,8 @@ static void _RipDone( void * data, int result ); /* Resize the panel */ NSSize newSize; - /* XXX */ - newSize.width = 762 /*fPicturePanelSize.width*/ + - title->outWidthMax - 720; - newSize.height = 755 /*fPicturePanelSize.height*/ + - title->outHeightMax - 576; + newSize.width = 42 + MAX( 720, title->outWidthMax ); + newSize.height = 165 + title->outHeightMax; [fPicturePanel setContentSize: newSize]; [NSApp beginSheet: fPicturePanel modalForWindow: fWindow @@ -410,14 +421,14 @@ static void _RipDone( void * data, int result ); audio1->outBitrate = [[fRipAudBitPopUp titleOfSelectedItem] intValue]; - audio1->codec = ( !format ) ? HB_CODEC_AAC : ( ( format == 3 ) ? + audio1->outCodec = ( !format ) ? HB_CODEC_AAC : ( ( format == 3 ) ? HB_CODEC_VORBIS : HB_CODEC_MP3 );; HBListAdd( title->ripAudioList, audio1 ); if( audio2 ) { audio2->outBitrate = [[fRipAudBitPopUp titleOfSelectedItem] intValue]; - audio2->codec = ( !format ) ? HB_CODEC_AAC : ( ( format == 3 ) ? + audio2->outCodec = ( !format ) ? HB_CODEC_AAC : ( ( format == 3 ) ? HB_CODEC_VORBIS : HB_CODEC_MP3 ); HBListAdd( title->ripAudioList, audio2 ); } @@ -754,8 +765,10 @@ static void _RipDone( void * data, int result ); [fRipVideoMatrix setEnabled: YES]; [fRipTwoPassCheck setEnabled: YES]; +#if 0 /* Can't set Vorbis bitrate */ [fRipAudBitPopUp setEnabled: NO]; +#endif } else { @@ -954,6 +967,9 @@ static void _RipDone( void * data, int result ) [fRipInfoField setStringValue: @"MPEG4 encoder initialization failed"]; break; + default: + [fRipStatusField setStringValue: @"Error."]; + [fRipInfoField setStringValue: @"Unknown error"]; } } diff --git a/macosx/English.lproj/InfoPlist.strings b/macosx/English.lproj/InfoPlist.strings Binary files differindex 64540600c..8040503df 100644 --- a/macosx/English.lproj/InfoPlist.strings +++ b/macosx/English.lproj/InfoPlist.strings diff --git a/macosx/English.lproj/MainMenu.nib/info.nib b/macosx/English.lproj/MainMenu.nib/info.nib index c578cde0a..fab934582 100644 --- a/macosx/English.lproj/MainMenu.nib/info.nib +++ b/macosx/English.lproj/MainMenu.nib/info.nib @@ -9,22 +9,21 @@ <key>29</key> <string>297 654 165 44 0 0 1440 878 </string> <key>556</key> - <string>309 129 417 306 0 0 1440 878 </string> + <string>130 59 470 306 0 0 1440 878 </string> <key>583</key> <string>650 499 144 171 0 0 1440 878 </string> <key>689</key> - <string>513 258 418 610 0 0 1440 878 </string> + <string>513 258 470 610 0 0 1440 878 </string> </dict> <key>IBFramework Version</key> <string>349.0</string> <key>IBOpenObjects</key> <array> - <integer>434</integer> + <integer>29</integer> <integer>365</integer> - <integer>583</integer> + <integer>434</integer> <integer>21</integer> - <integer>689</integer> - <integer>29</integer> + <integer>583</integer> </array> <key>IBSystem Version</key> <string>7D24</string> diff --git a/macosx/English.lproj/MainMenu.nib/objects.nib b/macosx/English.lproj/MainMenu.nib/objects.nib Binary files differindex 7990b4e2c..ba5fa1e5e 100644 --- a/macosx/English.lproj/MainMenu.nib/objects.nib +++ b/macosx/English.lproj/MainMenu.nib/objects.nib diff --git a/macosx/HandBrake.xcode/project.pbxproj b/macosx/HandBrake.xcode/project.pbxproj index 1ecef4736..9c1b883bd 100644 --- a/macosx/HandBrake.xcode/project.pbxproj +++ b/macosx/HandBrake.xcode/project.pbxproj @@ -279,7 +279,7 @@ HEADER_SEARCH_PATHS = ""; LIBRARY_SEARCH_PATHS = "../core ../contrib/liba52 ../contrib/libavcodec ../contrib/libdvdcss ../contrib/libdvdplay ../contrib/libdvdread ../contrib/libfaac ../contrib/libmp3lame ../contrib/libmp4v2 ../contrib/libmpeg2 ../contrib/libogg ../contrib/libvorbis ../contrib/libx264 ../contrib/libxvidcore"; OPTIMIZATION_CFLAGS = "-O3"; - OTHER_CFLAGS = "-DHB_MACOSX"; + OTHER_CFLAGS = ""; OTHER_LDFLAGS = ""; PRODUCT_NAME = HandBrake; SECTORDER_FLAGS = ""; @@ -301,7 +301,7 @@ <key>CFBundleExecutable</key> <string>HandBrake</string> <key>CFBundleGetInfoString</key> - <string>HandBrake 0.6.0-test1+ - By Eric Petit <[email protected]></string> + <string>HandBrake 0.6.0-test3 - By Eric Petit <[email protected]></string> <key>CFBundleIconFile</key> <string>HandBrake.icns</string> <key>CFBundleIdentifier</key> @@ -313,11 +313,11 @@ <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> - <string>0.6.0-test1+</string> + <string>0.6.0-test3</string> <key>CFBundleSignature</key> <string>HB##</string> <key>CFBundleVersion</key> - <string>0.6.0-test1+</string> + <string>0.6.0-test3</string> <key>NSMainNibFile</key> <string>MainMenu</string> <key>NSPrincipalClass</key> diff --git a/macosx/PictureGLView.mm b/macosx/PictureGLView.mm index de755cba7..dbb641729 100644 --- a/macosx/PictureGLView.mm +++ b/macosx/PictureGLView.mm @@ -1,4 +1,4 @@ -/* $Id: PictureGLView.mm,v 1.4 2004/02/23 18:08:41 titer Exp $ +/* $Id: PictureGLView.mm,v 1.6 2004/03/08 12:39:49 titer Exp $ This file is part of the HandBrake source code. Homepage: <http://handbrake.m0k.org/>. @@ -49,7 +49,7 @@ uint8_t * truc; uint8_t * in = tmp; uint8_t * out = fPicture + 4 * ( fTitle->outWidthMax + 2 ) * ( fTitle->outHeightMax + 1 ); - for( int i = 0; i < fTitle->outHeightMax + 2; i++ ) + for( int i = fTitle->outHeightMax + 2; i--; ) { memcpy( out, in, 4 * ( fTitle->outWidthMax + 2 ) ); in += 4 * ( fTitle->outWidthMax + 2 ); @@ -59,14 +59,10 @@ uint8_t * truc; /* ARGB -> RGBA */ uint32_t * p = (uint32_t*) fPicture; - for( int i = 0; - i < ( fTitle->outHeightMax + 2 ) * ( fTitle->outWidthMax + 2 ); - i++ ) + for( int i = ( fTitle->outHeightMax + 2 ) * + ( fTitle->outWidthMax + 2 ); i--; ) { - *(p++) = ( ( (*p) & 0xff000000 ) >> 24 ) | - ( ( (*p) & 0x00ff0000 ) << 8 ) | - ( ( (*p) & 0x0000ff00 ) << 8 ) | - ( ( (*p) & 0x000000ff ) << 8 ); + *(p++) = ( ( (*p) & 0x00FFFFFF ) << 8 ) | 0xFF; } if( how == HB_ANIMATE_NONE ) @@ -77,7 +73,7 @@ uint8_t * truc; in = fOldPicture; out = truc; - for( int i = 0; i < fTitle->outHeightMax + 2; i++ ) + for( int i = fTitle->outHeightMax + 2; i--; ) { memcpy( out, in, ( fTitle->outWidthMax + 2 ) * 4 ); in += ( fTitle->outWidthMax + 2 ) * 4; @@ -92,7 +88,7 @@ uint8_t * truc; in = fPicture; out = truc; - for( int i = 0; i < fTitle->outHeightMax + 2; i++ ) + for( int i = fTitle->outHeightMax + 2; i--; ) { memcpy( out, in, ( fTitle->outWidthMax + 2 ) * 4 ); in += ( fTitle->outWidthMax + 2 ) * 4; @@ -113,8 +109,8 @@ uint8_t * truc; glDepthFunc( GL_LEQUAL ); glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST ); -#define ANIMATION_TIME 1000000 -#define FRAME_PER_SEC 30 +#define ANIMATION_TIME 500000 +#define FRAME_PER_SEC 50 rotation = 0.0; float w = ( how == HB_ANIMATE_LEFT ) ? 1.0 : -1.0; @@ -125,7 +121,6 @@ uint8_t * truc; date = HBGetDate(); translation = - PROUT - cos( rotation * M_PI / 180 ) * ( 1 + w * tan( rotation * M_PI / 180 ) ); - [self drawAnimation: how]; rotation += w * 90 * 1000000 / ANIMATION_TIME / FRAME_PER_SEC; @@ -134,7 +129,7 @@ uint8_t * truc; break; } - wait = ANIMATION_TIME / 90 - ( HBGetDate() - date ); + wait = 1000000 / FRAME_PER_SEC - ( HBGetDate() - date ); if( wait > 0 ) { HBSnooze( wait ); @@ -194,8 +189,11 @@ uint8_t * truc; [[self openGLContext] update]; bounds = [self bounds]; - glViewport( 0, 0, (GLsizei) bounds.size.width, - (GLsizei) bounds.size.height ); + if( fTitle ) + { + glViewport( 0, 0, fTitle->outWidthMax + 2, + fTitle->outHeightMax + 2 ); + } } - (void) drawAnimation: (int) how diff --git a/macosx/i18n/nl.strings b/macosx/i18n/nl.strings Binary files differnew file mode 100644 index 000000000..71ad84e66 --- /dev/null +++ b/macosx/i18n/nl.strings diff --git a/test/test.c b/test/test.c index 1a693fde7..8dc6732b3 100644 --- a/test/test.c +++ b/test/test.c @@ -1,4 +1,4 @@ -/* $Id: test.c,v 1.26 2004/01/22 19:36:55 titer Exp $ +/* $Id: test.c,v 1.27 2004/03/08 11:32:50 titer Exp $ This file is part of the HandBrake source code. Homepage: <http://handbrake.m0k.org/>. @@ -450,7 +450,7 @@ static void ScanDone( void * data, HBList * titleList ) { audio = HBListItemAt( title->audioList, 0 ); audio->outBitrate = abitrate; - audio->codec = acodec; + audio->outCodec = acodec; HBListAdd( title->ripAudioList, audio ); } else if( strcasecmp( audios, "none" ) ) @@ -471,7 +471,7 @@ static void ScanDone( void * data, HBList * titleList ) i = strtol( tmp, &tmp, 0 ); audio = HBListItemAt( title->audioList, i - 1 ); audio->outBitrate = abitrate; - audio->codec = acodec; + audio->outCodec = acodec; HBListAdd( title->ripAudioList, audio ); tmp++; |