ad_spdif: take care of deprecated libavcodec API usage

This commit is contained in:
wm4 2016-04-20 19:37:45 +02:00
parent 60664bc00b
commit 78346e9c9a
1 changed files with 7 additions and 0 deletions

View File

@ -116,9 +116,16 @@ static int determine_codec_profile(struct dec_audio *da, AVPacket *pkt)
goto done;
}
#if HAVE_AVCODEC_NEW_CODEC_API
if (avcodec_send_packet(ctx, pkt) < 0)
goto done;
if (avcodec_receive_frame(ctx, frame) < 0)
goto done;
#else
int got_frame = 0;
if (avcodec_decode_audio4(ctx, frame, &got_frame, pkt) < 1 || !got_frame)
goto done;
#endif
profile = ctx->profile;