summaryrefslogtreecommitdiffstats
path: root/libhb
Commit message (Collapse)AuthorAgeFilesLines
* fix log spam during batch scan of TS filesjstebbins2011-10-111-0/+6
| | | | | | | | IDRs detected before generating previews were not being remembered. So we started decoding on non-IDR boundaries which generates a lot of decoder log spam. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4279 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Check for negative stop times in subtitlesjstebbins2011-10-071-5/+19
| | | | | | | A subtitle may not have a stop time. Set it to something reasonable when missing. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4268 b64f7644-9d1e-0410-96f1-a4d463321fa5
* CLI: x264 preset, tuning, and profile supportjstebbins2011-10-023-22/+79
| | | | | | | | New cli options --x264-preset, --x264-tune, and --x264-profile. x264 preset and tune are set first, followed by any custom x264 option string, and finally the profile is applied. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4265 b64f7644-9d1e-0410-96f1-a4d463321fa5
* handle PCR discontinuities betterjstebbins2011-09-301-39/+33
| | | | | | | | | | The PCR comparison we were doing could cause us to drop all the timestamps for an audio stream when the audio packets are very widely spaced. Now, it detects PCR changes explicitely and only drops the timestamps if a discontinuity PCR prior to the packets current PCR has already been sent to the reader. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4263 b64f7644-9d1e-0410-96f1-a4d463321fa5
* log printable ascii with hexdumpsjstebbins2011-09-291-3/+14
| | | | | | Provides similar output to 'hexdump -C' *nix command. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4262 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix a crash in HandBrakeCLIjstebbins2011-09-271-0/+6
| | | | | | | | | | | | | When the audio tracks are omitted (no -a), the cli uses the first source audio track and replicates it for each audio output codec. The way it knows what to replicate is to look at audio->in.track for the last audio that was added to the job. This track number was being copied from the title's in.track. But title track numbers are not guaranteed to be sequential (e.g. scan drops tracks it can't decode). So when adding an audio to a job, set in.track to the value of in.track that is passed in the audio_config structure passed to hb_audio_add. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4260 b64f7644-9d1e-0410-96f1-a4d463321fa5
* add utility function for doing hexdumps to logjstebbins2011-09-272-0/+34
| | | | | | | I find myself re-writing a quick and dirty hexdump function far too often when debugging. This will save some time in the future. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4259 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Extract common mcdeint code from decomb/deintjstebbins2011-09-264-387/+285
| | | | | | | | Extracts duplicated code from decomb.c and deinterlace.c and puts it in a shared module. Fixes a bug that existed in the decomb version of mcdeint_filter. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4257 b64f7644-9d1e-0410-96f1-a4d463321fa5
* handle TS streams that have no PCRs betterjstebbins2011-09-262-15/+58
| | | | | | | | | | | | | | | | For TS streams that don't have PCRs, we substitute the DTS timestamp from the video track (or PTS if we don't see DTS). But these can bounce around or be wider spaced in the stream that PCRs are meant to be. So I have added a test to see if the timestamp looks like a discontinuity. Then I only pass the timestamp as a PCR if there appears to be a discontinuity. This prevents a lot of scr_offset thrashing. I have also fixed an error in our scr_offset processing. It is rarely triggered and it's effects are so minor with well behaved streams that it would be completely unnoticed. But with the test stream I was using, it caused a factor of 10 times more "audio went backwards" errors. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4254 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Fix for DVD's that have broken udf filenamesjstebbins2011-09-261-3/+20
| | | | | | | | | A new obfuscation technique it to add UDF-16 filenames that have junk in the high byte and things like "VIDEO_TS.IFO" in the low byte. libdvdread throws away the high byte which results in references to the bogus copy of the file. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4252 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Fix parsing of SSA layer fieldjstebbins2011-09-241-5/+33
| | | | | | | | | | | | SSA subtitles have an empty layer field (bare ','). The scanf format specifier "%*128[^,]" will not match on a bare ','. There must be at least one non ',' character in the match. So the format specifier is placed directly next to the 'Dialogue:' string so that the next expected ' ' after the ':' will be the character it matches on when there is no layer field. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4244 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix silly patch errorjstebbins2011-09-241-1/+1
| | | | | | | i let part of another patch leak in git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4243 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix framerate detection for AVCHD-Litejstebbins2011-09-243-5/+27
| | | | | | | | The AVCHD-Lite specification only supports 50 or 60 fps. So to get 25 or 30 fps, they double every frame using repeat flags. Detect this and adjust the framerate accordingly. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4242 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Force title dimensions to be evenjstebbins2011-09-191-8/+13
| | | | | | | | HandBrake's video pipeline uses yuv420 color which requires even dimensions. The input video may be a diffent color space that allows odd dimensions. So crop a row or colomn if necessary. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4239 b64f7644-9d1e-0410-96f1-a4d463321fa5
* MacGui: since Auto Passthru isn't enabled yet, we still need to fall back to ↵Rodeo2011-09-191-1/+1
| | | | | | | | | | AC3 Passthru when loading a preset. Also, update an outdated comment. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4238 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: Auto Passthru and audio/video encoder lists.Rodeo2011-09-193-67/+209
| | | | | | | | | | | | | | This adds Auto Passthru as another encoder in libhb. Used in LinGUI and CLI. MacGUI features a partial impplmentation (with hardcoded values), which is disabled for now. Also, audio and video encoders are now stored in "lists", like we previously did for mixdowns. New mixdown "None" (HB_AMIXDOWN_NONE) added to hb_audio_mixdowns (was previously declared in MacGUI/LinGUI). git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4237 b64f7644-9d1e-0410-96f1-a4d463321fa5
* hb_ff_layout_xlat: minor cleanup.Rodeo2011-09-191-16/+15
| | | | | | | | Slightly more meaningful log messages. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4233 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Add fake keyframes for PIR encodingjstebbins2011-09-191-10/+18
| | | | | | | | Periodic intra refresh has no IDR frames, but x264 signals a keyframe at recovery points. Use this flag to fake keyframes in the container so that seeking in these files works properly. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4232 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Fix corrupt first frame in BD point-to-pointjstebbins2011-09-195-116/+73
| | | | | | | | | | | Seek point may be a recovery point which will not be a complete clean frame. So consume frames till we reach the recovery frame count. Patches Libav so it can tell us when the recovery point has been reached. Also improves detection of recovery points in TS files. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4231 b64f7644-9d1e-0410-96f1-a4d463321fa5
* don't pass unhandled TS/PS stream types to demuxjstebbins2011-09-161-0/+3
| | | | | | | | I ran across a stream that has bad timestamps in the Teletext track which causes the demux to think there are discontinuities and drop packets. makes a real mess of things. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4224 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix silly error in scanning BDjstebbins2011-09-151-1/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4223 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix for broken lpcm streamsjstebbins2011-09-141-41/+109
| | | | | | | | fixes streams that have broken frame count field. since this value can be computed from the frame size, we can ignore it. Also fixes some decode errors in 20 and 24bit lpcm. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4221 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Improve mpeg PS supportjstebbins2011-09-1410-1179/+2790
| | | | | | | | | | | | | | | | | | | | | | Adds support for MPEG-1 PS, HDDVD EVOB, and video codecs other than mpeg1/2 in PS Improves probing of unknown stream types by using Libav's probing utilities Use Libav to probe for dts profile in TS and PS files when profile is unknown Improves framerate detection (improved telecine detection) Fixes preview generation for mpeg video that has only a single sequence header Patches Libav to handle VC-1 pulldown flags properly Improve PS and TS stream log information git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4220 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: fix incorrect decrementing of audio->config.out.track; it starts at ↵Rodeo2011-09-091-5/+4
| | | | | | | | | | | | | | | | | | | 1, not 0. Also, explicitly log that we are dropping the track when we find an incompatible passthru. Fixes: [01:26:41] Sample rate 24000 not supported (ca_haac). Using 32kHz for track 1 track 1 suddenly becomes track 0: [01:26:41] work: sanitizing track 0 mixdown Dolby Pro Logic II to Stereo [01:26:41] work: sanitizing track 0 audio bitrate 160 to 80 […] [01:26:41] * audio track 0 git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4210 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: work around the lack of 6.1 support for DTS sourcesRodeo2011-09-094-0/+46
| | | | | | | | | | | | libhb doesn't support 6.1 sources and assumes they're 7.0 instead. This breaks downmixing. Libav can decode the DTS-ES 6.1 core of DTS-HD 6.1 audio tracks; tell it to not process the additional channel so that such tracks can be re-encoded correctly. See https://reviews.handbrake.fr/r/200/ for more information. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4209 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Blu-ray: display playlist number in log, CLI scan output, and title drop-down.Rodeo2011-08-163-1/+4
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4182 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: Use h.264 recovery points as key frames when decodingjstebbins2011-08-163-27/+164
| | | | | | | | | | | Many transport streams have few or zero IDR frames. So scanning them takes a long time, generates a lot of log spam, and results in poor preview quality. Often there will be several identical preview frames because it will find the same IDR for several of the previews. Using recovery points helps all these problems. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4180 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: fix setting Libav codec private optionsjstebbins2011-08-125-10/+37
| | | | | | | | and logging of Libav advanced options. Thanks to Rodeo for spotting git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4170 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: allow changing colorimetry in x264 optionsjstebbins2011-08-084-43/+43
| | | | | | | | Setting "colorprim", "transfer", or "colormarix" in the x264 advanced options will no longer be ignored and will propagate to the mp4 muxer where those values also get set in the container. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4164 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: tighten up dvd program stream detectionjstebbins2011-08-041-2/+4
| | | | | | | so that we don't misdetect mpeg1 program streams as dvd program streams git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4155 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: fix mis-detection of mov files as mpeg PSjstebbins2011-08-011-8/+10
| | | | | | | | | Tightens the mpeg PS detection further to prevent mis-detection of mov files as mpeg PS. Hopefully doesn't cause faulures to detect real mpeg PS files. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4150 b64f7644-9d1e-0410-96f1-a4d463321fa5
* add more audio passthru optionsjstebbins2011-08-0116-278/+329
| | | | | | | | | | | | | | | | | adds aac and mp3 passthru for mp4 and mkv containers adds dts and dtshd for mp4 container (mkv already had it) Note: The only player known (to me) to support dts(hd) in mp4 is ff/avplay In LinGui there is a new option to limit which passthru codecs will be used by the "Auto Passthru" audio codec options. The CLI already has this ability with "--audio_copy-mask" which is use in conjunction with the "copy" audio codec option. Also corrects some A/V sync issues when video frames are dropped due to a gap detected in the audio. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4149 b64f7644-9d1e-0410-96f1-a4d463321fa5
* bump Libav from git-v0.7b2-406-g7b20d35 to release 0.7.1jstebbins2011-08-011-11/+11
| | | | | | | | | | | | | It includes the following fixes: - MKV seek issue: http://git.libav.org/?p=libav.git;a=commit;h=c29c609 - crash when decoding corrupt MPEG-2 streams: http://git.libav.org/?p=libav.git;a=commit;h=20153fb - other misc. fixes: http://git.libav.org/?p=libav.git;a=shortlog;h=refs/heads/release/0.7 It includes the following new feature: - support for DTS in MP4 and MOV files: http://git.libav.org/?p=libav.git;a=commit;h=26f4875 git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4148 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: fix some log spam when scanning h.264 BDsjstebbins2011-08-013-4/+4
| | | | | | | | Some residual data from the previous preview was being sent to the decoder after a seek causing the decoder to complain. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4147 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: fix an avcodec error checkjstebbins2011-07-301-1/+1
| | | | | | | They changed the error value returned git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4144 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: fix or simplify several hacks involved with Libav supportjstebbins2011-07-2711-1033/+592
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For files that are demuxed by Libav, we must share the format context with the decoder iso that it can obtain the codec context for each stream. The code that did this was very convoluted and difficult to understand. It is simplified by simply passing the context in hb_title_t. Reader was closing stream files before the decoder was finished with the context. This created the need to delay the actual close and cache the context. Changed reader so it behaves more like the rest of handbrake's work objects which lets us explicitly close after the decoders are finished. Libav does some probing of the file when av_find_stream_info is called. This probing leaves the format context in a bad state for some files and causes subsequent reads or seeks to misbehave. So open 2 contexts in ffmpeg_open. One is used only for probing, and the other only for reading. decavcodec.c had 2 separate decoders for files demuxed by hb and files demuxed by Libav. They have been combined and simplified. Previously, it was not possible to decode one source audio track multiple times in order to fan it out to multiple output tracks if the file is demuxed by Libav. We were using the codec context from the format context. Since there is only one of these for each stream, we could only do one decode for each stream. Use avcodec_copy_context to make copies of the codec context and allow multiple decodes. This allows removal of a lot of special case code for Libav streams that was necessary to duplicate the output of the decoder. Patch Libav's mkv demux to fix a seek problem. This has been pushed upstreams, so the next time we update Libav, we must remove this patch. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4141 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Core Audio encoders: use hb_layout_remap instead of Apple's remapping functionsjstebbins2011-07-241-27/+39
| | | | | | | | | | | | | Apple's AudioConverterSetProperty function fails to set the kAudioConverterChannelMap under OS X 10.7 Lion. In order to avoid having to special-case and having to track whether or not the bug gets fixed, this patch just uses our hb_remap_layout function to do the remapping instead. Thanks to Rodeo for the patch git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4132 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: encavcodecaudio improvementsjstebbins2011-07-241-19/+11
| | | | | | | | | | | | | Compute the output layout once in encavcodecaInit and store it in a member of the hb_encavcodeca work object. Fix the channel mapping of ffaac in our code rather than applying a patch to Libav. The Libav AAC encoder is bound to see a certain amount of commit activity since it needs to be improved. A patch affecting the AAC encoder is bound to break regularly git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4131 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: fix access outside allocated memory regionjstebbins2011-07-191-19/+25
| | | | | | | | | In some cases we could access memory outside the memory buffer we allocate for TS packets. This didn't cause any known crashes, but it could possibly lead to a crash. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4123 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: plug a few memory leaksjstebbins2011-07-197-16/+72
| | | | | | | Noticed when debugging a memory corruption issue with valgrind git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4122 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: fix a couple small memory leaksjstebbins2011-07-111-3/+2
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4102 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: improve dvdnav main feature detectionjstebbins2011-07-101-106/+145
| | | | | | | | | Add detection of fake menus. Some menus have very short duration and/or are hidden from the user by making the hightlight transparent. These menus can lead to invalid titles if traversed, so ignore them. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4096 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: improve dvdnav main feature detectionjstebbins2011-07-091-68/+76
| | | | | | | | Improve detection of fake titles that are transitioned through on the way to the real title when a menu button is pressed. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4095 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Fix crash when scanning True Gritjstebbins2011-07-081-3/+6
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4090 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: fix a couple small memory leaksjstebbins2011-07-072-6/+2
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4088 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: fix a stack corruption crash when scanning some BDsjstebbins2011-07-071-11/+5
| | | | | | | | was overrunning the end of a stack based array when there were more than 32 clips in a BD title. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4086 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: when doing main feature search, skip prohibited buttons.jstebbins2011-07-061-33/+41
| | | | | | | | | | | | There is a field in the prohibited user operations PCI flags that says when the user can push buttons. If they are prohibited, we shouldn't push them when searching for the main feature since they would not be accessible on a dvd player. This fixes selection of "fake" titles on some discs. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4085 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: add some logging to main feature searchjstebbins2011-07-061-11/+33
| | | | | | | | | This lets us see in the logs if it finds a root menu title, a title menu title, or falls back to using the longest title. Log level 2 must be enabled to see these. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4084 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix some warnings in the clijstebbins2011-07-012-2/+2
| | | | | | | and add printf attribute to hb_strdup_printf git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4081 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: fix progress information for batch scansjstebbins2011-06-231-0/+1
| | | | | | | | | Use hb_batch_title_count() since hb_list_count() changes as unreadable titles are removed from the list. Title count needs to be the total number of files being scanned. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4077 b64f7644-9d1e-0410-96f1-a4d463321fa5