summaryrefslogtreecommitdiffstats
path: root/audio/decode/ad_spdif.c
diff options
context:
space:
mode:
Diffstat (limited to 'audio/decode/ad_spdif.c')
-rw-r--r--audio/decode/ad_spdif.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/audio/decode/ad_spdif.c b/audio/decode/ad_spdif.c
index f4fc430208..d0fa43aa25 100644
--- a/audio/decode/ad_spdif.c
+++ b/audio/decode/ad_spdif.c
@@ -220,12 +220,14 @@ static int decode_audio(sh_audio_t *sh, unsigned char *buf,
sh->pts = mpkt->pts;
sh->pts_bytes = 0;
}
+ int out_len = spdif_ctx->out_buffer_len;
int ret = lavf_ctx->oformat->write_packet(lavf_ctx, &pkt);
+ avio_flush(lavf_ctx->pb);
+ sh->pts_bytes += spdif_ctx->out_buffer_len - out_len;
talloc_free(mpkt);
if (ret < 0)
break;
}
- sh->pts_bytes += spdif_ctx->out_buffer_len;
return spdif_ctx->out_buffer_len;
}