summaryrefslogtreecommitdiffstats
path: root/libhb/stream.c
Commit message (Collapse)AuthorAgeFilesLines
* Refactor add_ffmpeg_audio.Rodeo2013-04-281-72/+50
| | | | | | | | | | | Simplify, set bitrate to 0 - scan will then call decavcodecaBSInfo, decode some audio and set the other input parameters, including samples_per_frame. decavcodec and scan fixes by John Stebbins. Thanks! git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5424 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Updated all the copyright headers to 2013.sr552013-03-091-1/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5318 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: handle incorrect stuffing in transport streamsjstebbins2013-01-061-1/+7
| | | | | | | | | | Incorrectly formatted stuffing causes invalid PCRs which results in sync issues. I've only seen this in one poorly authored BD, but it's easy to handle. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5152 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Bump libav to v9_beta3.Rodeo2012-12-311-126/+145
| | | | | | | | Miscellaneous bugfixes and improvements. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5124 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix some crashes in the macuijstebbins2012-12-121-0/+1
| | | | | | | | | I missed setting some pointers to NULL after free and missed place where the ui was setting job->file directly instead of using hb_job_set_file(). Also, a NULL chapter name caused a crash. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5097 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: fix BD encodingjstebbins2012-11-201-1/+1
| | | | | | | | | | | | | | I inadvertently disabled PCR processing in BD in https://trac.handbrake.fr/changeset/5058 This caused bugs to show up in our processing of TS streams that have no PCR. So re-enable PCR processing in BD to fix the regression. And fix the problems with processing TS streams that have no PCR. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5071 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Improve management of titles and jobsjstebbins2012-11-121-13/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cleans up several several unavoidable memory leaks caused by old api. Clearly separates titles from jobs. Titles are set during scan and never modified now. Since titles are immutable, this lead to API some changes. For example, We were setting chapter names in the title from the front ends. Now these get set in the job. These new APIs allow us to start moving away from our use of title->job. Eventually, I would like to eliminate title->job completely, but the mac ui is too tightly tied to using this field to allow removing it at this time. So there is temporarily a convenience function used only by the mac ui that allows it to continue using title->job and also use the new APIs. New APIs: typedef struct hb_title_set_s hb_title_set_t; struct hb_title_set_s { hb_list_t * list_title; int feature; // Detected DVD feature title }; hb_title_set_t * hb_get_title_set( hb_handle_t * ); This is just something I added to clean up how "feature title" info is passed. hb_job_t * hb_job_init( hb_title_t * title ); Initializes a new job with default settings from the title. hb_job_t * hb_job_init_by_index( hb_handle_t *h, int title_index ); Same as hb_job_init(). For use by win Interop lib. void hb_job_reset( hb_job_t * job ); Convenience function for the MacUi. Clears audio, subtitle, and filter lists. The macui still uses title->job because it is so intricately tied to it. So I created this convenience function that it can call after adding a job. void hb_job_close( hb_job_t ** job ); Releases the job an all resources it contains. void hb_job_set_advanced_opts( hb_job_t *job, const char *advanced_opts ); Makes a copy of "advanced_opts" and stores in job. Freed by hb_job_close(). void hb_job_set_file( hb_job_t *job, const char *file ); Makes a copy of "file" and stores in job. Freed by hb_job_close(). void hb_chapter_set_title(hb_chapter_t *chapter, const char *title); Makes a copy of "title" and stores in chapter. Freed by hb_chapter_close(). Recommended usage (cli and lingui are updated to do this): job = hb_job_init( title ); // set job settings ... hb_add(h, job); hb_job_close( &job ); I have also added new APIs for managing metadata. These are used to add metadata to a job. void hb_metadata_set_name( hb_metadata_t *metadata, const char *name ); void hb_metadata_set_artist( hb_metadata_t *metadata, const char *artist ); void hb_metadata_set_composer( hb_metadata_t *metadata, const char *composer ); void hb_metadata_set_release_date( hb_metadata_t *metadata, const char *release_date ); void hb_metadata_set_comment( hb_metadata_t *metadata, const char *comment ); void hb_metadata_set_genre( hb_metadata_t *metadata, const char *genre ); void hb_metadata_set_album( hb_metadata_t *metadata, const char *album ); void hb_metadata_set_coverart( hb_metadata_t *metadata, const uint8_t *coverart, int size ); Example: job = hb_job_init( &job ); // set job settings ... hb_metadata_set_artist( job->metadata, "Danny Elfman" ); hb_add(h, job); hb_job_close( &job ); Some APIs have changed in order to avoid using title incorrectly and use the new hb_title_set_t. -void hb_autopassthru_apply_settings( hb_job_t * job, hb_title_t * title ); +void hb_autopassthru_apply_settings( hb_job_t * job ); -void hb_get_preview( hb_handle_t *, hb_title_t *, int, uint8_t * ); +void hb_get_preview( hb_handle_t *, hb_job_t *, int, uint8_t * ); hb_thread_t * hb_scan_init( hb_handle_t *, volatile int * die, const char * path, int title_index, - hb_list_t * list_title, int preview_count, + hb_title_set_t * title_set, int preview_count, int store_previews, uint64_t min_duration ); These APIs have been removed. Win Interop will need some changes. I think what I've provided will be suffecient, but let me know if it's not. -void hb_get_preview_by_index( hb_handle_t *, int, int, uint8_t * ); -void hb_set_anamorphic_size_by_index( hb_handle_t *, int, - int *output_width, int *output_height, - int *output_par_width, int *output_par_height ); git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5058 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: fix a collection of small memory leaksjstebbins2012-09-131-0/+7
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4963 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Remove contrib/ffmpeg/A02-png-sequences.patch.konablend2012-09-101-0/+8
| | | | | | | | | | | | | Set AVPacket flags indicating key-frame for avcodec_decode_video2() call. Specifically, libav documentation states: * @param[in] avpkt The input AVpacket containing the input buffer. * You can create such packet with av_init_packet() and by then setting * data and size, some decoders might in addition need other fields like * flags&AV_PKT_FLAG_KEY. All decoders are designed to use the least * fields possible. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4950 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Use libav for dts audio decoding instead of libdca jstebbins2012-07-151-13/+11
| | | | | | | | | libdca has no advantage over libav for dts audio decoding. It doesn't do drc and it's downmix capabilities are actually inferior to libav. So this completely removes libdca from libhb git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4844 b64f7644-9d1e-0410-96f1-a4d463321fa5
* bump libav to libav-v0.8-2197-g1a068bfjstebbins2012-07-111-20/+7
| | | | | | | | | | | | Resolves several deprecated api's Eliminates several libav patches Eliminates our builtin downmix in favour of avresample Eliminate HB_INPUT_CH_LAYOUT_* and replace with AV_CH_LAYOUT_* Resolves 6.x and 7.0 input channel layout issues HB had Adds downmix support to declpcm. We never had it! git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4825 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: drop HB_INPUT_CH_LAYOUT_*Rodeo2012-06-181-10/+8
| | | | | | | | AV_CH_LAYOUT_* works for us, and as its usage becomes more widespread in libhb, translating between the two formats gets increasingly tedious. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4754 b64f7644-9d1e-0410-96f1-a4d463321fa5
* remove unnecessary includejstebbins2012-06-171-1/+0
| | | | | | | Thanks for Rogerio Brito for patch git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4744 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Updated file copyright / GPL headerssr552012-06-151-3/+6
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4737 b64f7644-9d1e-0410-96f1-a4d463321fa5
* decdca: attempt to fix Dolby Surround and Pro Logic II mixdown. We were ↵Rodeo2012-05-271-1/+5
| | | | | | | | | | | | | | doing it wrong in some cases. This means Dolby Pro Logic II is now only available for sources with at least L, R, C, Ls, Rs channels (as well as any additional channels), due to some libdca limitations. This will eventually go away when we use our own downmixing for all sources. Further cleanup to follow. Also cleans up usage of audio->config.in.flags (was audio->config.flags.*). git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4705 b64f7644-9d1e-0410-96f1-a4d463321fa5
* audio->config.lang.description: code cleanup.Rodeo2012-05-031-15/+31
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4637 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: if no source chapter name information is available, set default ↵Rodeo2012-05-031-7/+21
| | | | | | | | | | | | | | chapters names explicitly (rather than leaving it to the interfaces). Standardize calculation of chapter->hours, chapter->minutes and chapter->seconds across all sources. Get rid of an unused variable in libhb/dvd.c Ignore chapter names set by MakeMKV. "Chapter 1" is just as good as, if not better than "Chapter 01" or even "Chapter 00". git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4636 b64f7644-9d1e-0410-96f1-a4d463321fa5
* PGS (bluray) subtitle support \o/jstebbins2012-04-261-4/+205
| | | | | | | | | | | | Thanks to patches supplied by David Mitchell and Rob McMullen we finally have PGS support. I added a fix for libav pgs timestamp processing and detection of forced subtitles to their work, then made foreign audio search work with PGS subs. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4605 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: handle TS streams that have broken DTS timestampsjstebbins2012-04-111-0/+7
| | | | | | | | If the DTS is > PTS, ignore it because this can't happen in a properly constructed TS stream. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4586 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: Fix problem with TS streams that have no PAT or PMTjstebbins2012-03-301-14/+22
| | | | | | | Fall back to using libav in this case. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4560 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Rework filter pipelinejstebbins2012-03-271-52/+52
| | | | | | | | | | | | | | | | | | | | This patch enhances the filter objects. The 2 key improvements are: 1. A filter can change the image dimensions as frames pass through it. 2. A filter can output more than one frame. In addition, I have: Moved cropping & scalling into a filter object Added 90 degree rotation to the rotate filter Moved subtitle burn-in rendering to a filter object. Moved VFR/CFR handling into a framerate shaping filter object. Removed render.c since all it's responsibilities got moved to filters. Improves VOBSUB and SSA subtitle handling. Allows subtitle animations. SSA karaoke support. My apologies in advance if anything breaks ;) git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4546 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: Fix detection of streams in tivo capturesjstebbins2012-03-181-1/+4
| | | | | | | | | Tivo creates an initial program stream map that is incomplete, missing the video stream definition. So don't quit scanning for new streams after seeing the first program stream map. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4513 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Use libdca to decode DTS-ES audio. While the Libav DTS decoder gives us an ↵Rodeo2012-02-011-11/+7
| | | | | | extra channel, we can't do anything with it for the time being. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4430 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Update hb_ff_dts_request_5point1 to work with DTS-ES 6.0 Distcrete sources ↵Rodeo2012-01-311-3/+3
| | | | | | | | | | | | | | | | | | | | | (decode the DTS 5.0 core). Rename it to hb_ff_dts_disable_xch. Tested with: M2TS -> regular DTS 5.1 -> DTS-ES 6.1 Discrete MKV -> regular DTS 5.1 -> DTS-ES 6.0 Discrete -> DTS-ES 6.1 Discrete git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4428 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Fix crash in add_ffmpeg_attachment: the value for "filename" metadata may be ↵Rodeo2012-01-241-1/+1
| | | | | | | | | | NULL, so we can't call strlen without checking. Should fix https://forum.handbrake.fr/viewtopic.php?f=11&t=23018 and https://forum.handbrake.fr/viewtopic.php?f=12&t=23101 git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4420 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Improve mpeg-ps detectionjstebbins2012-01-141-0/+20
| | | | | | | | Make mis-detects less likely by checking all the marker bits in the pack header. This makes it much less likely that we will be spoofed by data that looks like a pack header. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4406 b64f7644-9d1e-0410-96f1-a4d463321fa5
* revert an ffmpeg reader changejstebbins2011-11-091-31/+23
| | | | | | | I did this a while back to improve seek performance for some samples that are demuxed by ffmpeg. But it causes crashes with some file types. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4343 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Fix probing mpeg video in program streamsjstebbins2011-11-061-2/+37
| | | | | | | | | | | | | | | | | ... and probably some other formats as well. Libav's probe routine doesn't necessarily return names that match the codec names that can be looked up by avcodec_find_decoder_by_name(). So we have to manually map the names if the lookup fails. Lookup for mpeg video started failing with the last Libav bump because they removed an obsolete "mpegvideo" decoder that we were matching on. The correct decoder is "mpeg2video", but probe doesn't return that string. Also fix our implementation of the ff_lockmgr callback. Current git Libav fails if we don't fix it. So might as well fix it now. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4341 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Disable DTS-HD LBR secondary audio tracksjstebbins2011-11-021-2/+7
| | | | | | | | | DTS-HD LBR used in HD-DVD and bluray for secondary audio streams. Libav can not decode yet. Having it in the audio list causes long delays during scan while we try to get stream parameters. So skip this audio type for now. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4336 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Find font attachments by file name extensionjstebbins2011-10-251-1/+17
| | | | | | | Some font attachments don't have the correct mime type. So check the file name extension as well when looking for fonts. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4316 b64f7644-9d1e-0410-96f1-a4d463321fa5
* better detection of Libav audio bitratejstebbins2011-10-181-1/+7
| | | | | | | | For some codecs, Libav does not set the codec context bitrate. They expect you to compute it from bits per sample, sample rate, and channels. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4298 b64f7644-9d1e-0410-96f1-a4d463321fa5
* bump Libav from v0.7.1 to v0.7-1241-g5f3fb59jstebbins2011-10-151-1/+1
| | | | | | | | | | | | Fixes VC-1 decode issue Adds partial support for interlaced VC-1 decode Adds ProRes decoder Fixes ac3 encoder dolby flag Fixes DCA frame size setting (delete patch A04) Fixes VC-1 repeat field processing (delete patch A05) Numerous other bug fixes and enhancements git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4291 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix crash during 2 pass encoding TS or PS sourcejstebbins2011-10-151-208/+160
| | | | | | | | | | | | | | | | | | | stream.c cached information that it probed during the first time it opened any source. Then later it would re-use that cached data. I was prematurely deleting the cached data during 2 pass encodes. The problem is that there is no way to know when the cached data is no longer needed. You could have a thousand items in the queue all using the same source, or you could have only 1. So you either have to (a) keep the cached data indefinitely, or (b) you have to be able to handle the case where scanned cached data is flushed before you start an encode. (a) is poor design. And if you choose (b) you might as well eliminate the cache all together. It doesn't really save any time and only complicates the code. In summary, the cache is gone. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4286 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Add flac + quality + compression level supportjstebbins2011-10-121-2/+4
| | | | | | | | | Adds flac audio to cli, lingui, and macgui Adds quality and compression level options to cli Adds quality option to lingui Quality option works for vorbis and lame git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4281 b64f7644-9d1e-0410-96f1-a4d463321fa5
* 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
* 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
* handle TS streams that have no PCRs betterjstebbins2011-09-261-4/+29
| | | | | | | | | | | | | | | | 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 corrupt first frame in BD point-to-pointjstebbins2011-09-191-81/+47
| | | | | | | | | | | 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
* Improve mpeg PS supportjstebbins2011-09-141-1085/+2664
| | | | | | | | | | | | | | | | | | | | | | 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: work around the lack of 6.1 support for DTS sourcesRodeo2011-09-091-0/+6
| | | | | | | | | | | | 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
* libhb: Use h.264 recovery points as key frames when decodingjstebbins2011-08-161-27/+160
| | | | | | | | | | | 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: 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-011-3/+15
| | | | | | | | | | | | | | | | | 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-011-4/+2
| | | | | | | | 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 or simplify several hacks involved with Libav supportjstebbins2011-07-271-243/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* 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