diff options
author | wm4 <wm4@nowhere> | 2013-07-11 21:10:42 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-07-12 21:56:40 +0200 |
commit | 52c3eb69765a0d1070bf240353095c8ff546765b (patch) | |
tree | db654a9798f4941dbc3b57c8569fcdeb0b21d24a /core/mplayer.c | |
parent | d17d2fdc7c536821b3fea8c4a37c0ad09fc487db (diff) | |
download | mpv-52c3eb69765a0d1070bf240353095c8ff546765b.tar.bz2 mpv-52c3eb69765a0d1070bf240353095c8ff546765b.tar.xz |
core: change open_stream and demux_open signature
This removes the dependency on DEMUXER_TYPE_* and the file_format
parameter from the stream open functions.
Remove some of the playlist handling code. It looks like this was
needed only for loading linked mov files with demux_mov (which was
removed long ago).
Delete a minor bit of dead network-related code from stream.c as well.
Diffstat (limited to 'core/mplayer.c')
-rw-r--r-- | core/mplayer.c | 34 |
1 files changed, 4 insertions, 30 deletions
diff --git a/core/mplayer.c b/core/mplayer.c index 026af6a989..73108d8d34 100644 --- a/core/mplayer.c +++ b/core/mplayer.c @@ -3882,11 +3882,10 @@ static struct track *open_external_file(struct MPContext *mpctx, char *filename, struct MPOpts *opts = &mpctx->opts; if (!filename) return NULL; - int format = 0; char *disp_filename = filename; if (strncmp(disp_filename, "memory://", 9) == 0) disp_filename = "memory://"; // avoid noise - struct stream *stream = open_stream(filename, &mpctx->opts, &format); + struct stream *stream = stream_open(filename, &mpctx->opts); if (!stream) goto err_out; stream_enable_cache_percent(&stream, stream_cache, @@ -3896,8 +3895,7 @@ static struct track *open_external_file(struct MPContext *mpctx, char *filename, .ass_library = mpctx->ass_library, // demux_libass requires it }; struct demuxer *demuxer = - demux_open_withparams(&mpctx->opts, stream, format, demuxer_name, - filename, ¶ms); + demux_open(stream, demuxer_name, ¶ms, &mpctx->opts); if (!demuxer) { free_stream(stream); goto err_out; @@ -4156,36 +4154,13 @@ static void play_current_file(struct MPContext *mpctx) } stream_filename = mpctx->resolve_result->url; } - int file_format = DEMUXER_TYPE_UNKNOWN; - mpctx->stream = open_stream(stream_filename, opts, &file_format); + mpctx->stream = stream_open(stream_filename, opts); if (!mpctx->stream) { // error... demux_was_interrupted(mpctx); goto terminate_playback; } mpctx->initialized_flags |= INITIALIZED_STREAM; - if (file_format == DEMUXER_TYPE_PLAYLIST) { - mp_msg(MSGT_CPLAYER, MSGL_ERR, "\nThis looks like a playlist, but " - "playlist support will not be used automatically.\n" - "mpv's playlist code is unsafe and should only be used with " - "trusted sources.\nPlayback will probably fail.\n\n"); -#if 0 - // Handle playlist - mp_msg(MSGT_CPLAYER, MSGL_WARN, "Parsing playlist %s...\n", - mpctx->filename); - bool empty = true; - struct playlist *pl = playlist_parse(mpctx->stream); - if (pl) { - empty = pl->first == NULL; - playlist_transfer_entries(mpctx->playlist, pl); - talloc_free(pl); - } - if (empty) - mp_msg(MSGT_CPLAYER, MSGL_ERR, "Playlist was invalid or empty!\n"); - mpctx->stop_play = PT_NEXT_ENTRY; - goto terminate_playback; -#endif - } mpctx->stream->start_pos += opts->seek_to_byte; if (opts->stream_dump && opts->stream_dump[0]) { @@ -4212,8 +4187,7 @@ goto_reopen_demuxer: ; mpctx->audio_delay = opts->audio_delay; - mpctx->demuxer = demux_open(opts, mpctx->stream, file_format, - mpctx->filename); + mpctx->demuxer = demux_open(mpctx->stream, NULL, NULL, opts); mpctx->master_demuxer = mpctx->demuxer; if (!mpctx->demuxer) { |