From 997e1fb621625da175017e21d6e2d14ab1d0240b Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 23 Aug 2017 12:14:11 +0200 Subject: audio: fix spdif mode Not sure how this was not caught before. It crashed when trying to use spdif mode. --- audio/aframe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'audio') diff --git a/audio/aframe.c b/audio/aframe.c index ad6304230a..cf785f6657 100644 --- a/audio/aframe.c +++ b/audio/aframe.c @@ -252,8 +252,8 @@ bool mp_aframe_set_format(struct mp_aframe *frame, int format) { if (mp_aframe_is_allocated(frame)) return false; - enum AVSampleFormat av_format = frame->av_frame->format; - if (av_format == AV_SAMPLE_FMT_NONE && frame->format) { + enum AVSampleFormat av_format = af_to_avformat(format); + if (av_format == AV_SAMPLE_FMT_NONE && format) { if (!af_fmt_is_spdif(format)) return false; av_format = AV_SAMPLE_FMT_S16; -- cgit v1.2.3