Compare commits

..
8 Commits
Author SHA1 Message Date
wm4 f0d245ce4b Release 0.1.3 2013-08-23 15:50:04 +02:00
Stefano Pigozzi 815ad3f011 cocoa_common: avoid locking calls when not needed
cocoa_common contains some locking calls to support video outputs that support
live resizing (at this moment only vo=opengl).

These should not be used unless the VO declares it is multithreaded by
registering the resize_redraw callback used for live resizing.

Fixes #200
2013-08-23 15:43:46 +02:00
wm4 69d46b1d95 demux: check whether stream is selected in demux_get_next_pts()
Otherwise, this would just try to demux a good chunk of the file, even
though the operation can't succeed anyway.

This caused some pretty strange issues, where perfectly valid use cases
would print a "Too many packets in the demuxer packet queue..." message.
2013-08-22 21:19:40 +02:00
wm4 0440561c99 demux_raw: read multiple frames per packet
The rawaudio demuxer read one frame per packet, basically a few bytes,
which caused insane overhead. (I found this when I couldn't play raw
audio without dropouts when using -v, which printed a line per packet
read.)

Fix this and read 1 second of audio per packet. This is a regression
since cfa5712 (merging of demux_rawaudio and demux_rawvideo).
2013-08-22 21:19:34 +02:00
Stefano Pigozzi 2a172a98fd cocoa_common: fix window positioning with --geometry
Regression since ff3b98d11c. The window positioning code relied on the
visibleFrame's height without taking into account the dock's presence.

Also moved the constraining code to the proper method that overrides the
original NSWindow behaviour. This avoids having to check for border since the
constraining is performed by Cocoa only for titled windows.

Fixes #190
2013-08-22 21:19:20 +02:00
Cheng Sun 421eebc8f1 manpage: fix (again) incorrect ao_alsa example
One example in ao.rst used the old syntax with misspelling of "no-block".
2013-08-22 21:19:12 +02:00
wm4 ab3bafc750 vf_eq: fix behavior when changing parameters
Using -vf eq and changing brightness, contrast, etc. using key bindings
with e.g. "add brightness 1" didn't work well: with step width 1, the
property gets easily "stuck". This is a rounding problem: e.g. setting
gamma to 3 would actually make it report that gamma is set to 2, so
the "add" command will obviously never reach 3 with a step width of 1.
Fix this by storing the parameters as integers.

This was broken in cac7702. This commit effectively changed these
properties to use the value as reported by vf_eq, instead of the
previously set value for the "add" command. This was more robust,
but not very correct either, so we keep the new behavior and make
vf_eq report its parameters more accurately.
2013-08-22 21:19:08 +02:00
wm4 d3f7248ca9 m_option: make "add speed 0.1" command work
Was broken since the speed property was switched from float to double.
2013-08-19 22:33:39 +02:00
7 changed files with 29 additions and 20 deletions

No files matched your search

