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/loadfile.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'player/loadfile.c') 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