summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
authorwm4 <wm4@mplayer2.org>2012-05-20 11:42:44 +0200
committerwm4 <wm4@mplayer2.org>2012-05-20 11:42:44 +0200
commit2793e7eb70a342b346788f83e1ed660c8e0d491e (patch)
treefe62d4ab03de24c568244b66f10990e09af3a370 /mplayer.c
parent4488583dda2754a2e71ec991e9541bcc2c259da3 (diff)
parentf63dbaddb6de6add6d987dc28ca8771aca230451 (diff)
downloadmpv-2793e7eb70a342b346788f83e1ed660c8e0d491e.tar.bz2
mpv-2793e7eb70a342b346788f83e1ed660c8e0d491e.tar.xz
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c38
1 files changed, 15 insertions, 23 deletions
diff --git a/mplayer.c b/mplayer.c
index 36d6c825ff..063e9f199c 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -148,12 +148,6 @@ char *heartbeat_cmd;
// Config file
//**************************************************************************//
-static int cfg_inc_verbose(m_option_t *conf)
-{
- ++verbose;
- return 0;
-}
-
#include "path.h"
//**************************************************************************//
@@ -864,9 +858,9 @@ static void exit_sighandler(int x)
#include "cfg-mplayer.h"
-static int cfg_include(m_option_t *conf, char *filename)
+static int cfg_include(struct m_config *conf, char *filename)
{
- return m_config_parse_config_file(conf->priv, filename);
+ return m_config_parse_config_file(conf, filename);
}
#define DEF_CONFIG "# Write your default config options here!\n\n\n"
@@ -2541,9 +2535,6 @@ static int fill_audio_out_buffers(struct MPContext *mpctx, double endpts)
current_module = "play_audio";
- if (ao->untimed && mpctx->sh_video && mpctx->delay > 0)
- return 0;
-
// hack used by some mpeg-writing AOs
ao->brokenpts = ((mpctx->sh_video ? mpctx->sh_video->timer : 0) +
mpctx->delay) * 90000.0;
@@ -3465,9 +3456,9 @@ static void run_playloop(struct MPContext *mpctx)
pause_player(mpctx);
}
- if (mpctx->sh_audio && !mpctx->restart_playback) {
+ if (mpctx->sh_audio && !mpctx->restart_playback && !mpctx->ao->untimed) {
int status = fill_audio_out_buffers(mpctx, endpts);
- full_audio_buffers = status >= 0 && !mpctx->ao->untimed;
+ full_audio_buffers = status >= 0;
// Not at audio stream EOF yet
audio_left = status > -2;
}
@@ -3679,15 +3670,16 @@ static void run_playloop(struct MPContext *mpctx)
}
#endif
- if (mpctx->restart_playback && !video_left) {
- if (mpctx->sh_audio) {
- int status = fill_audio_out_buffers(mpctx, endpts);
- full_audio_buffers = status >= 0 && !mpctx->ao->untimed;
- // Not at audio stream EOF yet
- audio_left = status > -2;
- }
- mpctx->restart_playback = false;
+ if (mpctx->sh_audio && (mpctx->restart_playback ? !video_left :
+ mpctx->ao->untimed && (mpctx->delay <= 0 ||
+ !video_left))) {
+ int status = fill_audio_out_buffers(mpctx, endpts);
+ full_audio_buffers = status >= 0 && !mpctx->ao->untimed;
+ // Not at audio stream EOF yet
+ audio_left = status > -2;
}
+ if (!video_left)
+ mpctx->restart_playback = false;
if (mpctx->sh_audio && buffered_audio == -1)
buffered_audio = mpctx->paused ? 0 : ao_get_delay(mpctx->ao);
@@ -3736,7 +3728,7 @@ static void run_playloop(struct MPContext *mpctx)
double audio_sleep = 9;
if (mpctx->sh_audio && !mpctx->paused) {
if (mpctx->ao->untimed) {
- if (!mpctx->sh_video)
+ if (!video_left)
audio_sleep = 0;
} else if (full_audio_buffers) {
audio_sleep = buffered_audio - 0.050;
@@ -3961,7 +3953,7 @@ int main(int argc, char *argv[])
mp_input_register_options(mpctx->mconfig);
// Preparse the command line
- m_config_preparse_command_line(mpctx->mconfig, argc, argv);
+ m_config_preparse_command_line(mpctx->mconfig, argc, argv, &verbose);
#if (defined(__MINGW32__) || defined(__CYGWIN__)) && defined(CONFIG_WIN32DLL)
set_path_env();