Sanity check, in drawDynamicData you're calling showJPEG() with one
argument, instead of the 2 it expects... then, in showJPEG(), you're
walking into an array offset by the unprovided argument
(simpleScreens[screenIdx]).  Because screenIdx is random and
uninitialized, simpleScreens[screenIdx] may be a mis-aligned word...
causing the alignment trap to fire.
 
Either this is cut-n-paste error (so please re-send the "real" code), or
you're not listening to your build warnings(!) which probably flag this.
 
Chris


________________________________

        From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Quan Nguyen
        Sent: Wednesday, December 20, 2006 1:33 AM
        To: Leonardo DaVinci
        Subject: show JPEG on OSD
        
        
        Hi , 
         
        I want to view JPEG while decoding video. So , I wrote some code
and embed it to DECODE demo of DaVinci.
         
        Below are 2 functions : 
            -     showJPEG which I put in ui.c (
/home/<user>/dvevm_1_00_00_32/demos/decode )
            -     drawDynamicData : which I modified to show JPG only in
ctrl.c ( /home/<user>/dvevm_1_00_00_32/demos/decode )
         
        When I ran , i got the following error which is unclear to me : 
         
        ShoAlignment trap: decode (1087) PC=0x00010ff0 Instr=0xe19310be
Address=0x005201w
        Bus error
         
        Has anyone got this error before ? How can I solve it ?
         
        Thanks in advance ,
         
        Quan
         
        
        static void drawDynamicData( Engine_Handle hEngine, int osdFd,
int *time,
                                    int *displayIdx , int *workingIdx ,
int option , int p_index)
        {
            showJPEG( "Sunset.jpg" );
// I already used "ls" to check the existence of "Sunset.jpg"
            
            *displayIdx = (*displayIdx + 1) % NUM_BUFS;
            *workingIdx = (*workingIdx + 1) % NUM_BUFS;
            flipOsdBuffers(osdFd, *displayIdx); 
        }
         
        int showJPEG( char *filename , int screenIdx )
        {
            simplewidget_jpeg    swjp;
            fflush( stdout );
            
            if ( simplewidget_jpeg_create( filename , swjp ) ==
SIMPLEWIDGET_FAILURE )
            {
                printf( "Cannot create handle for %s\n" , filename );
                return SIMPLEWIDGET_FAILURE;
            }
         
            if ( simplewidget_jpeg_show( swjp , simpleScreens[screenIdx]
, 0 , 0 ) == SIMPLEWIDGET_FAILURE )
            {
                printf( "Cannot show %s\n" , filename );
                return SIMPLEWIDGET_FAILURE;
            }
         
            if ( simplewidget_jpeg_delete( swjp ) ==
SIMPLEWIDGET_FAILURE )
            {
                printf( "Cannot release resourse of %s\n" , filename );
                return SIMPLEWIDGET_FAILURE;
            }
         
            return SUCCESS;
        }

        __________________________________________________
        Do You Yahoo!?
        Tired of spam? Yahoo! Mail has the best spam protection around 
        http://mail.yahoo.com 

_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to