[MPlayer-users] For A'rpi: sig11 MPEG uploaded

D J Hawkey Jr hawkeyd at visi.com
Tue Nov 20 14:54:59 CET 2001


On Nov 20, at 12:58 AM, Arpi wrote:
> 
> > > On Mon, Nov 19, 2001 at 01:14:46PM -0600, D J Hawkey Jr wrote:
> > > [.. mpeg bug ..]
> > 
> > No comment about the libmpeg2 bug?
> 
> I've checked it but it doesn't seems to be buggy.
> Your "fix" break things i think, as it doesn't restore signal handler
> and doesn't clean up decoder. It should work this way without your fix.
> Please upload this buggy mpg i'll check.

OK, you got it.

    [sheol] ~/tmp$ cksum causes_sig11_at_current_0x83118fe.mpg
    1354070536 20480000 causes_sig11_at_current_0x83118fe.mpg


You were right about my patch, of course. I changed it as follows:

===8<===

--- decode.c.orig	Thu Nov  8 20:17:01 2001
+++ decode.c	Tue Nov 20 06:40:58 2001
@@ -318,7 +318,10 @@
 
 static jmp_buf mpeg2_jmp_buf;
 
+static int mpeg2_sig11ed = 0; /* djhjr - 11/18/01 */
+
 static void mpeg2_sighandler(int sig){
+    mpeg2_sig11ed = 1; /* djhjr - 11/18/01 */
     longjmp(mpeg2_jmp_buf,1);
 }
 
@@ -335,10 +338,18 @@
   void* old_sigh;
 
   if(setjmp(mpeg2_jmp_buf)!=0){
+      mpeg2_sig11ed = 0; /* djhjr - 11/18/01 */
       printf("@@@ FATAL!!!??? libmpeg2 returned from sig11 before the actual decoding! @@@\n");
       return 0;
   }
 
+  /* djhjr - 11/18/01 */
+  if (mpeg2_sig11ed)
+  {
+      mpeg2_sig11ed = 0;
+      printf("@@@ libmpeg2 after sig11: current=%p end=%p @@@\n", current, end);
+  }
+
   old_sigh=signal(SIGSEGV,mpeg2_sighandler);
 
 //  printf("RCVD %d bytes\n",end-current);
@@ -365,7 +376,11 @@
 #ifdef ARCH_X86
 	    if (config.flags & MM_ACCEL_X86_MMX) emms ();
 #endif
-      printf("@@@ libmpeg2 returned from sig11... (bad file?) @@@\n");
+      printf("@@@ libmpeg2 returned from sig11: current=%p end=%p @@@\n", current, end);
+
+      /* djhjr - 11/18/01 */
+      signal(SIGSEGV, old_sigh);
+      return 0;
     }
   }
   //--------------------

===>8===

The returned messages are:

  @@@ libmpeg2 returned from sig11: current=0x83118fe end=0x8311c04 @@@
  @@@ libmpeg2 after sig11: current=0x8311000 end=0x8314304 @@@

The net result (to my eyes) is a slight and brief slowdown in playback
(but no dropped frames). Is this due to the inner "while (current < end)"
loop when mpeg2_decode_data() is re-entered?

Do the above messages indicate that several frames (the (uint8_t *)current
and (uint8_t *)end are frame pointers, right?) are being replayed, but I
just can't see it? On re-entry, I tried setting current to the sig11's
end, and let things proceed from there, but that resulted in a noticable
skip and/or flash. I confess to complete ignorance with regard to MPEGs
and how they're processed.

Anyway, let my know what you think of the above patch, and what you
discover as you muck with the offending MPEG.

> A'rpi / Astral & ESP-team

Thanks,
Dave

-- 
  ______________________                         ______________________
  \__________________   \    D. J. HAWKEY JR.   /   __________________/
     \________________/\     hawkeyd at visi.com    /\________________/
                      http://www.visi.com/~hawkeyd/




More information about the MPlayer-users mailing list