summaryrefslogtreecommitdiffstats
path: root/libhb/decvobsub.c
Commit message (Collapse)AuthorAgeFilesLines
* libhb: check if decvobsub.c private_data is not null before accessing one of ↵Damiano Galassi2017-01-091-1/+1
| | | | its member. Fix a crash when calling decsubClose if the decoder had not been initialized yet.
* libhb: better bound checking in ParseControls.Damiano Galassi2017-01-041-2/+37
|
* Update copyright dates to 2017.Bradley Sepos2017-01-011-1/+1
|
* sync: correct timestamp discontinuities in sync instead of reader (#192)John Stebbins2016-05-241-16/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * sync: correct timestamp discontinuities in sync instead of reader This patch passes discontinuity information through the pipeline till it reaches sync.c. The timestamps are passed through the pipeline as read and unmodified to sync.c (instead of attempting to correct discontinuities in reader). In sync, when we see a discontinuity, we know where the next timestamp should be based on the timestamp and duration of the previous buffer (before the discontinuity). So we calculate an "SCR" offset based on the timestamp after the discontinuity and what we calculate it should be. The old discontinuity handling code was broken due to the following. The MPEG STD timing model relies heavily on the decoder having an STC that is phase lock looped to the PCRs in the stream. When decoding a broadcast stream, the decoder can count on the time measure between PCRs using the STC to match to a high degree of accuracy. I.e. STC - lastSTC == PCR - lastPCR. When a discontinuity occurs, the decoder calculates a new PCR offset = PCR - STC. I.e. the offset is the new PCR value minus what it would have been if there had been no discontinuity. The above does not work without a reliable STC, which we do not have. We have been attempting to approximate one by avereraging the duration of received packets and extrapolating an "STC" based on the last PTS and the average packet duration. But this is highly variable and unreliable. * decavcodec: fix data type of next_pts It needs to be double so that partial ticks are not lost * deccc608sub: clarify comment * sync: allow queueing more audio Audio is small, and there is often a significant amount of audio in the stream before the first video frame. * sync: improve handling of damaged streams When data is missing, the audio decoder was extrapolating timestamps from the last pts before the error caused by the missing data which caused sync issues. Also, missing data can cause the video decoder to output a frame out of order with the wrong scr sequence. Drop such frames.
* libhb: remove unused hb_buffer_t sequence numberJohn Stebbins2016-05-171-3/+0
|
* Update copyright dates to 2016.Bradley Sepos2016-01-011-1/+1
|
* rendersub: handle mismatched video and subtitle dimensionsJohn Stebbins2015-09-241-1/+2
| | | | | The video frame subtitles are meant to be rendered to may not match the actual video we are encoding. So scale to match as needed.
* libhb: Use a buffer flat to indicate EOFjstebbins2015-05-011-1/+1
| | | | | | | | | | | | ... instead of a 0 length buffer. This fixes this issue: https://forum.handbrake.fr/viewtopic.php?f=12&t=31959 Theora can create 0 length output. These 0 length frames indicate duplicate frames. So we can't use 0 length buffers to indicate the end of the stream. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7143 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Update year to 2015.bradleys2015-02-011-1/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6852 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Update some copyright dates to 2014.Rodeo2014-02-181-1/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6042 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Replace invaled timestamp flag "-1" with AV_NOPTSjstebbins2014-01-261-6/+6
| | | | | | | | | -1 is not a good value as a flag for invalid timestamps. There are cases where small negative timestamps are useful. So this eliminates a potential ambiguity. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6001 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: add experimental avformat muxer for mkv and mp4jstebbins2013-06-301-0/+2
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5620 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
* Bump libav to v9_beta3.Rodeo2012-12-311-1/+1
| | | | | | | | Miscellaneous bugfixes and improvements. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5124 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
* fix more compiler warningsjstebbins2012-05-261-4/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4702 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: fix initialization problem in chroma resamplingjstebbins2012-05-021-0/+1
| | | | | | | may account for https://forum.handbrake.fr/viewtopic.php?f=12&t=24168 git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4630 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Simplify Foreign Audio Search code:Rodeo2012-05-011-17/+3
| | | | | | | | | | | | | | | | | | | | - move all subtitle hit counting to the decoders instead of reader ---> allows us to count actual subtitles rather than just packets - always count subtitles, even when not doing a scan (may be useful in the future) Miscellaneous improvements: - always insert select_subtitle at the head of the output subtitle list, to make it less likely to be dropped - when multiple subtitle tracks have forced hits, pick the track with the fewest forced hits ---> Foreign Audio Search should now work with Star Wars on Blu-ray - logging improvements (more readable, and log job->select_subtitle configuration - Forced Only vs. All, Render vs. Passthrough) git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4622 b64f7644-9d1e-0410-96f1-a4d463321fa5
* PGS (bluray) subtitle support \o/jstebbins2012-04-261-8/+14
| | | | | | | | | | | | 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: fix cfr encodingjstebbins2012-03-311-1/+1
| | | | | | | | | | | | when frames are duplicated, the frame was not copied properly and resulted in divide by 0 later when the frame is processed. This fix is a bit larger than the minimum size necessary to fix the problem. I took the oportunity to clean up some buffer initialization and copy operations. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4563 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Rework filter pipelinejstebbins2012-03-271-37/+93
| | | | | | | | | | | | | | | | | | | | 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
* Fix overlapping vobsubsjstebbins2011-12-221-10/+8
| | | | | | | | | vobsubs that don't have a stop time were persisting too long and being displayed under the next vobsub in the video. We don't need to guess the stop time of the vobsub. sync already handles unknown stop times for subtitles. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4383 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Make sure decvobsub.c generates valid timestampsjstebbins2011-11-151-4/+23
| | | | | | | | | sync.c expects that timestamps will all be resolved by the time buffers reach it. Reader will invalidate timestamps while waiting to resynchronize the SCR. So decoders (inparticular decvobsub) need to extrapolate timestamps when they are not supplied. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4352 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Fix a problem with overlapping vobsubsjstebbins2011-04-271-9/+3
| | | | | | | | | | | Since we now allow subtitles that overlap in time, it is no longer appropriate to arbitrarily set the duration to 3 seconds when vobsubs don't have an explicit stop time. This causes them to overlap on the display. So now, we set the stop time for such vobsubs to -1. Then in sync adjust the stop time to the start of the next vobsub when it is seen. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3961 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Change scale factor for timestamp offset in vobsub commandsjstebbins2011-04-241-4/+4
| | | | | | | | Testing shows that this should be 1024 instead of 900. Thanks to Rodeo for validation and patch. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3954 b64f7644-9d1e-0410-96f1-a4d463321fa5
* SSA subtitle burn injstebbins2010-09-281-4/+4
| | | | | | | | | | Anime fans rejoice! This patch adds SSA subtitle burn-in support with libass. Therefore SSA subtitles should now be rendered in full quality, with the appropriate embedded fonts and positioning information. Thanks to davidfstr git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3557 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Support for reading VOB subtitle tracks from file inputs initital ↵dynaflash2010-05-201-1/+36
| | | | | | | | | | | | | | implementation. - Patch by davidfstr, Nice Work! - Adds support for reading VOB subtitle tracks from file inputs. Tested with: - MKV VOB -> MKV VOB passthru. - MKV VOB -> MKV VOB burned in. VOB subtitle palette moved from per-title to per-track. Discussion leading up to commit can be referenced here: http://forum.handbrake.fr/viewtopic.php?f=4&t=16267 git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3308 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
* fix buffer leak during indepth scan jstebbins2009-12-081-0/+5
| | | | | | | 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
* libhb: fix forced foreign language scan issuesjstebbins2009-06-131-0/+9
| | | | | | | | | | | | | | | - 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
* softsubtitles:jstebbins2009-06-021-2/+2
| | | | | | | | | | | | | | | | | | - 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-42/+60
| | | | | | | | | | | | | - 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
* Change CC608 decoder to be its own threadeddyg2009-05-071-2/+2
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2396 b64f7644-9d1e-0410-96f1-a4d463321fa5
* VOBSUB encoder skeleton for use with mkv VOBSUB pass-througheddyg2009-05-061-1/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2389 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Soft Subs Part 2: Auto-detect CC during scan, add CC to subtitle list in ↵eddyg2009-05-041-0/+556
title, if selected then CC's are extracted, MP4 Muxer will dump the subs to the log at the end of encoding. TODO: Translate PTS for buf->start to HB format, add MP4 subtitle track and subs during muxing. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2375 b64f7644-9d1e-0410-96f1-a4d463321fa5