[MPlayer-cvslog] r35517 - trunk/libmpcodecs/ad_spdif.c

reimar subversion at mplayerhq.hu
Thu Nov 29 18:03:05 CET 2012


Author: reimar
Date: Thu Nov 29 18:03:04 2012
New Revision: 35517

Log:
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.

Modified:
   trunk/libmpcodecs/ad_spdif.c

Modified: trunk/libmpcodecs/ad_spdif.c
==============================================================================
--- trunk/libmpcodecs/ad_spdif.c	Thu Nov 29 16:10:27 2012	(r35516)
+++ trunk/libmpcodecs/ad_spdif.c	Thu Nov 29 18:03:04 2012	(r35517)
@@ -137,7 +137,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) {
@@ -145,10 +144,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. "


More information about the MPlayer-cvslog mailing list