summaryrefslogtreecommitdiffstats
path: root/player/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'player/misc.c')
-rw-r--r--player/misc.c51
1 files changed, 20 insertions, 31 deletions
diff --git a/player/misc.c b/player/misc.c
index 3729d7a42c..d68ad1db3e 100644
--- a/player/misc.c
+++ b/player/misc.c
@@ -1,18 +1,18 @@
/*
* This file is part of mpv.
*
- * mpv is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
+ * mpv is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
*
* mpv is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with mpv. If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with mpv. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stddef.h>
@@ -45,14 +45,6 @@
#include "core.h"
#include "command.h"
-double get_relative_time(struct MPContext *mpctx)
-{
- int64_t new_time = mp_time_us();
- int64_t delta = new_time - mpctx->last_time;
- mpctx->last_time = new_time;
- return delta * 0.000001;
-}
-
double rel_time_to_abs(struct MPContext *mpctx, struct m_rel_time t)
{
double length = get_time_length(mpctx);
@@ -171,25 +163,22 @@ void update_window_title(struct MPContext *mpctx, bool force)
void error_on_track(struct MPContext *mpctx, struct track *track)
{
- if (!track)
+ if (!track || !track->selected)
return;
mp_deselect_track(mpctx, track);
- if (track) {
- if (track->type == STREAM_AUDIO)
- MP_INFO(mpctx, "Audio: no audio\n");
- if (track->type == STREAM_VIDEO)
- MP_INFO(mpctx, "Video: no video\n");
- if (mpctx->opts->stop_playback_on_init_failure ||
- (!mpctx->current_track[0][STREAM_AUDIO] &&
- !mpctx->current_track[0][STREAM_VIDEO]))
- {
- if (!mpctx->stop_play)
- mpctx->stop_play = PT_ERROR;
- if (mpctx->error_playing >= 0)
- mpctx->error_playing = MPV_ERROR_NOTHING_TO_PLAY;
- }
- mpctx->sleeptime = 0;
+ if (track->type == STREAM_AUDIO)
+ MP_INFO(mpctx, "Audio: no audio\n");
+ if (track->type == STREAM_VIDEO)
+ MP_INFO(mpctx, "Video: no video\n");
+ if (mpctx->opts->stop_playback_on_init_failure ||
+ !(mpctx->vo_chain || mpctx->ao_chain))
+ {
+ if (!mpctx->stop_play)
+ mpctx->stop_play = PT_ERROR;
+ if (mpctx->error_playing >= 0)
+ mpctx->error_playing = MPV_ERROR_NOTHING_TO_PLAY;
}
+ mpctx->sleeptime = 0;
}
int stream_dump(struct MPContext *mpctx, const char *source_filename)