Changeset 744

Show
Ignore:
Timestamp:
11/27/07 11:41:54 (10 months ago)
Author:
astrange
Message:

Delegate interlaced H.264 to Apple's decoder. Fix a possible crash.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/perian-1.1/FFusionCodec.c

    r736 r744  
    315315            DisposeImageCodecMPDrawBandUPP(glob->drawBandUPP); 
    316316        } 
    317          
    318         if (glob->avCodec) 
    319         { 
    320             avcodec_close(glob->avContext); 
    321         } 
    322317                                 
    323318        if (glob->avContext) 
     
    326321                                free(glob->avContext->extradata); 
    327322                                                 
     323                        if (glob->avContext->codec) avcodec_close(glob->avContext); 
    328324            av_free(glob->avContext); 
    329325        } 
     
    677673                if(glob->avContext->extradata_size != 0 && glob->begin.parser != NULL) 
    678674                        ffusionParseExtraData(glob->begin.parser, glob->avContext->extradata, glob->avContext->extradata_size); 
     675                 
     676                // XXX: at the moment ffmpeg can't handle interlaced H.264 right 
     677                // specifically PAFF + spatial prediction 
     678                if (codecID == CODEC_ID_H264 && ffusionIsParsedVideoInterlaced(glob->begin.parser)) 
     679                        return -2; 
    679680                 
    680681                // some hooks into ffmpeg's buffer allocation to get frames in  
  • branches/perian-1.1/bitstream_info.c

    r741 r744  
    820820        return 0; 
    821821} 
     822 
     823int ffusionIsParsedVideoInterlaced(FFusionParserContext *parser) 
     824{ 
     825        if (parser->parserStructure == &ffusionH264Parser) { 
     826                H264ParserContext *h264parser = parser->internalContext; 
     827                return !h264parser->frame_mbs_only_flag; 
     828        } 
     829         
     830        return 0; 
     831} 
  • branches/perian-1.1/bitstream_info.h

    r588 r744  
    4343int ffusionParseExtraData(FFusionParserContext *parser, const uint8_t *buf, int buf_size); 
    4444int ffusionParse(FFusionParserContext *parser, const uint8_t *buf, int buf_size, int *out_buf_size, int *type, int *skippable); 
     45int ffusionIsParsedVideoInterlaced(FFusionParserContext *parser); 
    4546 
    4647#ifdef __cplusplus