diff options
Diffstat (limited to 'audio/decode')
-rw-r--r-- | audio/decode/ad_spdif.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/audio/decode/ad_spdif.c b/audio/decode/ad_spdif.c index 78e4c4e976..4b3e8149ec 100644 --- a/audio/decode/ad_spdif.c +++ b/audio/decode/ad_spdif.c @@ -137,11 +137,8 @@ static void determine_codec_params(struct dec_audio *da, AVPacket *pkt, if (!ctx) goto done; - if (avcodec_open2(ctx, codec, NULL) < 0) { - av_free(ctx); // don't attempt to avcodec_close() an unopened ctx - ctx = NULL; + if (avcodec_open2(ctx, codec, NULL) < 0) goto done; - } if (avcodec_send_packet(ctx, pkt) < 0) goto done; |