audio: fix spdif mode

Not sure how this was not caught before. It crashed when trying to use
spdif mode.
This commit is contained in:
wm4 2017-08-23 12:14:11 +02:00
parent f6c4e4ab76
commit 997e1fb621
1 changed files with 2 additions and 2 deletions

View File

@ -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;