summaryrefslogtreecommitdiffstats
path: root/libhb
Commit message (Collapse)AuthorAgeFilesLines
* reduce mux interleave threshold more to prevent out of memory situationsjstebbins2010-03-191-1/+1
| | | | | | | | | | when skewed timestamps or premature end of a stream is encountered, the muxer buffers streams in an attempt to interleave stream timestamps. this threshold tells it when to give up. The previous value still allowed out of memory conditions with windows 2GB per application limit. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3169 b64f7644-9d1e-0410-96f1-a4d463321fa5
* improve lame audio quality by using ABR mode and disabling joint stereo modejstebbins2010-03-142-2/+38
| | | | | | | add mp3 muxing into mp4 container. cli and gtk gui now support this. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3167 b64f7644-9d1e-0410-96f1-a4d463321fa5
* extend search range for TS re-syncjstebbins2010-03-131-14/+24
| | | | | | | | we were only checking approx the next 16K bytes when sync was lost in a transport stream. now we will continues searching to the end of the file. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3165 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix a crash that happens when subtitle scan selects a subtitle thatjstebbins2010-03-071-0/+1
| | | | | | | is alread in the list of subtitles to encode. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3154 b64f7644-9d1e-0410-96f1-a4d463321fa5
* temporary hack to use old x264 b-pyramid default of 0 (none)jstebbins2010-03-051-0/+3
| | | | | | | | this will be reverted when the gui's and presets are updated to reflect the new default of 2 (normal). git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3150 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix incorrect comment in PS detection functionjstebbins2010-02-121-3/+2
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3119 b64f7644-9d1e-0410-96f1-a4d463321fa5
* try harder to identify program streams that do not begin with a pack headerjstebbins2010-02-121-8/+22
| | | | | | | | search deeper into the file for a pack header followed by another start code prefix. Fixes problem with file cut by StreamClip on non-pack header boundary git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3118 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Adjustable picture modulus: Base patch by BradleyS, Thanks BradleyS!dynaflash2010-02-114-32/+34
| | | | | | | - Enables setting modulus for all anamorphic modes (including non-anamorphic) except strict. The job variable "anamorphic.modulus" is repurposed for this and is renamed to simply "modulus" - Other changes: Increases minimum output dimensions to 32x32 pixels in libhb (prevents possible crashes, notably in macgui). Better crop value and maximum crop value calculations to prevent crashes. Some code optimization / refactoring. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3113 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix compiler warning about "definition has no type or storage class"jstebbins2010-02-101-1/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3108 b64f7644-9d1e-0410-96f1-a4d463321fa5
* put a limit on how many buffers the muxer will cache when it isjstebbins2010-02-091-4/+11
| | | | | | | | | | | having trouble interleaving timestamps This prevents some out of memory crashes. In particular, it fixes a crashed caused by a source in which the audio stream ends substantially before the video stream ends. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3106 b64f7644-9d1e-0410-96f1-a4d463321fa5
* removed test codesr552010-02-062-8/+0
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3102 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb dll fix by RandomEngysr552010-02-062-0/+19
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3101 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix keyint mismatch between 1st and 2nd passes of a 2pass encodejstebbins2010-02-061-10/+5
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3100 b64f7644-9d1e-0410-96f1-a4d463321fa5
* dvdnav: fix seeking on some dvds that use multiple pgc's in a titlejstebbins2010-02-061-2/+7
| | | | | | | | The code that was in place to handle this did not allow for the possibility that there could be sector gaps between the segments git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3098 b64f7644-9d1e-0410-96f1-a4d463321fa5
* use DTS generated by x264 when computing duration and offset in muxmp4jstebbins2010-02-065-117/+101
| | | | | | | | also fix an issue where ffmpeg generated negative PTS for initial frames of video. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3097 b64f7644-9d1e-0410-96f1-a4d463321fa5
* osx doesn't have fread_unlockedjstebbins2010-01-311-1/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3090 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix problem with reading program streamsjstebbins2010-01-311-1/+33
| | | | | | | | audio PES packets can have sequences that look like start codes in the data so parse PES enough to get the length and skip the data. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3089 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix cancel during p-to-p searchjstebbins2010-01-201-0/+5
| | | | | | | | | when canceling, video sync was closed, but audio sync was stuck waiting on a condition variable. so force audio sync to wake up when video sync closes. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3078 b64f7644-9d1e-0410-96f1-a4d463321fa5
* prevent hang during foreign audio searchjstebbins2010-01-101-4/+5
| | | | | | | was waiting for an audio pts during the indepth scan when there is no audio being processed git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3065 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Added some errors checks and a flush function to encode the remaining data ↵ritsuka2009-12-311-14/+72
| | | | | | | | in the fifo. It may fix the "0.5 seconds of digital noise" issue, but I was unable to reproduce it, so I don't know if it actually helps. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3053 b64f7644-9d1e-0410-96f1-a4d463321fa5
* add point-to-point encodingjstebbins2009-12-238-37/+449
| | | | | | | | | | | | | | allows frame and pts based start points. end points were already previously supported. New job variables pts_to_start and frame_to_start specify the start point. There can be a period during the encode where it has to search for the start point. During this period, libhb sets a new state HB_STATE_SEARCHING and sets progress and eta till start point found. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3039 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Adds a very crude, CLI-only rotation filter to flip pixels vertically (mode ↵jbrjake2009-12-193-1/+390
| | | | | | 1), horizontally (mode 2), or both (mode 3, default). Called with --rotate. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3036 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix potential runaway buffer usagejstebbins2009-12-154-3/+40
| | | | | | | | | | pthread_cond_timedwait can wake early. under certain system load conditions, this happens often. I was going ahead and adding buffers whenever it woke, regardless of whether the condition had actually been met. so the fifo depth would increase until memory ran out. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3030 b64f7644-9d1e-0410-96f1-a4d463321fa5
* bump ffmpeg to svn 20817jstebbins2009-12-141-0/+4
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3028 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix crash with vobsub passthrujstebbins2009-12-131-1/+3
| | | | | | | | the last subtitle buffer was getting added to the buffer pool twice and ultimately freed twice. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3027 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Only display mux stats oncejstebbins2009-12-101-42/+42
| | | | | | | | Close prints mux stats and gets called for each stream. So only print the stats when the last stream is closed. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3023 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix dvdnav read error retry jstebbins2009-12-101-1/+1
| | | | | | | | | the error count was being reset on dvdnav events that didn't involve any actual reading. So we got caught in an very long loop alternating between read failures and valid events. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3022 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Avert a rare race condition.jstebbins2009-12-091-5/+6
| | | | | | | | | | | | | | | | | A bad source can cause reader to call hb_stream_close before decavcodecviWork ever starts. This causes hb_ffmpeg_context to access an invalid pointer. So move the call to hb_ffmpeg_context to after we check for a 0 length buffer in decavcodecvoiWork since reader will have sent this to signal that it has reached the end of the stream. This does not eliminate the race condition, but it does make it much less likely to happen and fixes the specific case where we found this occuring. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3020 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Disables chapter markers when there is only one chapter. Most interfaces ↵jbrjake2009-12-091-0/+6
| | | | | | already do this, but now they have no choice. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3019 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Removes obsolete check for mbtree being off before adjusting render offsets ↵jbrjake2009-12-091-3/+3
| | | | | | for b-pyramid. Also corrects a bit of coding style. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3018 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix buffer leak during indepth scan jstebbins2009-12-083-0/+23
| | | | | | | and fix a couple potential leaks if the timing is just right in work loops git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3016 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Faster combing detection through slightly less stupid use of pointers. Also ↵jbrjake2009-12-081-68/+61
| | | | | | realigns boundary points for the combing mask checker to match what the code actually does. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3015 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Use the correct render offset when b-pyramid is enabled in the x264 ↵jbrjake2009-12-081-39/+24
| | | | | | parameter string but is being disabled inside libx264 due to mb-tree. Thanks, Rodeo, and good catch! Also adds a logging message to note weight-p being disabled in bframeless encodes. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3013 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix detection of forced subtitles during foreign audio searchjstebbins2009-12-071-1/+1
| | | | | | | | | | reader drops all buffers till it finds video or audio. but since video and audio fifos are null when indepth_scan is set, we never see video or audio. Solution is to not drop buffers in indepth scan mode git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3011 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix a double free of an hb_buffer in syncjstebbins2009-12-061-1/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3010 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Reduce the amount of buffering used and eliminate hb_snooze in the encoding ↵jstebbins2009-12-0511-1049/+1396
| | | | | | | | | | | | | | | | | | | | | | pipeline For HD sources on an 8 core system with hyperthreading, we were using 1.5GB of ram. Add to that the 600MB x264 uses for rc-lookahead, pushes it north of 2GB. To reduce our memory usage, the fifo depths have been reduced are are no longer a multiple of cpu count. Use of hb_snooze has been eliminated in the encoding pipeline so that performance doesn't fall as a result of the reduced fifo depths. In sync, each audio and video were given separate threads so that each can wait on it's respective input fifo without blocking the others. In muxcommon, each stream being muxed was given a separate thread so that each can wait on it's respective fifo. This allows the removal of hb_snooze in the sync and muxer work loops. In both sync and muxer, there is common data that is shared by all threads, so special init routines allocate this shared data and initialize the threads. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3007 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Fix audio sync problem for AAC (or any other mpeg PS or TS audio decoded by ↵van2009-11-261-66/+31
| | | | | | decavcodec) with a sample rate other than 48KHz. This problem had already been fixed for decavcodecai (the 'internal' ffmpeg audio decoder that handles all input files but mpeg streams) so decavcodec was just changed to use the same logic. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2985 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix title index issue in batch scanningjstebbins2009-11-252-4/+6
| | | | | | | | | title index was assigned as the nth file in the directory, but files that are not video would cause title indexes to be skipped in job.list_title this would mess up the progress bar. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2982 b64f7644-9d1e-0410-96f1-a4d463321fa5
* batch file scanning and scan canceljstebbins2009-11-2514-31/+310
| | | | | | | | | | When a directory is specified as the source, first we attempt to open as a dvd, then if that fails, we attempt to open each file in the directory as a stream source. Since opening a large directory of files can take a really long time, you can also now cancel a scan. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2980 b64f7644-9d1e-0410-96f1-a4d463321fa5
* don't read the entire file looking for audio in transport streamsjstebbins2009-11-251-1/+1
| | | | | | | | if the PMT indicates there is no audio we do not need to continue searching. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2972 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Rate limit hb_error() messages to at most 1 message per second of the same ↵eddyg2009-11-242-4/+77
| | | | | | | | | | | | message. Repeats will be counted and presented as a count when 1 second has elapsed since the first error of a sequence, or an error message with a different string. Also modified dvdnav to use hb_error() to take advantage of the limiting. This works around a real bug from dvdnav where the Mac GUI becomes unresponsive during the output of large numbers of errors. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2971 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Fixes a missing and misplace option in decomb's comments and in-line CLI ↵jbrjake2009-11-231-1/+1
| | | | | | help. Thanks, Rodeo\! git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2956 b64f7644-9d1e-0410-96f1-a4d463321fa5
* add some input error resiliency to the srt parser.jstebbins2009-11-161-79/+140
| | | | | | | | | | | an extra blank line between entries threw everything off for the entire remainder of the file. added additional logic for processing blank lines added detection of bad timestamps and resynchronization when bad git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2939 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix lockup in reader when importing srt'sjstebbins2009-11-131-0/+1
| | | | | | | | | | | | The subitle id for srt's was not being set. This caused the reader to mistakenly select the subtitle's fifo when processing audio data and stuff audio into it, filling it very rapidly. Sync would not remove items from the subtitle fifo because the corresponding video timestamp hadn't arrived yet. And since reader was waiting on a full subtitle fifo, no more video would ever arive at sync. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2926 b64f7644-9d1e-0410-96f1-a4d463321fa5
* update x264 to r1332jstebbins2009-11-111-2/+2
| | | | | | | Default weightp to none for baseline. user can override. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2922 b64f7644-9d1e-0410-96f1-a4d463321fa5
* don't drop the last SRT subtitlejstebbins2009-11-101-0/+63
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2921 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix an off-by-one error in assignment of audio stream registration descriptorjstebbins2009-11-091-26/+28
| | | | | | | | | | | | | | format. This sometimes caused the misdetection of TrueHD audio since it would be tagged as the format of the stream following it in the PMT. Also fix a problem in PMT parsing that I stumbled upon while investigating the above problem. If a PMT has a PID listed more than once for some reason, we would add that PID multiple times to our stream list. And if it happened to be a video PID that is duplicated, the duplications would be interpreted as audio PIDs. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2920 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Maintain an accurate job ETA across pause/resumejstebbins2009-11-073-1/+15
| | | | | | | | Keeps track of how much time is spent paused and factors that into the ETA calculation git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2918 b64f7644-9d1e-0410-96f1-a4d463321fa5
* possible fix for WDTV vobsub duration problemjstebbins2009-11-052-14/+4
| | | | | | | | | | | There were 2 problems 1. The duration was not being written to the mkv track. Other players use the timestamps in the vobsub. WDTV appears to use the duration in the mkv. 2. The vobsub timestamps were being rewritten improperly in sync.c. They don't need to be rewritten at all. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2917 b64f7644-9d1e-0410-96f1-a4d463321fa5
* temporary fix for x264 b-pyramid parameter changejstebbins2009-10-311-0/+8
| | | | | | | | if value is "1", set to "normal", "0" set to "none" pass other values through. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2907 b64f7644-9d1e-0410-96f1-a4d463321fa5