summaryrefslogtreecommitdiffstats
path: root/audio/filter/af_lavrresample.c
diff options
context:
space:
mode:
authorDiogo Franco (Kovensky) <diogomfranco@gmail.com>2015-04-13 19:55:48 +0900
committerDiogo Franco (Kovensky) <diogomfranco@gmail.com>2015-04-13 19:55:48 +0900
commit3287825bd2ee762a918961383604697358765397 (patch)
treed3513ec0b91a5c3832221c5b74225deb85fb2163 /audio/filter/af_lavrresample.c
parent9e65b5db0bf79b31c7816d1fdba77ea18fe82690 (diff)
parentf43017bfe97c07aa73206d8d1388294cdbee628f (diff)
downloadmpv-3287825bd2ee762a918961383604697358765397.tar.bz2
mpv-3287825bd2ee762a918961383604697358765397.tar.xz
Merge branch 'master' into release/0.9
* master: (39 commits) Update license headers af_lavrresample: minor simplification af_lavrresample: allow resetting output sample format audio/filter: fully renegotiate audio formats on every reconfig DOCS/waf: Edit --enable-feature sentences vo_opengl: slightly simplify check_gl_features() vo_opengl: unify blend-subtitles-res and blend-subtitles vo_opengl: fix blend-subtitles-res=video & anamorphic video manpage: mention how pseudo-gui mode is enabled on win32 main-fn-win: fix handle validity check for XP win32: use pseudo-gui profile when started without stdio win32: only attach to the console from mpv.com win32: use a platform-specific unicode entry-point vo_opengl: add blend-subtitles-res manpage: document pseudo-gui stuff mp_image: remove redundant flags field mp_image: remove redundant chroma_x/y_shift fields mp_image: remove redundant plane_w/h fields player: use config parser for setting up pseudo-gui profile player: change pseudo-gui settings ...
Diffstat (limited to 'audio/filter/af_lavrresample.c')
-rw-r--r--audio/filter/af_lavrresample.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/audio/filter/af_lavrresample.c b/audio/filter/af_lavrresample.c
index 9e4a8adaaa..41d5a8bdf4 100644
--- a/audio/filter/af_lavrresample.c
+++ b/audio/filter/af_lavrresample.c
@@ -2,22 +2,22 @@
* Copyright (c) 2004 Michael Niedermayer <michaelni@gmx.at>
* Copyright (c) 2013 Stefano Pigozzi <stefano.pigozzi@gmail.com>
*
- * This file is part of mpv.
* Based on Michael Niedermayer's lavcresample.
*
- * MPlayer is free software; you can redistribute it and/or modify
+ * 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.
*
- * MPlayer is distributed in the hope that it will be useful,
+ * 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.
*
* You should have received a copy of the GNU General Public License along
- * with MPlayer; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * with mpv. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
@@ -264,12 +264,12 @@ static int configure_lavrr(struct af_instance *af, struct mp_audio *in,
static int control(struct af_instance *af, int cmd, void *arg)
{
- struct af_resample *s = (struct af_resample *) af->priv;
- struct mp_audio *in = (struct mp_audio *) arg;
- struct mp_audio *out = (struct mp_audio *) af->data;
+ struct af_resample *s = af->priv;
switch (cmd) {
case AF_CONTROL_REINIT: {
+ struct mp_audio *in = arg;
+ struct mp_audio *out = af->data;
struct mp_audio orig_in = *in;
if (((out->rate == in->rate) || (out->rate == 0)) &&
@@ -298,10 +298,11 @@ static int control(struct af_instance *af, int cmd, void *arg)
return r;
}
case AF_CONTROL_SET_FORMAT: {
- if (af_to_avformat(*(int*)arg) == AV_SAMPLE_FMT_NONE)
+ int format = *(int *)arg;
+ if (format && af_to_avformat(format) == AV_SAMPLE_FMT_NONE)
return AF_FALSE;
- mp_audio_set_format(af->data, *(int*)arg);
+ mp_audio_set_format(af->data, format);
return AF_OK;
}
case AF_CONTROL_SET_CHANNELS: {
@@ -309,7 +310,7 @@ static int control(struct af_instance *af, int cmd, void *arg)
return AF_OK;
}
case AF_CONTROL_SET_RESAMPLE_RATE:
- out->rate = *(int *)arg;
+ af->data->rate = *(int *)arg;
return AF_OK;
case AF_CONTROL_SET_PLAYBACK_SPEED_RESAMPLE: {
s->playback_speed = *(double *)arg;