# HG changeset patch # User reimar # Date 1354208584 0 # Node ID eef7c4527712c9a9004c650ac4153eb5cd0cd758 # Parent 696a8a16595238f07e0b7fac89e8034bb12ee3c3 Do not fall back to 0 for samplerate when parser is not initialized. Might fix some issues with using -ac spdifenc with audio in MKV or MP4. diff -r 696a8a165952 -r eef7c4527712 libmpcodecs/ad_spdif.c --- a/libmpcodecs/ad_spdif.c Thu Nov 29 15:10:27 2012 +0000 +++ b/libmpcodecs/ad_spdif.c Thu Nov 29 17:03:04 2012 +0000 @@ -137,7 +137,6 @@ } // get sample_rate & bitrate from parser - bps = srate = 0; x = ds_get_packet_pts(sh->ds, &start, &pts); in_size = x; if (x <= 0) { @@ -145,10 +144,9 @@ 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. "