From db2e1ef4d210f5a8a4a2555d0a78b0a4dea103ec Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 21 Jun 2013 00:26:05 +0200 Subject: Move/rename subreader.c --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 9ac246dc36..4e244d8489 100644 --- a/Makefile +++ b/Makefile @@ -208,6 +208,7 @@ SOURCES = talloc.c \ demux/demux_mkv.c \ demux/demux_mpg.c \ demux/demux_sub.c \ + demux/demux_subreader.c \ demux/demux_ts.c \ demux/mp3_hdr.c \ demux/parse_es.c \ @@ -240,7 +241,6 @@ SOURCES = talloc.c \ sub/sd_srt.c \ sub/spudec.c \ sub/sub.c \ - sub/subreader.c \ video/csputils.c \ video/fmt-conversion.c \ video/image_writer.c \ -- cgit v1.2.3 From cfa45c40dc0cfe44b699029168b62d4d3e16c288 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 22 Jun 2013 02:09:52 +0200 Subject: sub: add demux_libass wrapper, drop old hacks demux_libass.c allows us to make subtitle format detection part of the normal file loading process. libass has no probe function, but trying to load the start of a file (the first 4 KB) is good enough. Hope that libass can even handle random binary input gracefully without printing stupid log messages, and that the libass parser doesn't accept too many non-ASS files as input. This doesn't handle the -subcp option correctly yet. This will be fixed later. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 4e244d8489..1fa78d676b 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,8 @@ SOURCES-$(DVDREAD) += stream/stream_dvd.c \ SOURCES-$(FTP) += stream/stream_ftp.c SOURCES-$(HAVE_SYS_MMAN_H) += audio/filter/af_export.c osdep/mmap_anon.c SOURCES-$(LADSPA) += audio/filter/af_ladspa.c -SOURCES-$(LIBASS) += sub/ass_mp.c sub/sd_ass.c +SOURCES-$(LIBASS) += sub/ass_mp.c sub/sd_ass.c \ + demux/demux_libass.c SOURCES-$(LIBBLURAY) += stream/stream_bluray.c SOURCES-$(LIBBS2B) += audio/filter/af_bs2b.c @@ -207,7 +208,6 @@ SOURCES = talloc.c \ demux/demux_mf.c \ demux/demux_mkv.c \ demux/demux_mpg.c \ - demux/demux_sub.c \ demux/demux_subreader.c \ demux/demux_ts.c \ demux/mp3_hdr.c \ -- cgit v1.2.3 From f735a03346e8ec743bc89d5bdbaafd62dc0f084d Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 23 Jun 2013 22:15:04 +0200 Subject: sub: add subtitle charset conversion This code was once part of subreader.c, then traveled to libass, and now made its way back to the fork of the fork of the original code, MPlayer. It works pretty much the same as subreader.c, except that we have to concatenate some packets to do auto-detection. This is rather annoying, but for all we know the actual source file could be a binary format. Unlike subreader.c, the iconv context is reopened on each packet. This is simpler, and with respect to multibyte encodings, more robust. Reopening is probably not a very fast, but I suspect subtitle charset conversion is not an operation that happens often or has to be fast. Also, this auto-detection is disabled for microdvd - this is the only format we know that has binary data in its packets, but is actually decoded to text. FFmpeg doesn't really allow us to solve this properly, because a) the input packets can be binary, and b) the output will be checked whether it's UTF-8, and if it's not, the output is thrown away and an error message is printed. We could just recode the decoded subtitles before sd_ass if it weren't for that. --- Makefile | 1 + 1 file changed, 1 insertion(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 1fa78d676b..1c4c65a098 100644 --- a/Makefile +++ b/Makefile @@ -170,6 +170,7 @@ SOURCES = talloc.c \ core/av_log.c \ core/av_opts.c \ core/bstr.c \ + core/charset_conv.c \ core/codecs.c \ core/command.c \ core/cpudetect.c \ -- cgit v1.2.3 From 709389ce653d5ab11abf8de067cfb5932e642898 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 24 Jun 2013 02:06:55 +0200 Subject: sub: add hack for Libav SRT demuxer Before this commit, SRT demuxing and display actually happened to work on Libav. But it was using the libavcodec srt converter (which is essentially unmaintained in Libav), and timing postprocessing didn't work. For some background explanations see sd_lavf_srt.c. --- Makefile | 1 + 1 file changed, 1 insertion(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 1c4c65a098..6dd6f6c6f8 100644 --- a/Makefile +++ b/Makefile @@ -236,6 +236,7 @@ SOURCES = talloc.c \ sub/img_convert.c \ sub/sd_lavc.c \ sub/sd_lavc_conv.c \ + sub/sd_lavf_srt.c \ sub/sd_microdvd.c \ sub/sd_movtext.c \ sub/sd_spu.c \ -- cgit v1.2.3