diff options
author | wm4 <wm4@nowhere> | 2013-06-21 21:34:55 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-06-25 00:11:56 +0200 |
commit | 98388c0c073906f4485420485e27a14e8d957a2d (patch) | |
tree | b2bd98d6b502d106e07ef17b0a918464e69756ac /core | |
parent | b37147744e34c0f23acb391de6bd04a0a1dc8cca (diff) | |
download | mpv-98388c0c073906f4485420485e27a14e8d957a2d.tar.bz2 mpv-98388c0c073906f4485420485e27a14e8d957a2d.tar.xz |
subreader: turn into actual demuxer
subreader.c (before this commit renamed to demux_subreader.c) was
special cased to the -sub option. The plan is using the normal demuxer
codepath for all subtitle formats (so we can prefer libavformat demuxers
for most formats).
There are some subtle changes. The probe size is restricted to 32 KB
(instead of unlimitted + giving up after 100 lines of input). For
formats like MicroDVD, the video FPS isn't used anymore, because it's
not available on the subtitle demuxer level. Instead, hardcode it to
23.976 FPS (libavformat seems to do the same). The user can probably
still use -sub-fps to fix the timing. Checking the file extension for
".utf"/".utf8"/".utf-8" is simply removed (seems worthless, was in the
way, and I've never seen this anywhere).
Diffstat (limited to 'core')
-rw-r--r-- | core/mplayer.c | 9 | ||||
-rw-r--r-- | core/options.h | 1 |
2 files changed, 2 insertions, 8 deletions
diff --git a/core/mplayer.c b/core/mplayer.c index e0049a8bd0..f766246f63 100644 --- a/core/mplayer.c +++ b/core/mplayer.c @@ -71,7 +71,6 @@ #include "core/mplayer.h" #include "core/m_property.h" -#include "demux/subreader.h" #include "sub/find_subfiles.h" #include "sub/dec_sub.h" #include "sub/sd.h" @@ -1044,7 +1043,6 @@ struct track *mp_add_subtitles(struct MPContext *mpctx, char *filename, { struct MPOpts *opts = &mpctx->opts; struct ass_track *asst = NULL; - sub_data *subd = NULL; if (filename == NULL) return NULL; @@ -1055,17 +1053,14 @@ struct track *mp_add_subtitles(struct MPContext *mpctx, char *filename, // the weird special-cases. #ifdef CONFIG_ASS asst = mp_ass_read_stream(mpctx->ass_library, filename, opts->sub_cp); - if (!asst) - subd = sub_read_file(filename, fps, &mpctx->opts); - if (asst || subd) { + if (asst) { struct demuxer *d = new_sub_pseudo_demuxer(opts); assert(d->num_streams == 1); struct sh_stream *s = d->streams[0]; assert(s->type == STREAM_SUB); - s->codec = asst ? "ass" : subd->codec; + s->codec = "ass"; s->sub->track = asst; - s->sub->sub_data = subd; struct sh_sub **pptr = talloc(d, struct sh_sub*); *pptr = s->sub; diff --git a/core/options.h b/core/options.h index f925990a6c..c31d2063c9 100644 --- a/core/options.h +++ b/core/options.h @@ -147,7 +147,6 @@ typedef struct MPOpts { // subreader.c int suboverlap_enabled; char *sub_cp; - int sub_no_text_pp; char *audio_stream; int audio_stream_cache; |