diff options
author | wm4 <wm4@nowhere> | 2015-06-22 15:02:03 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-06-22 16:03:07 +0200 |
commit | 3d55340c6d22e68ee6b9eaac44fa80969fc1ba4b (patch) | |
tree | 2ebb2803c491746ae3bd9268ee18ccf9e53e5fd8 /audio/filter/af.c | |
parent | 17e8815e3769c4c6940828b00815df3fe663d9e0 (diff) | |
download | mpv-3d55340c6d22e68ee6b9eaac44fa80969fc1ba4b.tar.bz2 mpv-3d55340c6d22e68ee6b9eaac44fa80969fc1ba4b.tar.xz |
af: restore detaching of PCM filters when using spdif
Basically, af_fix_format_conversion() behaves stupid you insert a
conversion filter that won't work, and adding back the conversion test
function is the simplest fix to it.
Diffstat (limited to 'audio/filter/af.c')
-rw-r--r-- | audio/filter/af.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/audio/filter/af.c b/audio/filter/af.c index e67fc29203..3e7fdf045a 100644 --- a/audio/filter/af.c +++ b/audio/filter/af.c @@ -352,18 +352,23 @@ static int af_fix_format_conversion(struct af_stream *s, return AF_FALSE; int dstfmt = in.format; char *filter = "lavrresample"; + if (!af_lavrresample_test_conversion(actual.format, dstfmt)) + return AF_ERROR; if (strcmp(filter, prev->info->name) == 0) { if (prev->control(prev, AF_CONTROL_SET_FORMAT, &dstfmt) == AF_OK) { *p_af = prev; return AF_OK; } + return AF_ERROR; } struct af_instance *new = af_prepend(s, af, filter, NULL); if (new == NULL) return AF_ERROR; new->auto_inserted = true; - if (AF_OK != (rv = new->control(new, AF_CONTROL_SET_FORMAT, &dstfmt))) + if (AF_OK != (rv = new->control(new, AF_CONTROL_SET_FORMAT, &dstfmt))) { + af_remove(s, new); return rv; + } *p_af = new; return AF_OK; } |