Changeset 232

Show
Ignore:
Timestamp:
01/04/07 17:38:51 (2 years ago)
Author:
gbooker
Message:

Surpress error messages on the B frame detection so it will silently fail if the B frame is not there.
This is not an error message, so don't display it.
closes #82

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/FFusionCodec.c

    r231 r232  
    102102//--------------------------------------------------------------------------- 
    103103 
    104 static OSErr FFusionDecompress(AVCodecContext *context, UInt8 *dataPtr, ICMDataProcRecordPtr dataProc, long width, long height, AVFrame *picture, long length, int useFirstFrameHack); 
     104static OSErr FFusionDecompress(AVCodecContext *context, UInt8 *dataPtr, ICMDataProcRecordPtr dataProc, long width, long height, AVFrame *picture, long length, int useFirstFrameHack, int failSilently); 
    105105static void FastY420(UInt8 *baseAddr, AVFrame *picture); 
    106106static void SlowY420(UInt8 *baseAddr, long rowBump, long width, long height, AVFrame *picture); 
     
    767767         
    768768        avcodec_get_frame_defaults(&tempFrame); 
    769         err = FFusionDecompress(glob->avContext, dataPtr, dataProc, myDrp->width, myDrp->height, &tempFrame, myDrp->bufferSize, useFirstFrameHack); 
     769        err = FFusionDecompress(glob->avContext, dataPtr, dataProc, myDrp->width, myDrp->height, &tempFrame, myDrp->bufferSize, useFirstFrameHack, 0); 
    770770        myDrp->useFuture = false; 
    771771         
     
    790790                        glob->avContext->flags &= ~CODEC_FLAG_LOW_DELAY; 
    791791                        avcodec_flush_buffers(glob->avContext); 
    792                         err = FFusionDecompress(glob->avContext, dataPtr, dataProc, myDrp->width, myDrp->height, glob->picture, myDrp->bufferSize, 1); 
     792                        err = FFusionDecompress(glob->avContext, dataPtr, dataProc, myDrp->width, myDrp->height, glob->picture, myDrp->bufferSize, 1, 0); 
    793793                        glob->delayedFrames = 2; 
    794794                } 
     
    816816                //Check to see if a B-Frame follows this 
    817817                unsigned char nullChars[8] = {0,0,0,0, 0,0,0,0}; 
    818                 err = FFusionDecompress(glob->avContext, nullChars, NULL, myDrp->width, myDrp->height, glob->futureFrame, 8, 0); 
     818                int lastLogLevel = av_log_get_level(); 
     819                av_log_set_level(AV_LOG_QUIET); 
     820                err = FFusionDecompress(glob->avContext, nullChars, NULL, myDrp->width, myDrp->height, glob->futureFrame, 8, 0, 1); 
     821                av_log_set_level(lastLogLevel); 
    819822                if(glob->futureFrame->data[0] != NULL) 
    820823                { 
     
    12231226//----------------------------------------------------------------- 
    12241227 
    1225 OSErr FFusionDecompress(AVCodecContext *context, UInt8 *dataPtr, ICMDataProcRecordPtr dataProc, long width, long height, AVFrame *picture, long length, int useFirstFrameHack
     1228OSErr FFusionDecompress(AVCodecContext *context, UInt8 *dataPtr, ICMDataProcRecordPtr dataProc, long width, long height, AVFrame *picture, long length, int useFirstFrameHack, int failSilently
    12261229{ 
    12271230    OSErr err = noErr; 
     
    12661269            got_picture = 0; 
    12671270            len = 1; 
    1268             Codecprintf(NULL, "Error while decoding frame\n"); 
     1271                        if(!failSilently) 
     1272                                Codecprintf(NULL, "Error while decoding frame\n"); 
    12691273             
    12701274            return noErr;