summaryrefslogtreecommitdiffstats
path: root/libhb/reader.c
Commit message (Collapse)AuthorAgeFilesLines
* - cleanup gcc format warnings showing up on linux 64-bitkonablend2009-06-251-1/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2619 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: fix forced foreign language scan issuesjstebbins2009-06-131-1/+3
| | | | | | | | | | | | | | | - subtitles were not being added to list of subs to scan because the wrong config was being checked for the forced flag. needed to use job->select_subtitle_config instead of subtitle->config - scr code in reader was preventing the majority of subtitle packets from reaching decvobsub. made decvobsub more robust by adding ability to re-sync in the event of lost packets. made scr recovery initialize itself even in the event that it sees audio or subtitles before seeing video. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2526 b64f7644-9d1e-0410-96f1-a4d463321fa5
* softsubs: allow 1 source to many output subs by duplicating thejstebbins2009-06-031-6/+11
| | | | | | | subtitle buffer where necessary git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2475 b64f7644-9d1e-0410-96f1-a4d463321fa5
* softsubtitles:jstebbins2009-06-021-1/+1
| | | | | | | | | | | | | | | | | | - when doing an indepth scan, do not scan CC tracks - separate subtitle configureation attributes into separate hb_subtitle_config_t. Add an instance of this to hb_job_t for setting the attributes of the subtitle found through an indepth scan - Add a default_track flag to hb_subtitle_config_t that tells the muxer that the track should be flaged as the default. muxmkv uses this. - When an indepth scan is complete, check to see if the autoselected subtitle matchces (by id) one of the manually selected subtitles. If a match is found, the autoselected subtitle with all the attributes the user assigned to it replaces the manually selected subtitle. - LinGui: Add "Default" column to subtitle tab. This is a radio that lets the user choose which subtitle should be displayed by default. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2468 b64f7644-9d1e-0410-96f1-a4d463321fa5
* mkv soft subtitle supportjstebbins2009-05-191-1/+1
| | | | | | | | | | | | | - new libmkv 0.6.4 with subtitle track support - muxmkv supports vobsub and closed caption subtitles - added subtitle format, source, and dest initialization to dvdnav - moved subtitle_force flag into hb_subtitle_t struct as it needs to be settable per subtitle - gtk ui added subtitle tab which allows selection of multiple subtitles - reorgainize subtitle sync code to prevent dropping of subtitles when multiple subtitles are enabled git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2428 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Removed double EOF for CC's (one from dvd and one from cc), fixed compiler ↵eddyg2009-05-061-1/+1
| | | | | | warnings for CC. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2394 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Push an EOF onto the subtitle fifos from the reader for DVD VOBSUBs and also ↵eddyg2009-05-061-0/+7
| | | | | | from cc608 for closed captions git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2388 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Stage 1 Soft Subtitle Support - Allow multiple subtitle tracks to be ↵eddyg2009-05-041-26/+13
| | | | | | selected, and mark them for Render or Pass Through. No functional difference from the UIs, however in theory they could render multiple tracks - would be a dogs breakfast on screen though, and is untested. Have tested all normal operations from the UIs, including scanning. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2373 b64f7644-9d1e-0410-96f1-a4d463321fa5
* dvdnav: improve title scanningjstebbins2009-05-011-1/+1
| | | | | | | | | | | - looks for ptt with longest pgc sequence instead of just picking first ptt solves many 'short title' problems - constructs chapters from the pg's within the pgc's instead of using ptt's solve the problem of ptt's that point to an intro pgc instead of to the actual chapter position in the title. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2361 b64f7644-9d1e-0410-96f1-a4d463321fa5
* add libdvdnav supportjstebbins2009-04-271-0/+4
| | | | | | | | | | | emulates the vm of a dvd player in order to navigate the disc more reliably it is optional and disabled by default CLI option '--dvdnav' enables. GUI's have a new option in preferences. When dvdnav is enabled, you can also select angles (cli '--angle') git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2355 b64f7644-9d1e-0410-96f1-a4d463321fa5
* This patch adds mingw32 cross-compilation support to HandBrake trunk tokonablend2009-04-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | produce native win32 binaries. The main benefits are the binary does not have any Cygwin runtime requirements and various host platforms can be leveraged to build HandBrake. Cross-compilation toolchains are complex to setup and recommended for experts only; but once setup it can build at speeds similar to native builds, on Darwin or Linux. BUILD INSTRUCTIONS: Add mingw32 toolchain to beginning of your path and take the toolchain prefix from gcc (eg: i386-mingw32-gcc) and pass to configure: ./configure --cross=i386-ming32 PRODUCTS: - hb.lib (static library) - HandBrakeCLI.exe DOWNLOADS: Contrib downloads need to be seeded with: - pthreads-w32-2-8-0-release.tar.gz (new) - xvidcore-20090311.tar.gz SUMMARY: Specifically, all GUI trees are not impacted. configure - added --cross=PREFIX - reworked search for gcc and cross-compile related tools to use prefix contrib/ - sub-patches added as needed for mingw contrib/xvidcore/ - bumped from 1.1.3 -> 1.2.1+ (daily 20090311) - reconstituted P01-cygwin.patch - created new P00-darwin.patch needed for macho64 asm flag on x86_64 arch libhb/ - uint -> uint32_t - remaining changes guarded by mingw32 macro. test/ - modified to support pthread-compatibility library attach/detach. - all changes guarded by mingw32 macro. BRANCHES: source: https://hbfork.googlecode.com/svn/branches/mingw@28 target: svn://svn.handbrake.fr/HandBrake/trunk@2325 git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2326 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Don't resync based on subtitles since their average duration is meaningless.van2009-01-151-12/+43
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2087 b64f7644-9d1e-0410-96f1-a4d463321fa5
* More code to deal with the flakey streams from NZ TV. They like to change ↵van2008-12-051-1/+0
| | | | | | the PCR without sending a new PCR and we get big timestamp changes but no new reference clock. So now we look at the PTS and if its change is outside a tolerance window we use the new PTS as a PCR & declare a clock discontinuity. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2008 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Add metadata support to libhb, add importing of MP4 metadata, add export of ↵eddyg2008-12-021-2/+24
| | | | | | MP4 metadata, add importing of MP4 chapters, add seek to chapter for input files, add new libmp4v2, remove old MP4 chapter muxing - now in libmp4v2. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1987 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Adds two new parameters to hb_scan, to control the number of preview frames ↵jbrjake2008-11-301-2/+5
| | | | | | | | generated during scan, and whether or not they're written to disk for later display. This will break any interfaces that use hb_scan until the new params are specified...sorry. Also adds a new job->seek_points setting (set this to the same as the number of previews) to be used with job->start_at_preview when doing live preview encodes, so the seek function has a frame of reference. Wires up the CLI with a --previews option (long option only) to control the new scan parameters, and defaults the CLI to not writing previews to disk. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1970 b64f7644-9d1e-0410-96f1-a4d463321fa5
* - add John A. Stebbins' changes to handle TrueHD and DTS-HD multiplexed ↵van2008-11-251-8/+1
| | | | | | | | | | streams. - give transport streams their own demuxer rather than constructing fake PS packets to use the DVD demuxer. - start re-doing the transport stream code so it does fewer memory to memory copies. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1953 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb support for live previewjstebbins2008-11-111-24/+45
| | | | | | | | set job->start_at_preview to the preview frame you want to start at set job->pts_to_stop to the number of 90khz ticks duration git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1915 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Try to drive the stream timing off the audio stream(s) since audio has a pts ↵van2008-10-051-4/+24
| | | | | | on every frame while video typically has one on <10% of the frames. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1813 b64f7644-9d1e-0410-96f1-a4d463321fa5
* - Only do 'lost PCR' checks (r1712) when we're dealing with something that ↵van2008-10-031-0/+5
| | | | | | | | | could be an over-the-air transport stream. We can't lose the clock of a program stream and shouldn't have losses on an m2ts stream. - Widen the DTS-to-PCR acceptance window from +-5sec to +-5min since there's nothing in the standard that bounds the offset between a DTS and its clock reference. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1802 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Another bug fix in the per-stream timing code: If the clock reference ↵van2008-09-161-7/+29
| | | | | | changes on the first buffer of a stream we haven't seen before we don't have the history we need to compute a clock offset & need to wait for a stream we've been tracking. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1704 b64f7644-9d1e-0410-96f1-a4d463321fa5
* The difference of two timestamps referenced to different clocks is a random ↵van2008-09-151-5/+7
| | | | | | number & not useful input to the average frame size computation. This major brain-o would occasionally cause huge average frame times which, when later used to compute the SCR correction, would result in large gaps in the audio and/or video streams. Fixed by always computing the average frame size from the scr-corrected timestamps. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1698 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Various fixes for ffmpeg input files (mp4, avi, mkv, etc.):van2008-09-111-14/+15
| | | | | | | | | | - always use source time stamps (HB vfr mpeg4 files now handled correctly) - handle Microsoft's braindead "VFW packed b-frames" - compute average video frame rate from total duration & number of frames (ignore ffmpeg's frame rate which is closer to a max f.r. for vfr video). - workaround an ffmpeg audio decode abort when it used SSE instructions on unaligned buffers. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1687 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix subtitle indepth scan abort & hang.van2008-08-191-1/+2
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1645 b64f7644-9d1e-0410-96f1-a4d463321fa5
* - in encx264, if an video frame is larger than init_delay split it into ↵van2008-07-261-3/+11
| | | | | | | | | | | | pieces so we don't get jerky output caused by out-of-order frames. - add an explicit EOF for all streams, not just video. - don't generate extra audio silence at the end of an encode (don't need it with explicit eof). - get rid of 80ms initial delay in AAC encode & flush final four frames buffered in encoder. - put mp4 'chap' atom on first track (usually video) rather than first audio track since we can now do video without audio (atom just needs to go on an enabled media track & video is always enabled). git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1581 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Get rid of excessive video & audio drops on some content by implementing the ↵van2008-07-161-30/+114
| | | | | | | | | last 20% of the MPEG Standard Target Decoder timing model (per-stream timing state). Should fix the problem reported in http://forum.handbrake.fr/viewtopic.php?f=12&t=6601&sid=81048cf54c40b6cdb945236afb4f99da&p=37563#p37563 git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1570 b64f7644-9d1e-0410-96f1-a4d463321fa5
* - fix an error in the SCR calculation that would cause an extra frame to be ↵van2008-06-301-1/+16
| | | | | | | | | | dropped at an SCR discontinuity. - fix a rounding error in the encx264 init_delay computation that would underestimate the delay for progressive content and cause spurious "init_delay too small" messages. - clean up the sync.c "video time didn't advance" logic and try to make the error mgs more useful for debugging frame duration problems. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1543 b64f7644-9d1e-0410-96f1-a4d463321fa5
* - support blu-ray, avchd & dvb x264van2008-05-311-30/+36
| | | | | | | - support video files handled by ffmpeg (avi, mkv, mp4, etc.) git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1480 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Move clock recovery code from reader to demuxmpeg so it sees all frames & ↵van2008-04-151-52/+9
| | | | | | not just the ones we happen to be encoding. This change gives a more accurate clock and allows us to once again ignore audio during pass 1 of a 2 pass encode. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1420 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Saearch & Replace domain names to move from .m0k.org to handbrake.fr. Only ↵jbrjake2008-04-151-1/+1
| | | | | | covers trunk files, libhb, and test. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1418 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Fixes for different number of frames between pass 1 & 2, missing frames at ↵van2008-04-131-0/+3
| | | | | | | | | | | | end, and an deadlock with pcm audio. - since the SCR clock recovery is done in reader.c we can't currently skip audio frames during pass 1 or we miss clock changes signaled by those frames & end up dropping more video frames in pass 1 than pass 2. - since many modules buffer frames we can't tell if we're done just by looking for empty fifos. Send an empty buffer to mark end-of-stream all the way along the processing pipeline & use it to flush internally buffered data. - in a processing pipeline you're done when the end of the pipe says your done. add a thread status variable so we can tell when individual threads are finished then make do_job wait until the encoder thread is done so that we're sure all the frames have been processed and sent to the muxer. - since the muxer alternates between reading video & audio packets we have to have enough buffer in the audio pipeline to handle a video-frame's worth of audio packets (33ms). Since pcm packets are <1ms we need >60 slots in the audio fifos or we'll deadlock. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1412 b64f7644-9d1e-0410-96f1-a4d463321fa5
* New internal audio handling.saintdev2008-04-011-1/+1
| | | | | | | | Each audio track contains it's own settings for codec, bitrate, samplerate, etc. This allows for very complex combinations of audio tracks if desired. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1365 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Fix two of my stupid bugs that prevented using the queue with transport streams:van2008-03-201-2/+2
| | | | | | | | - keep a cache of the pid/substream id mappings from each scan rather than assuming an encode will immediately follow a scan (there will be lots of scans followed by lots of encodes when the queue is used). - rewrite a few things to get rid of static variables. hb_ts_stream_decode is called by both scan & reader and they're in different threads. All the working storage & state has to either be in the stream struct or on the stack so it's private to the calling thread or it gets corrupted when doing a scan in the middle of an encode. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1351 b64f7644-9d1e-0410-96f1-a4d463321fa5
* - Add mpeg2 "Standard Target Decoder" clock recovery to the low level mpeg ↵van2008-03-151-2/+71
| | | | | | | | | | stream reader so we don't have to guess about the clock in sync. - Since sync now has a fairly reliable clock, make it just trim excess audio or video and fill holes so that we maintain cross media sync. - Redo the TS-to-PS transmuxing code to work on smaller units so that we can reliably convert the TS clock (PCR) to a PS clock (SCR). git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1341 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Formatting: Remove a lot of trailing whitespace.saintdev2008-02-211-14/+14
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1307 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Allow multiple output audio tracks from a single DVD audio track.eddyg2008-02-151-16/+51
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1266 b64f7644-9d1e-0410-96f1-a4d463321fa5
* MPEG-2 stream reading fixes for missing audio, multiple audio tracks, ↵jbrjake2007-12-131-8/+0
| | | | | | language codes, reading streams larger than 2GB, and incorrect title numbers. This vastly expands HandBrake's TS/PS compatibility. Thanks, van! git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1123 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Fix to the chapter merging to ensure that when reading from the media we ↵eddyg2007-10-091-4/+24
| | | | | | take into account chapters that we have merged. This prevents premature exiting from encoding. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1012 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Don't drop subtitles when crossing PTS discontinuities by using buffer ↵eddyg2007-10-081-0/+4
| | | | | | sequence numbers to determine where in the stream the buffer came from. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1011 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Added buffer management and changed fifo sizes. Changed job->subtitle_scan ↵eddyg2007-09-111-11/+17
| | | | | | to job->indepth_scan, and fixed memory init bug in denoise.c. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@945 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Added progress marking for when doing the subtitle scaneddyg2007-08-301-0/+22
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@901 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Add Subtitle scanning for forced subtitles and normal subtitles from the CLIeddyg2007-08-211-2/+18
| | | | | | | and the MacOS GUI. See the new subtitle language options in the GUI. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@844 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Implement transport and program stream support. With these changes it's now ↵awk2007-07-041-12/+49
| | | | | | possible to open a .ts or .mpg files and transcode to standard Handbrake Output files. This fixes Ticket #21. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@648 b64f7644-9d1e-0410-96f1-a4d463321fa5
* A big batch of patches from eddyg.jbrjake2007-06-061-5/+19
| | | | | | | | | | | | | Adds following options to the CLI: --subtitle-scan for auto-selecting subtitles for foreign language segments in native language audio tracks --native-language for auto-selecting subtitles for foreign language audio without knowing the track number --longest for auto-selecting the longest title like in the MacGui --turbo for improving speed on the first pass of a two pass encode with x264 (based on superdump's turbo x264 options in mencoder). Thanks, eddyg! git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@600 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Fix about 156,199 bytes of leaked memory.saintdev2007-03-311-0/+2
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@469 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Merge the 5.1 branch into the trunk.prigaux2007-03-061-0/+156
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@422 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Merge the 0.8.0_mpeg4ip branch into the trunkprigaux2007-02-111-156/+0
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@285 b64f7644-9d1e-0410-96f1-a4d463321fa5
* added worker thread sleep throttling.johnallen2007-01-081-2/+1
| | | | | | | | | | each of the work object threads now self adjust their sleep interval based on the "fullness" of their fifo. 80% is the choose threshold. Work objects with a fifo fullness of greater than 80% increase their sleep interval. This allows other work object with less than 80% fullness more CPU usage. Also adjusted thread_func, reader, and muxer sleep intervals to more reasonable values. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@98 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Documentation begins. johnallen2007-01-071-1/+2
| | | | | | | Added method documentation for hb.c as well as a few methods in sync.c and work.c More to come. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@97 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Update 2006-01-10handbrake2006-01-141-1/+2
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@17 b64f7644-9d1e-0410-96f1-a4d463321fa5
* HandBrake 0.7.0handbrake2006-01-141-0/+155
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@16 b64f7644-9d1e-0410-96f1-a4d463321fa5