summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-07-08 01:37:30 +0200
committerwm4 <wm4@nowhere>2013-07-08 01:37:30 +0200
commit73c76de91edbf8a55eb725196ff54583e3428510 (patch)
treebb2538a39731a3b8e83f34e08463dcc8908bbfb0 /core
parent05ae5afd6249af9770eb1e55104fbd4f510c2342 (diff)
downloadmpv-73c76de91edbf8a55eb725196ff54583e3428510.tar.bz2
mpv-73c76de91edbf8a55eb725196ff54583e3428510.tar.xz
demux: simplify demux_open() calls
The demux_open as well as demux_open_withparams calls don't use the stream selection parameters anymore, so remove them everywhere. Completes the previous commit.
Diffstat (limited to 'core')
-rw-r--r--core/mplayer.c11
-rw-r--r--core/timeline/tl_cue.c12
-rw-r--r--core/timeline/tl_edl.c3
-rw-r--r--core/timeline/tl_matroska.c3
4 files changed, 4 insertions, 25 deletions
diff --git a/core/mplayer.c b/core/mplayer.c
index 78fb8c9a8e..019d37081d 100644
--- a/core/mplayer.c
+++ b/core/mplayer.c
@@ -3890,20 +3890,12 @@ static struct track *open_external_file(struct MPContext *mpctx, char *filename,
stream_enable_cache_percent(&stream, stream_cache,
opts->stream_cache_min_percent,
opts->stream_cache_seek_min_percent);
- // deal with broken demuxers: preselect streams
- int vs = -2, as = -2, ss = -2;
- switch (filter) {
- case STREAM_VIDEO: vs = -1; break;
- case STREAM_AUDIO: as = -1; break;
- case STREAM_SUB: ss = -1; break;
- }
- vs = -1; // avi can't go without video
struct demuxer_params params = {
.ass_library = mpctx->ass_library, // demux_libass requires it
};
struct demuxer *demuxer =
demux_open_withparams(&mpctx->opts, stream, format, demuxer_name,
- as, vs, ss, filename, &params);
+ filename, &params);
if (!demuxer) {
free_stream(stream);
goto err_out;
@@ -4219,7 +4211,6 @@ goto_reopen_demuxer: ;
mpctx->audio_delay = opts->audio_delay;
mpctx->demuxer = demux_open(opts, mpctx->stream, file_format,
- opts->audio_id, opts->video_id, opts->sub_id,
mpctx->filename);
mpctx->master_demuxer = mpctx->demuxer;
diff --git a/core/timeline/tl_cue.c b/core/timeline/tl_cue.c
index d9160e0b8e..a965cfd877 100644
--- a/core/timeline/tl_cue.c
+++ b/core/timeline/tl_cue.c
@@ -192,11 +192,7 @@ static bool try_open(struct MPContext *mpctx, char *filename)
struct stream *s = open_stream(filename, &mpctx->opts, &format);
if (!s)
return false;
- struct demuxer *d = demux_open(&mpctx->opts, s, format,
- mpctx->opts.audio_id,
- mpctx->opts.video_id,
- mpctx->opts.sub_id,
- filename);
+ struct demuxer *d = demux_open(&mpctx->opts, s, format, filename);
// Since .bin files are raw PCM data with no headers, we have to explicitly
// open them. Also, try to avoid to open files that are most likely not .bin
// files, as that would only play noise. Checking the file extension is
@@ -205,11 +201,7 @@ static bool try_open(struct MPContext *mpctx, char *filename)
// CD sector size (2352 bytes)
if (!d && bstr_case_endswith(bfilename, bstr0(".bin"))) {
mp_msg(MSGT_CPLAYER, MSGL_WARN, "CUE: Opening as BIN file!\n");
- d = demux_open(&mpctx->opts, s, DEMUXER_TYPE_RAWAUDIO,
- mpctx->opts.audio_id,
- mpctx->opts.video_id,
- mpctx->opts.sub_id,
- filename);
+ d = demux_open(&mpctx->opts, s, DEMUXER_TYPE_RAWAUDIO, filename);
}
if (d) {
add_source(mpctx, d);
diff --git a/core/timeline/tl_edl.c b/core/timeline/tl_edl.c
index 5ec04ac716..0303956513 100644
--- a/core/timeline/tl_edl.c
+++ b/core/timeline/tl_edl.c
@@ -360,9 +360,6 @@ void build_edl_timeline(struct MPContext *mpctx)
if (!s)
goto openfail;
struct demuxer *d = demux_open(&mpctx->opts, s, format,
- mpctx->opts.audio_id,
- mpctx->opts.video_id,
- mpctx->opts.sub_id,
edl_ids[i].filename);
if (!d) {
free_stream(s);
diff --git a/core/timeline/tl_matroska.c b/core/timeline/tl_matroska.c
index 11fcc67583..6752b5ff4c 100644
--- a/core/timeline/tl_matroska.c
+++ b/core/timeline/tl_matroska.c
@@ -117,8 +117,7 @@ static struct demuxer *open_demuxer(struct stream *stream,
struct MPContext *mpctx, char *filename, struct demuxer_params *params)
{
return demux_open_withparams(&mpctx->opts, stream,
- DEMUXER_TYPE_MATROSKA, NULL, mpctx->opts.audio_id,
- mpctx->opts.video_id, mpctx->opts.sub_id, filename, params);
+ DEMUXER_TYPE_MATROSKA, NULL, filename, params);
}
static int enable_cache(struct MPContext *mpctx, struct stream **stream,