From 2037426a65b81664fa480af9200c0ac0de276e09 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 23 Dec 2015 15:49:20 +0100 Subject: player: minor simplification This tmp thing had not much of a purpose anymore. --- player/core.h | 2 +- player/loadfile.c | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/player/core.h b/player/core.h index 04d4fb6126..db453e097e 100644 --- a/player/core.h +++ b/player/core.h @@ -131,7 +131,7 @@ struct track { // If the track's stream changes with the timeline (ordered chapters). bool under_timeline; - // Does not change with under_timeline, but it useless for most purposes. + // Does not change with under_timeline, but is useless for most purposes. struct sh_stream *original_stream; // Value can change if under_timeline==true. diff --git a/player/loadfile.c b/player/loadfile.c index 3e8c87f07f..07a32c307a 100644 --- a/player/loadfile.c +++ b/player/loadfile.c @@ -1011,7 +1011,6 @@ static void load_timeline(struct MPContext *mpctx) static void play_current_file(struct MPContext *mpctx) { struct MPOpts *opts = mpctx->opts; - void *tmp = talloc_new(NULL); double playback_start = -1e100; mp_notify(mpctx, MPV_EVENT_START_FILE, NULL); @@ -1045,7 +1044,7 @@ static void play_current_file(struct MPContext *mpctx) goto terminate_playback; mpctx->playing->reserved += 1; - mpctx->filename = talloc_strdup(tmp, mpctx->playing->filename); + mpctx->filename = talloc_strdup(NULL, mpctx->playing->filename); mpctx->stream_open_filename = mpctx->filename; mpctx->add_osd_seek_info &= OSD_SEEK_INFO_EDITION | OSD_SEEK_INFO_CURRENT_FILE; @@ -1305,6 +1304,7 @@ terminate_playback: if (mpctx->playing) playlist_entry_unref(mpctx->playing); mpctx->playing = NULL; + talloc_free(mpctx->filename); mpctx->filename = NULL; mpctx->stream_open_filename = NULL; @@ -1315,8 +1315,6 @@ terminate_playback: } else { mpctx->files_played++; } - - talloc_free(tmp); } // Determine the next file to play. Note that if this function returns non-NULL, -- cgit v1.2.3