Compare commits

..
12 Commits
Author SHA1 Message Date
Alessandro Ghedini 973b555672 Release 0.6.2 2014-10-24 20:38:45 +02:00
wm4 0a40fb00b4 player: fix exiting if both audio and video fail initializing
The player was supposed to exit playback if both video and audio failed
to initialize (or if one of the streams was not selected when the other
stream failed). This didn't work; for one this check was missing from
one of the failure paths. And more importantly, both checked the
current_track array incorrectly.

Fix these issues, and move the failure handling code into a common
function.

CC: @mpv-player/stable

Conflicts:
	player/audio.c
	player/video.c
2014-10-23 20:27:32 +02:00
wm4 3c8aecb711 sub: adjustments to --ass-style-override option
Now requires newest libass git. Since this feature wasn't part of a
libass release yet, I'm not bothering making the mpv code compatible
with as how it was previously implemented (it will just be disabled
with any older libass).

CC: @mpv-player/stable (because mpv-build uses libass git, and this
                        breaks the feature)
2014-10-18 15:05:51 +02:00
wm4 b3707f4e21 audio: don't go to sleep after audio reinit
It possibly goes to sleep without actually starting to decode audio.
Possibly fixes a problem with --no-osc --no-video reported on IRC.

CC: @mpv-player/stable
2014-10-18 15:05:46 +02:00
wm4 af58a8c324 terminal: recognize ^h
Fixes #1185.

CC: @mpv-player/stable
2014-10-18 15:05:35 +02:00
shdown 3fae6aaae8 player: quote %-starting strings
Leading percent sign is a quote indicator so it needs to be quoted
itself.
2014-10-18 15:04:54 +02:00
shdown 919540ce8e common: fix \x-style escaping
This was rejecting correct escapes and accepting incorrect ones.
2014-10-18 15:04:46 +02:00
shdown ad9d1a3fb7 manpage: fix reference to a defunct option
The change was made with faad40aad9.
2014-10-18 15:04:27 +02:00
wm4 f16b1cdc17 player: fix crash on early audio uninit
Could crash when exiting playback in very early stages of
initialization.

CC: @mpv-player/stable
2014-10-16 13:13:26 +02:00
wm4 f2e289dc80 player: fix --frames
This could produce an extra frame, because reaching the maximum merely
signals the playloop to exit, without strictly enforcing the limit.

Fixes #1181.

CC: @mpv-player/stable
2014-10-15 15:15:58 +02:00
wm4 4a0e50d2a6 player: signal EOF when using --frames 2014-10-15 15:15:53 +02:00
wm4 a6eb0714fa demux_mkv: fix undefined behavior
With some files, the extradata variable can remain uninitialized, but
will be used for memory access.

CC: @mpv-player/stable (with high priority)
2014-10-15 15:13:47 +02:00
15 changed files with 71 additions and 21 deletions

No files matched your search

