*@important if data is corrupted, occur segment fault by av_find_stream_info().
* - fixed 2009-06-25.
*/
-#ifdef __MMFILE_FFMPEG_V100__
if (formatContext->cdis != 1)
ret = avformat_find_stream_info(pFormatCtx, NULL);
else
ret = 0;
-#else
- ret = av_find_stream_info(pFormatCtx);
-#endif
+
if (ret < 0) {
debug_warning(DEBUG, "failed to find stream info. errcode = %d\n", ret);
goto exception;
}
if (pFormatCtx) {
-#ifdef __MMFILE_FFMPEG_V100__
avformat_close_input(&pFormatCtx);
-#else
- av_close_input_file(pFormatCtx);
-#endif
formatContext->privateFormatData = NULL;
}
/*set workaround bug flag*/
pVideoCodecCtx->workaround_bugs = FF_BUG_AUTODETECT;
-#ifdef __MMFILE_FFMPEG_V100__
+
/* this is solution for PLM issue P13091703323 */
/* If using thread when decoding frame, the result of decoding is not always same.
Thumbnail of video content is different with original file when copying file. */
pVideoCodecCtx->thread_type = 0;
pVideoCodecCtx->thread_count = 0;
ret = avcodec_open2(pVideoCodecCtx, pVideoCodec, NULL);
-#else
- ret = avcodec_open(pVideoCodecCtx, pVideoCodec);
-#endif
if (ret < 0) {
debug_error(DEBUG, "error: avcodec_open fail.\n");
return MMFILE_FORMAT_FAIL;
AVFormatContext *pFormatCtx = formatContext->privateFormatData;
if (pFormatCtx) {
-#ifdef __MMFILE_FFMPEG_V100__
avformat_close_input(&pFormatCtx);
-#else
- av_close_input_file(pFormatCtx);
-#endif
formatContext->privateFormatData = NULL;
}
AVPacket packet;
/* Retrieve stream information */
-#ifdef __MMFILE_FFMPEG_V100__
if (avformat_find_stream_info(pFormatCtx, NULL) < 0) {
-#else
- if (av_find_stream_info(pFormatCtx) < 0) {
-#endif
debug_error(DEBUG, "error : av_find_stream_info failed");
ret = MMFILE_FORMAT_FAIL;
goto exception; /* Couldn't find stream information */
}
/* Open codec */
-#ifdef __MMFILE_FFMPEG_V100__
pVideoCodecCtx->thread_type = 0;
pVideoCodecCtx->thread_count = 0;
if (avcodec_open2(pVideoCodecCtx, pVideoCodec, NULL) < 0) {
-#else
- if (avcodec_open(pVideoCodecCtx, pVideoCodec) < 0) {
-#endif
debug_error(DEBUG, "error : avcodec_open failed");
ret = MMFILE_FORMAT_FAIL;
goto exception;; /*Could not open codec */