[mythtv] Patch: MythMusic: Raise "Floating point exception" when playing cd

Ed Wildgoose lists at wildgooses.com
Fri Jan 28 10:00:19 EST 2005


>Corrupting MythMusic when playing cd,
>CdDecoder::chan is 0 (probably same problem to avfDecoder)
>but I don't know what set it.
>  
>

The following patch should fix the problem. Please can someone commit to
CVS. (Sorry for the cockup...)

Ed W

-------------- next part --------------
--- avfdecoder.cpp.bak	2005-01-28 14:45:47.619407304 +0000
+++ avfdecoder.cpp	2005-01-28 14:47:58.697476248 +0000
@@ -171,6 +171,7 @@
     dec_st->codec.channels = audio_dec->channels;
     dec_st->codec.bit_rate = audio_dec->bit_rate;
     av_set_parameters(oc, NULL);
+    chan = audio_dec->channels;
 
     // Prepare the decoding codec
     // The format is different than the codec
@@ -185,7 +186,7 @@
 
     if (output())
     {
-        output()->Reconfigure(16, audio_dec->channels, audio_dec->sample_rate);
+        output()->Reconfigure(16, chan, audio_dec->sample_rate);
     }
     inited = TRUE;
     return TRUE;
--- cddecoder.cpp.bak	2005-01-28 10:28:34.000000000 +0000
+++ cddecoder.cpp	2005-01-28 14:45:09.893007235 +0000
@@ -131,9 +131,10 @@
     curpos = start;
 
     totalTime = ((end - start + 1) * CD_FRAMESAMPLES) / 44100.0;
+    chan = 2;
 
     if (output())
-        output()->Reconfigure(16, 2, 44100);
+        output()->Reconfigure(16, chan, 44100);
 
     inited = TRUE;
     return TRUE;


More information about the mythtv-dev mailing list