summaryrefslogtreecommitdiffstats
path: root/libhb/decsrtsub.c
Commit message (Collapse)AuthorAgeFilesLines
* decsrtsub: fix crash on empty UTF8 filesJohn Stebbins2016-09-211-9/+10
| | | | fixes https://github.com/HandBrake/HandBrake/issues/332
* decsrtsub: simplify code and improve commentsJohn Stebbins2016-06-091-23/+19
|
* decsrt: don't add extra hard line break at end of subtitleJohn Stebbins2016-06-091-5/+11
|
* decsrt: fix dropping of first srt when it's start time is 0John Stebbins2016-06-091-2/+2
|
* Update copyright dates to 2016.Bradley Sepos2016-01-011-1/+1
|
* decsrt: configure as buffer sourceJohn Stebbins2015-11-151-17/+4
| | | | | set fifo_in to NULL so hb_work_loop will call repeadedly without the hack that primes it's input fifo.
* decsrt: don't combine > 2 lines into 2John Stebbins2015-10-121-28/+6
| | | | | | This was originally done because > 2 lines is not supported in mp4 timed text. But this line combining is now performed only when necessary in muxavformat.
* text subtitles: make font height independent of croppingjstebbins2015-04-101-1/+2
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7078 b64f7644-9d1e-0410-96f1-a4d463321fa5
* deccc608sub: improve CC positioningjstebbins2015-04-051-1/+2
| | | | | | | | The safe zone margin was not wide enough and the font size was a little too small. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7063 b64f7644-9d1e-0410-96f1-a4d463321fa5
* deccc608sub: fix column alignment issuesjstebbins2015-04-051-1/+1
| | | | | | | | Use a fixed width font, and insert hard spaces where necessary to allign columns correctly in multi-line CCs. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7061 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
* json: add json APIsjstebbins2014-12-161-2/+2
| | | | | | | | | | There are several changes to job and title structs that break current windows interop code. The interop code should be changed such that it only uses json APIs. So if there is any missing features (or bugs) in these APIs, please let me know. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6602 b64f7644-9d1e-0410-96f1-a4d463321fa5
* decsrtsub: fix incorrect usage of strncatjstebbins2014-12-101-1/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6592 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: fix utf8/srt sub line ending parsingjstebbins2014-09-151-1/+11
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6408 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Convert all text subtitles to ASS subsjstebbins2014-04-131-19/+163
| | | | | | | | | Add support for font color to tx3g. Allow more than one style flag at time in tx3g. Add positioning support to CC subs git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6163 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
* libhb: make libhb internal character code utf8jstebbins2013-09-221-3/+3
| | | | | | | | | | This makes libhb expect all strings passed to it to be in utf8 format. The cli converts the converts from the current code page to utf8. libhb converts back to the current code page when necessary for libraries that expect it. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5798 b64f7644-9d1e-0410-96f1-a4d463321fa5
* decsrtsub: clear remnants of the previous line before progessing a new one.Rodeo2013-05-141-0/+3
| | | | | | | | I don't really understand why, but this prevents miscellaneous subtitle corruption. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5456 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Improve upon previous commit.Rodeo2013-05-081-4/+5
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5447 b64f7644-9d1e-0410-96f1-a4d463321fa5
* decsrtsub: rework character substitution logic.Rodeo2013-05-081-20/+30
| | | | | | | | | | Don't pointlessly convert a line break to a space if it's the last character. Also, only skip a CR character if it's followed by an LF character. Otherwise, replace it with an LF character or a space, depending on the line number. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5446 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
* Improve management of titles and jobsjstebbins2012-11-121-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Updated file copyright / GPL headerssr552012-06-151-3/+7
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4737 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix more compiler warningsjstebbins2012-05-261-2/+2
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4702 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Rework filter pipelinejstebbins2012-03-271-4/+4
| | | | | | | | | | | | | | | | | | | | 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
* handle the utf8 byte order mark when present at the beginning of srt subsjstebbins2010-06-011-2/+11
| | | | | | | it was tripping us up and causing the loss of the first subtitle git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3344 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
* 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
* allow srt and cc subtitles to be up to 2 lines high.jstebbins2009-10-281-4/+24
| | | | | | | any additional lines after 2 are merged into 2nd line git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2897 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix reading of short srt subtitle filesjstebbins2009-10-141-1/+6
| | | | | | | | if the whole file is consumed before filling the output buffer during the iconv conversion, the subtitles would be dropped git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2885 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix reading of UTF-16 SRT subtitle files (and other wide charsets)jstebbins2009-10-031-32/+119
| | | | | | | | | | The entire file is encoded in the chosen charset, not just the subtitle text. So we must read and convert the text prior to any parsing. Using fgets() to read a line doesn't work because wide charsets can have 0x0a in the high byte of some char. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2863 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix srt track stop timejstebbins2009-09-271-7/+10
| | | | | | | | srt stop time was being set to the end of the start chapter instead of the end of the stop chapter. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2843 b64f7644-9d1e-0410-96f1-a4d463321fa5
* srt: change format string from "utf8" to "utf-8"jstebbins2009-08-281-1/+1
| | | | | | | mingw port of libiconv doesn't support "utf8" string git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2787 b64f7644-9d1e-0410-96f1-a4d463321fa5
* LinGui: SRT supportjstebbins2009-06-301-1/+0
| | | | | | | | | | | | | | | | - there are now two buttons to add subtitles one button adds normal subtitles from the source. the second adds SRT subtitles. - when an SRT subtitle is selected in the list, the available controls change SRT controls are: Language, Character Codeset, File, and Time Offset (ms) - A combo entry box is used for character code. A subset of the most common character codes is available in the popup. Other codes can be manually entered in the entry box. - The last used SRT file directory is remembered. - Remove the debug printf eddyg left in decsrtsub.c git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2648 b64f7644-9d1e-0410-96f1-a4d463321fa5
* - cleanup gcc format warnings showing up on linux 64-bitkonablend2009-06-251-2/+2
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2619 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Format cleanup.konablend2009-06-251-2/+1
| | | | | | | | | | - fixed ports.c to use a more portable method of getting integral pthread_t representation; resolves mingw crash. - added GCC attribute to generate compiler warnings for invalid usage of hb_log, hb_deep_log and hb_errror; see new macro HB_WPRINTF(s,v) in common.h. - fixed various invalid usage of above functions on osx i386/x86_64, and mingw. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2618 b64f7644-9d1e-0410-96f1-a4d463321fa5
* CLI: Missed file from SubRip - a symptom of too many views and patcheseddyg2009-06-231-0/+331
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2604 b64f7644-9d1e-0410-96f1-a4d463321fa5