mirror of https://github.com/mpv-player/mpv
player: remove unused MPContext.stream field
It was just dead code. Also fixes the stream-open-filename property, which is supposed to be read-only if a file was already opened.
This commit is contained in:
parent
36c6c0f79b
commit
b5f620ae75
|
@ -350,7 +350,7 @@ static int mp_property_stream_open_filename(void *ctx, struct m_property *prop,
|
|||
return M_PROPERTY_UNAVAILABLE;
|
||||
switch (action) {
|
||||
case M_PROPERTY_SET: {
|
||||
if (mpctx->stream)
|
||||
if (mpctx->demuxer)
|
||||
return M_PROPERTY_ERROR;
|
||||
mpctx->stream_open_filename =
|
||||
talloc_strdup(mpctx->stream_open_filename, *(char **)arg);
|
||||
|
|
|
@ -273,8 +273,6 @@ typedef struct MPContext {
|
|||
// Current file statistics
|
||||
int64_t shown_vframes, shown_aframes;
|
||||
|
||||
struct stream *stream; // stream that was initially opened
|
||||
|
||||
struct demux_chapter *chapters;
|
||||
int num_chapters;
|
||||
|
||||
|
|
|
@ -83,12 +83,6 @@ static void uninit_demuxer(struct MPContext *mpctx)
|
|||
mpctx->demuxer = NULL;
|
||||
}
|
||||
|
||||
static void uninit_stream(struct MPContext *mpctx)
|
||||
{
|
||||
free_stream(mpctx->stream);
|
||||
mpctx->stream = NULL;
|
||||
}
|
||||
|
||||
#define APPEND(s, ...) mp_snprintf_cat(s, sizeof(s), __VA_ARGS__)
|
||||
|
||||
static void print_stream(struct MPContext *mpctx, struct track *t)
|
||||
|
@ -1047,7 +1041,6 @@ static void play_current_file(struct MPContext *mpctx)
|
|||
|
||||
reopen_file:
|
||||
|
||||
assert(mpctx->stream == NULL);
|
||||
assert(mpctx->demuxer == NULL);
|
||||
|
||||
if (process_open_hooks(mpctx) < 0)
|
||||
|
@ -1215,7 +1208,6 @@ terminate_playback:
|
|||
uninit_video_chain(mpctx);
|
||||
uninit_sub_all(mpctx);
|
||||
uninit_demuxer(mpctx);
|
||||
uninit_stream(mpctx);
|
||||
if (!opts->gapless_audio && !mpctx->encode_lavc_ctx)
|
||||
uninit_audio_out(mpctx);
|
||||
|
||||
|
|
Loading…
Reference in New Issue