diff options
author | wm4 <wm4@nowhere> | 2016-01-21 22:10:15 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-01-22 00:25:44 +0100 |
commit | fef8b7984be5a6244612d346bd60d2badd4a2e63 (patch) | |
tree | 9a9c4ef4b3cbe9d8ee0854a77913df8ce00dab8f /audio/decode/ad_spdif.c | |
parent | 27ecc417fedf25b2408e49fafdae4421d5115532 (diff) | |
download | mpv-fef8b7984be5a6244612d346bd60d2badd4a2e63.tar.bz2 mpv-fef8b7984be5a6244612d346bd60d2badd4a2e63.tar.xz |
audio: refactor: work towards unentangling audio decoding and filtering
Similar to the video path. dec_audio.c now handles decoding only. It
also looks very similar to dec_video.c, and actually contains some of
the rewritten code from it. (A further goal might be unifying the
decoders, I guess.)
High potential for regressions.
Diffstat (limited to 'audio/decode/ad_spdif.c')
-rw-r--r-- | audio/decode/ad_spdif.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/audio/decode/ad_spdif.c b/audio/decode/ad_spdif.c index 54e52a9566..7298d9e7d7 100644 --- a/audio/decode/ad_spdif.c +++ b/audio/decode/ad_spdif.c @@ -251,7 +251,7 @@ static int decode_packet(struct dec_audio *da, struct demux_packet *mpkt, spdif_ctx->out_buffer_len = 0; if (!mpkt) - return AD_EOF; + return 0; double pts = mpkt->pts; @@ -261,17 +261,17 @@ static int decode_packet(struct dec_audio *da, struct demux_packet *mpkt, pkt.pts = pkt.dts = 0; if (!spdif_ctx->lavf_ctx) { if (init_filter(da, &pkt) < 0) - return AD_ERR; + return -1; } int ret = av_write_frame(spdif_ctx->lavf_ctx, &pkt); avio_flush(spdif_ctx->lavf_ctx->pb); if (ret < 0) - return AD_ERR; + return -1; int samples = spdif_ctx->out_buffer_len / spdif_ctx->fmt.sstride; *out = mp_audio_pool_get(spdif_ctx->pool, &spdif_ctx->fmt, samples); if (!*out) - return AD_ERR; + return -1; memcpy((*out)->planes[0], spdif_ctx->out_buffer, spdif_ctx->out_buffer_len); (*out)->pts = pts; |