+1 -1
View File
@@ -17,7 +17,7 @@ in the list. Suboptions are optional and can mostly be omitted.
.. admonition:: Examples
- ``--ao=alsa,oss,`` Try the ALSA driver, then the OSS driver, then others.
- ``--ao=alsa:noblock:device=[hw:0,3]`` Sets noblock-mode and the
- ``--ao=alsa:no-block:device=[hw:0,3]`` Sets noblock-mode and the
device-name as first card, fourth device.
Available audio output drivers are:
+1 -1
View File
@@ -1 +1 @@
0.1.2
0.1.3
+1 -1
View File
@@ -466,7 +466,7 @@ struct demux_packet *demux_read_packet(struct sh_stream *sh)
// packets from the queue.
double demux_get_next_pts(struct sh_stream *sh)
{
if (sh) {
if (sh && sh->ds->selected) {
ds_get_packets(sh);
if (sh->ds->head)
return sh->ds->head->pts;
+4 -1
View File
@@ -35,6 +35,7 @@
struct priv {
int frame_size;
int read_frames;
double frame_rate;
};
@@ -107,6 +108,7 @@ static int demux_rawaudio_open(demuxer_t *demuxer, enum demux_check check)
*p = (struct priv) {
.frame_size = samplesize * sh_audio->channels.num,
.frame_rate = samplerate,
.read_frames = samplerate,
};
return 0;
@@ -191,6 +193,7 @@ static int demux_rawvideo_open(demuxer_t *demuxer, enum demux_check check)
*p = (struct priv) {
.frame_size = imgsize,
.frame_rate = fps,
.read_frames = 1,
};
return 0;
@@ -203,7 +206,7 @@ static int raw_fill_buffer(demuxer_t *demuxer)
if (demuxer->stream->eof)
return 0;
struct demux_packet *dp = new_demux_packet(p->frame_size);
struct demux_packet *dp = new_demux_packet(p->frame_size * p->read_frames);
dp->pos = stream_tell(demuxer->stream) - demuxer->movi_start;
dp->pts = (dp->pos / p->frame_size) / p->frame_rate;
+1
View File
@@ -651,6 +651,7 @@ const m_option_type_t m_option_type_double = {
.pretty_print = print_double_f3,
.copy = copy_opt,
.clamp = clamp_double,
.add = add_double,
};
#undef VAL
+14 -4
View File
@@ -72,6 +72,8 @@ typedef struct vf_priv_s {
unsigned buf_w[3];
unsigned buf_h[3];
unsigned char *buf[3];
int gamma_i, contrast_i, brightness_i, saturation_i;
} vf_eq2_t;
@@ -381,18 +383,22 @@ int control (vf_instance_t *vf, int request, void *data)
if (strcmp (eq->item, "gamma") == 0) {
set_gamma (vf->priv, exp (log (8.0) * eq->value / 100.0));
vf->priv->gamma_i = eq->value;
return CONTROL_TRUE;
}
else if (strcmp (eq->item, "contrast") == 0) {
set_contrast (vf->priv, (1.0 / 100.0) * (eq->value + 100));
vf->priv->contrast_i = eq->value;
return CONTROL_TRUE;
}
else if (strcmp (eq->item, "brightness") == 0) {
set_brightness (vf->priv, (1.0 / 100.0) * eq->value);
vf->priv->brightness_i = eq->value;
return CONTROL_TRUE;
}
else if (strcmp (eq->item, "saturation") == 0) {
set_saturation (vf->priv, (double) (eq->value + 100) / 100.0);
vf->priv->saturation_i = eq->value;
return CONTROL_TRUE;
}
break;
@@ -400,19 +406,19 @@ int control (vf_instance_t *vf, int request, void *data)
case VFCTRL_GET_EQUALIZER:
eq = (vf_equalizer_t *) data;
if (strcmp (eq->item, "gamma") == 0) {
eq->value = (int) (100.0 * log (vf->priv->gamma) / log (8.0));
eq->value = vf->priv->gamma_i;
return CONTROL_TRUE;
}
else if (strcmp (eq->item, "contrast") == 0) {
eq->value = (int) (100.0 * vf->priv->contrast) - 100;
eq->value = vf->priv->contrast_i;
return CONTROL_TRUE;
}
else if (strcmp (eq->item, "brightness") == 0) {
eq->value = (int) (100.0 * vf->priv->brightness);
eq->value = vf->priv->brightness_i;
return CONTROL_TRUE;
}
else if (strcmp (eq->item, "saturation") == 0) {
eq->value = (int) (100.0 * vf->priv->saturation) - 100;
eq->value = vf->priv->saturation_i;
return CONTROL_TRUE;
}
break;
@@ -503,9 +509,13 @@ int vf_open(vf_instance_t *vf, char *args)
eq2->gamma_weight = par[7];
set_gamma (eq2, par[0]);
eq2->gamma_i = (int) (100.0 * log (vf->priv->gamma) / log (8.0));
set_contrast (eq2, par[1]);
eq2->contrast_i = (int) (100.0 * vf->priv->contrast) - 100;
set_brightness (eq2, par[2]);
eq2->brightness_i = (int) (100.0 * vf->priv->brightness);
set_saturation (eq2, par[3]);
eq2->saturation_i = (int) (100.0 * vf->priv->saturation) - 100;
}
return 1;
+7 -12
View File
@@ -523,7 +523,7 @@ int vo_cocoa_check_events(struct vo *vo)
void vo_cocoa_fullscreen(struct vo *vo)
{
if (![NSThread isMainThread]) {
if (![NSThread isMainThread] && resize_callback_registered(vo)) {
// This is the secondary thread, unlock since we are going to invoke a
// method synchronously on the GUI thread using Cocoa.
vo_cocoa_set_current_context(vo, false);
@@ -535,7 +535,7 @@ void vo_cocoa_fullscreen(struct vo *vo)
waitUntilDone:YES];
if (![NSThread isMainThread]) {
if (![NSThread isMainThread] && resize_callback_registered(vo)) {
// Now lock again!
vo_cocoa_set_current_context(vo, true);
}
@@ -762,20 +762,15 @@ int vo_cocoa_cgl_color_size(struct vo *vo)
CGFloat dx = (f.size.width - ns.width) / 2;
CGFloat dy = (f.size.height - ns.height - [self titleHeight]) / 2;
NSRect nf = NSRectFromCGRect(CGRectInset(NSRectToCGRect(f), dx, dy));
struct vo *vo = self.videoOutput;
if (!(vo && !vo->opts->border)) {
NSRect s = [[self screen] visibleFrame];
if (nf.origin.y + nf.size.height > s.origin.y + s.size.height)
nf.origin.y = s.size.height - nf.size.height;
}
[self setFrame:nf display:NO animate:NO];
}
- (NSRect)constrainFrameRect:(NSRect)rect toScreen:(NSScreen *)screen
- (NSRect)constrainFrameRect:(NSRect)nf toScreen:(NSScreen *)screen
{
return rect;
NSRect s = [[self screen] visibleFrame];
if (nf.origin.y + nf.size.height > s.origin.y + s.size.height)
nf.origin.y = s.origin.y + s.size.height - nf.size.height;
return nf;
}
@end