+2 -2
View File
@@ -1137,8 +1137,8 @@ Property list
See ``--ass-style-override``.
``stream-capture`` (RW)
A filename, see ``--capture``. Setting this will start capture using the
given filename. Setting it to an empty string will stop it.
A filename, see ``--stream-capture``. Setting this will start capture using
the given filename. Setting it to an empty string will stop it.
``tv-brightness``, ``tv-contrast``, ``tv-saturation``, ``tv-hue`` (RW)
TV stuff.
+1
View File
@@ -1146,6 +1146,7 @@ Subtitles
:yes: Apply all the ``--ass-*`` style override options. Changing the default
for any of these options can lead to incorrect subtitle rendering
(default).
:signfs: like ``yes``, but apply ``--sub-scale`` only to signs
:no: Render subtitles as forced by subtitle scripts.
:force: Try to force the font style as defined by the ``--sub-text-*``
options. Requires a modified libass, can break rendering easily.
+24
View File
@@ -1,3 +1,27 @@
Release 0.6.2
=============
Changes
-------
- The --ass-style-override option now requires a newer version of libass.
Bug fixes
---------
- Correctly signal EOF when using --frames.
- Strictly endorce the limit imposed by --frames (i.e. avoid producing an extra
frame at the end).
- Fix \x-style escaping when parsing commands.
- Correctly handle ^h key on the terminal (this should fix the when inserted
fromBackspace key on new versions of xterm).
- Don't put the player to sleep after audio reinit.
- Properly exit if both audio and video fail to initialize.
This listing is not complete. There are many more bug fixes and changes. The
complete change log can be viewed by running ``git log a6eb071..0a40fb0`` in
the git repository.
Release 0.6.1
=============
+1 -1
View File
@@ -1 +1 @@
0.6.1
0.6.2
+1 -1
View File
@@ -171,7 +171,7 @@ static bool mp_parse_escape(void *talloc_ctx, bstr *dst, bstr *code)
if (code->start[0] == 'x' && code->len >= 3) {
bstr num = bstr_splice(*code, 1, 3);
char c = bstrtoll(num, &num, 16);
if (!num.len)
if (num.len)
return false;
bstr_xappend(talloc_ctx, dst, (bstr){&c, 1});
*code = bstr_cut(*code, 3);
+1 -1
View File
@@ -1149,7 +1149,7 @@ static const videocodec_info_t vinfo[] = {
static int demux_mkv_open_video(demuxer_t *demuxer, mkv_track_t *track)
{
unsigned char *extradata;
unsigned char *extradata = NULL;
unsigned int extradata_size = 0;
bool raw = false;
struct sh_stream *sh = new_sh_stream(demuxer, STREAM_VIDEO);
+1 -1
View File
@@ -332,7 +332,7 @@ const m_option_t mp_opts[] = {
OPT_CHOICE("ass-shaper", ass_shaper, 0,
({"simple", 0}, {"complex", 1})),
OPT_CHOICE("ass-style-override", ass_style_override, 0,
({"no", 0}, {"yes", 1}, {"force", 3})),
({"no", 0}, {"yes", 1}, {"force", 3}, {"signfs", 4})),
OPT_FLAG("sub-scale-with-window", sub_scale_with_window, 0),
OPT_FLAG("osd-bar", osd_bar_visible, 0),
OPT_FLOATRANGE("osd-bar-align-x", osd_bar_align_x, 0, -1.0, +1.0),
+1
View File
@@ -70,6 +70,7 @@ struct key_entry {
};
static const struct key_entry keys[] = {
{"\010", MP_KEY_BS},
{"\011", MP_KEY_TAB},
{"\012", MP_KEY_ENTER},
{"\177", MP_KEY_BS},
+4 -4
View File
@@ -214,9 +214,8 @@ void reinit_audio_chain(struct MPContext *mpctx)
init_error:
uninit_player(mpctx, INITIALIZED_ACODEC | INITIALIZED_AO);
no_audio:
mp_deselect_track(mpctx, track);
if (track)
MP_INFO(mpctx, "Audio: no audio\n");
error_on_track(mpctx, track);
}
// Return pts value corresponding to the end point of audio written to the
@@ -382,6 +381,7 @@ void fill_audio_out_buffers(struct MPContext *mpctx, double endpts)
return;
}
reinit_audio_chain(mpctx);
mpctx->sleeptime = 0;
return; // try again next iteration
}
@@ -520,8 +520,8 @@ void fill_audio_out_buffers(struct MPContext *mpctx, double endpts)
// Drop data queued for output, or which the AO is currently outputting.
void clear_audio_output_buffers(struct MPContext *mpctx)
{
if (mpctx->ao) {
if (mpctx->ao)
ao_reset(mpctx->ao);
if (mpctx->ao_buffer)
mp_audio_buffer_clear(mpctx->ao_buffer);
}
}
+2
View File
@@ -266,6 +266,8 @@ void mp_get_resume_defaults(struct MPContext *mpctx)
// Should follow what parser-cfg.c does/needs
static bool needs_config_quoting(const char *s)
{
if (s[0] == '%')
return true;
for (int i = 0; s && s[i]; i++) {
unsigned char c = s[i];
if (!mp_isprint(c) || mp_isspace(c) || c == '#' || c == '\'' || c == '"')
+1
View File
@@ -425,6 +425,7 @@ void merge_playlist_files(struct playlist *pl);
float mp_get_cache_percent(struct MPContext *mpctx);
bool mp_get_cache_idle(struct MPContext *mpctx);
void update_window_title(struct MPContext *mpctx, bool force);
void error_on_track(struct MPContext *mpctx, struct track *track);
void stream_dump(struct MPContext *mpctx);
// osd.c
+18
View File
@@ -175,6 +175,24 @@ void update_window_title(struct MPContext *mpctx, bool force)
}
}
void error_on_track(struct MPContext *mpctx, struct track *track)
{
if (!track)
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->current_track[0][STREAM_AUDIO] &&
!mpctx->current_track[0][STREAM_VIDEO])
mpctx->stop_play = PT_NEXT_ENTRY;
mpctx->error_playing = true;
mpctx->sleeptime = 0;
}
}
void stream_dump(struct MPContext *mpctx)
{
struct MPOpts *opts = mpctx->opts;
+1 -1
View File
@@ -748,7 +748,7 @@ static void handle_sstep(struct MPContext *mpctx)
if (mpctx->video_status >= STATUS_EOF) {
if (mpctx->max_frames >= 0)
mpctx->stop_play = PT_NEXT_ENTRY;
mpctx->stop_play = AT_END_OF_FILE; // force EOF even if audio left
if (mpctx->step_frames > 0 && !mpctx->paused)
pause_player(mpctx);
}
+6 -6
View File
@@ -310,7 +310,7 @@ err_out:
no_video:
uninit_player(mpctx, INITIALIZED_VCODEC | (opts->force_vo ? 0 : INITIALIZED_VO));
if (track)
mp_deselect_track(mpctx, track);
error_on_track(mpctx, track);
handle_force_window(mpctx, true);
return 0;
}
@@ -579,7 +579,9 @@ static int video_output_image(struct MPContext *mpctx, double endpts)
&& mpctx->video_status == STATUS_SYNCING;
if (hrseek && img->pts < mpctx->hrseek_pts - .005)
drop = true;
if (endpts != MP_NOPTS_VALUE && img->pts >= endpts) {
if ((endpts != MP_NOPTS_VALUE && img->pts >= endpts) ||
mpctx->max_frames == 0)
{
drop = true;
r = VD_EOF;
}
@@ -806,7 +808,7 @@ void write_video(struct MPContext *mpctx, double endpts)
pause_player(mpctx);
}
if (mpctx->max_frames == 0)
mpctx->stop_play = PT_NEXT_ENTRY;
mpctx->stop_play = AT_END_OF_FILE;
if (mpctx->max_frames > 0)
mpctx->max_frames--;
}
@@ -820,9 +822,7 @@ error:
if (!opts->force_vo)
uninit |= INITIALIZED_VO;
uninit_player(mpctx, uninit);
if (!mpctx->current_track[STREAM_AUDIO])
mpctx->stop_play = PT_NEXT_ENTRY;
mpctx->error_playing = true;
error_on_track(mpctx, mpctx->current_track[STREAM_VIDEO][0]);
handle_force_window(mpctx, true);
mpctx->sleeptime = 0;
}
+7 -4
View File
@@ -136,13 +136,11 @@ void mp_ass_configure(ASS_Renderer *priv, struct MPOpts *opts,
float set_line_spacing = 0;
float set_font_scale = 1;
int set_hinting = 0;
int set_force_override = 0;
if (opts->ass_style_override) {
set_use_margins = opts->ass_use_margins;
set_sub_pos = 100 - opts->sub_pos;
set_line_spacing = opts->ass_line_spacing;
set_hinting = opts->ass_hinting;
set_force_override = opts->ass_style_override == 3;
set_font_scale = opts->sub_scale;
if (opts->sub_scale_with_window) {
int vidh = dim->h - (dim->mt + dim->mb);
@@ -157,8 +155,13 @@ void mp_ass_configure(ASS_Renderer *priv, struct MPOpts *opts,
#if LIBASS_VERSION >= 0x01000000
ass_set_shaper(priv, opts->ass_shaper);
#endif
#if LIBASS_VERSION >= 0x01103000
ass_set_selective_style_override_enabled(priv, set_force_override);
#if LIBASS_VERSION >= 0x01103001
int set_force_flags = 0;
if (opts->ass_style_override == 3)
set_force_flags |= ASS_OVERRIDE_BIT_STYLE | ASS_OVERRIDE_BIT_FONT_SIZE;
if (opts->ass_style_override == 4)
set_force_flags |= ASS_OVERRIDE_BIT_FONT_SIZE;
ass_set_selective_style_override_enabled(priv, set_force_flags);
ASS_Style style = {0};
mp_ass_set_style(&style, 288, opts->sub_text_style);
ass_set_selective_style_override(priv, &style);