summaryrefslogtreecommitdiffstats
path: root/audio/decode
diff options
context:
space:
mode:
Diffstat (limited to 'audio/decode')
-rw-r--r--audio/decode/ad_spdif.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/audio/decode/ad_spdif.c b/audio/decode/ad_spdif.c
index c22280cbf0..d8cf731d38 100644
--- a/audio/decode/ad_spdif.c
+++ b/audio/decode/ad_spdif.c
@@ -136,7 +136,6 @@ static int init(sh_audio_t *sh)
}
// get sample_rate & bitrate from parser
- bps = srate = 0;
x = ds_get_packet_pts(sh->ds, &start, &pts);
in_size = x;
if (x <= 0) {
@@ -144,10 +143,9 @@ static int init(sh_audio_t *sh)
x = 0;
}
ds_parse(sh->ds, &start, &x, pts, 0);
- if (x == 0) { // not enough buffer
- srate = 48000; //fake value
- bps = 768000/8; //fake value
- } else if (sh->avctx) {
+ srate = 48000; //fake value
+ bps = 768000/8; //fake value
+ if (x && sh->avctx) { // we have parser and large enough buffer
if (sh->avctx->sample_rate < 44100) {
mp_msg(MSGT_DECAUDIO,MSGL_INFO,
"This stream sample_rate[%d Hz] may be broken. "
@@ -170,7 +168,7 @@ static int init(sh_audio_t *sh)
break;
case CODEC_ID_AC3:
spdif_ctx->iec61937_packet_size = 6144;
- sh->sample_format = AF_FORMAT_IEC61937_LE;
+ sh->sample_format = AF_FORMAT_AC3_LE;
sh->samplerate = srate;
sh->channels = 2;
sh->i_bps = bps;