From 4121016689668921538317449c0ea9063fc086fc Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 26 Aug 2016 12:31:09 +0200 Subject: player: don't directly access demuxer->stream Cleaner and makes it easier to change the underlying stream. mp_property_stream_capture() still directly accesses it directly via demux_run_on_thread(). This is evil, but still somewhat sane and is not getting into the way here. Not sure if I got all field accesses. --- player/command.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'player/command.c') diff --git a/player/command.c b/player/command.c index e9a051db8c..f4c10d48b9 100644 --- a/player/command.c +++ b/player/command.c @@ -429,11 +429,9 @@ static int mp_property_stream_path(void *ctx, struct m_property *prop, int action, void *arg) { MPContext *mpctx = ctx; - // demuxer->stream as well as stream->url are immutable -> ok to access - struct stream *stream = mpctx->demuxer ? mpctx->demuxer->stream : NULL; - if (!stream || !stream->url) + if (!mpctx->demuxer || !mpctx->demuxer->filename) return M_PROPERTY_UNAVAILABLE; - return m_property_strdup_ro(action, arg, stream->url); + return m_property_strdup_ro(action, arg, mpctx->demuxer->filename); } struct change_stream_capture_args { -- cgit v1.2.3