2014-12-29 2 views
1

는 FFmpeg avcodec_get_frame_defaults는

내가는 FFmpeg 샘플 코드를 참조는 FFmpeg 간단한 플레이어를 만들기 위해 사용되지 않는 모든

(12)가 처음으로 내가 cmd를 프로젝트를 만든 비주얼 스튜디오와 윈도우 7에서 (https://github.com/phamquy/FFmpeg-tutorial-samples/blob/master/tutorial03.c)

, 링크 및 complie은

괜찮습니다하지만 난 vs12에서 F5를 누르면

1> ConsoleApplication1.cpp (141) : 오류 C4996 : 'avcodec_get_frame_defaults': 더 이상 사용되지 않음으로 선언되었습니다. 실패했습니다. ConsoleApplication1 \ ConsoleApplication1.vcxproj [Debug | x64]

나는 어떻게됩니까?

내가 다시 최신는 FFmpeg의 DLL을 다운로드 할 수 있지만

을 변경 지적 및 구글 난 당신이 알고 있다면 내가 더 idead, 이 없습니다

무엇 대체 놈이야, 무엇이 잘못되었는지 말해주지 않는 어떤 기능 내가 사용하는 따뜻한 답변을 주시기 바랍니다

답변

1

gcc는 오류로 비난 경고를 취급하지 않습니다. avcodec.h에서 'attribute_deprecated'를 삭제하거나 컴파일러 동작을 변경할 수 있습니다.

+0

감사 (4996 해제) – n2v2rda2

3

avcodec_get_frame_defaults에 대한 함수 선언 주위의 의견은 당신이 av_frame_unref를 사용하는 것을 말한다와 코드가 바로 그 일을 할 것 같다 및 sloved : 난 그냥 경고의 #pragma를 추가

void avcodec_get_frame_defaults(AVFrame *frame) 
{ 
#if LIBAVCODEC_VERSION_MAJOR >= 55 
    // extended_data should explicitly be freed when needed, this code is unsafe currently 
    // also this is not compatible to the <55 ABI/API 
    if (frame->extended_data != frame->data && 0) 
     av_freep(&frame->extended_data); 
#endif 

    memset(frame, 0, sizeof(AVFrame)); 
    av_frame_unref(frame); 
}