summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-12-23 15:49:20 +0100
committerwm4 <wm4@nowhere>2015-12-23 15:49:20 +0100
commit2037426a65b81664fa480af9200c0ac0de276e09 (patch)
tree4cbf85b1baeb1d30b5c9435130c4cce3d2f09964
parente8960c69e9d5acdaaae6fadef8684e623979fb6e (diff)
downloadmpv-2037426a65b81664fa480af9200c0ac0de276e09.tar.bz2
mpv-2037426a65b81664fa480af9200c0ac0de276e09.tar.xz
player: minor simplification
This tmp thing had not much of a purpose anymore.
-rw-r--r--player/core.h2
-rw-r--r--player/loadfile.c6
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,