Changeset 199

Show
Ignore:
Timestamp:
12/09/07 01:31:14 (9 months ago)
Author:
sip
Message:

Fixed seg fault in h264 recording. Still not working perfectly video track is unusable, hint track works fine.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • app_mp4/app_mp4.c

    r197 r199  
    170170                t->sampleId++; 
    171171 
    172                 ast_log(LOG_DEBUG, "New video hint\n"); 
     172                ast_log(LOG_DEBUG, "New video hint [%d,%d,%d,%d]\n",intra,payload,skip,prependLength); 
    173173 
    174174                /* Add hint */ 
     
    757757                                }  
    758758                        } else if (f->subclass & AST_FORMAT_H264) { 
     759                                /* Get packet type */ 
     760                                unsigned char nal = frame[0]; 
     761                                unsigned char type = nal & 0x1f; 
    759762                                /* All intra & first*/ 
    760763                                intra = 1; 
    761764                                first = 1; 
    762                                 /* Save all to the rtp payload */ 
    763                                 video_payload = f->datalen; 
    764                                 /* Don't add frame data to payload */ 
    765                                 skip = f->datalen; 
    766                                 /* And add the data to the frame but not associated with the hint track */ 
    767                                 prependBuffer = f->data+1; 
    768                                 prependLength = f->datalen-1; 
     765                                /* Check nal type */ 
     766                                if (type<23)  
     767                                { 
     768                                        /* And add the data to the frame but not associated with the hint track */ 
     769                                        prependBuffer = "\0\0\1"; 
     770                                        prependLength = 3; 
     771                                        /* Set payload and skip */ 
     772                                        video_payload = 0; 
     773                                        skip = 0; 
     774                                } 
    769775                        } else { 
    770776                                /* Unknown code free it */ 
Copyright 2006 - Sergio García Murillo
Powered by Trac - Edgewall Software