[mythtv] [Experimental PATCH] BIG DVB PATCH V3.2 Released

Tj htpc at treblid.dyndns.org
Mon Dec 20 10:35:52 UTC 2004


Tj wrote:

> But mythfrontend crashes...
> ---- mythfronend ---
> 2004-12-20 16:51:21.932 AvFormatDecoder: Could not find decoder for 
> codec (86021) aborting.
> free(): invalid pointer 0xaf3ee0a8!
>
Prob why it crashes on my machine is because in libs/libavformat/mpeg.c, 
ac3 is still looking for 0x80 instead of 0x1bd, and left codec_id 
uninitialised.My diff at the end of this email fixes the crash but 
introduce another problem - switching from a channel with AC3 to a 
channel with MPEG2 will result in the following message "WriteAudio: 
buffer underrun".. The video is fine, but there's no sound. But once I 
restart livetv again, sound is back, until I change channel that uses a 
different codec.

* in mpeg.c, should "#define AC3_ID   0x80" be "#define AC3_ID   0xbd" 
instead? There seem to be inconsisties around AC3_ID..

* the part where I commented out in mpegps_read_pes_header isn't 
correct, but app will crash if I leave it in.. What is the correct way 
to fix this?


Regards.

----- diff file
Index: mpeg.c
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libavformat/mpeg.c,v
retrieving revision 1.23
diff -u -r1.23 mpeg.c
--- mpeg.c    30 Nov 2004 02:27:22 -0000    1.23
+++ mpeg.c    20 Dec 2004 10:17:04 -0000
@@ -1458,13 +1458,13 @@
     else if( c!= 0xf )
         goto redo;
 
-    if (startcode == 0x1bd) {
+    /*if (startcode == 0x1bd) {
         if (len < 1)
             goto redo;
         startcode = get_byte(&s->pb);
         len--;
         if (startcode >= 0x80 && startcode <= 0xbf) {
-            /* audio: skip header */
+            //* audio: skip header
             if (len < 3)
                 goto redo;
             get_byte(&s->pb);
@@ -1472,7 +1472,7 @@
             get_byte(&s->pb);
             len -= 3;
         }
-    }
+    } */
     if(dts != AV_NOPTS_VALUE && ppos && s->build_index){
         int i;
         for(i=0; i<s->nb_streams; i++){
@@ -1512,7 +1512,7 @@
     } else if (startcode >= 0x1c0 && startcode <= 0x1df) {
         type = CODEC_TYPE_AUDIO;
         codec_id = CODEC_ID_MP2;
-    } else if (startcode >= 0x80 && startcode <= 0x89) {
+    } else if (startcode >= 0x1b0 && startcode <= 0x1bf) {
         type = CODEC_TYPE_AUDIO;
         codec_id = CODEC_ID_AC3;
     } else if (startcode >= 0x8a && startcode <= 0x9f) {






More information about the mythtv-dev mailing list