diff options
author | wm4 <wm4@nowhere> | 2013-06-22 02:09:52 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-06-25 00:11:56 +0200 |
commit | cfa45c40dc0cfe44b699029168b62d4d3e16c288 (patch) | |
tree | 5a80d3b6e82711a5816c509e803c029b93342892 /demux/demux.c | |
parent | 1bfae45a88ac7c24b74a6f7ca6eb4aa27d20c653 (diff) | |
download | mpv-cfa45c40dc0cfe44b699029168b62d4d3e16c288.tar.bz2 mpv-cfa45c40dc0cfe44b699029168b62d4d3e16c288.tar.xz |
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.
Diffstat (limited to 'demux/demux.c')
-rw-r--r-- | demux/demux.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/demux/demux.c b/demux/demux.c index 369e7f3226..b66f5e3e61 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -67,7 +67,7 @@ extern const demuxer_desc_t demuxer_desc_mpeg_es; extern const demuxer_desc_t demuxer_desc_mpeg4_es; extern const demuxer_desc_t demuxer_desc_h264_es; extern const demuxer_desc_t demuxer_desc_mpeg_ts; -extern const demuxer_desc_t demuxer_desc_sub; +extern const demuxer_desc_t demuxer_desc_libass; extern const demuxer_desc_t demuxer_desc_subreader; /* Please do not add any new demuxers here. If you want to implement a new @@ -82,6 +82,7 @@ const demuxer_desc_t *const demuxer_list[] = { #ifdef CONFIG_TV &demuxer_desc_tv, #endif + &demuxer_desc_libass, &demuxer_desc_matroska, &demuxer_desc_lavf, &demuxer_desc_subreader, @@ -99,8 +100,6 @@ const demuxer_desc_t *const demuxer_list[] = { &demuxer_desc_mpeg_ts, // auto-probe last, because it checks file-extensions only &demuxer_desc_mf, - // no auto-probe - &demuxer_desc_sub, /* Please do not add any new demuxers here. If you want to implement a new * demuxer, add it to libavformat, except for wrappers around external * libraries and demuxers requiring binary support. */ @@ -289,18 +288,6 @@ static demuxer_t *new_demuxer(struct MPOpts *opts, stream_t *stream, int type, return d; } -// for demux_sub.c -demuxer_t *new_sub_pseudo_demuxer(struct MPOpts *opts) -{ - struct stream *s = open_stream("null://", NULL, NULL); - assert(s); - struct demuxer *d = new_demuxer(opts, s, DEMUXER_TYPE_SUB, - -1, -1, -1, NULL); - new_sh_stream(d, STREAM_SUB); - talloc_steal(d, s); - return d; -} - static struct sh_stream *new_sh_stream_id(demuxer_t *demuxer, enum stream_type type, int stream_index, |