From ea12deb3248317b79ab12c056a00b69382e35e73 Mon Sep 17 00:00:00 2001 From: lotanrm Date: Thu, 11 Jul 2013 09:29:14 +0000 Subject: Added compilation condition to new UMediaCore_FFmpeg functions to make earlier builds work again. git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2999 b956fd51-792f-4845-bead-9b4dfca2ff2c --- src/media/UMediaCore_FFmpeg.pas | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/media/UMediaCore_FFmpeg.pas b/src/media/UMediaCore_FFmpeg.pas index d006e0d1..1b794c7e 100644 --- a/src/media/UMediaCore_FFmpeg.pas +++ b/src/media/UMediaCore_FFmpeg.pas @@ -512,20 +512,26 @@ var h: Pointer; buffer: Pointer; begin + {$IF LIBAVFORMAT_VERSION >= 54029104} ps^ := avformat_alloc_context(); buffer := av_malloc(BLOCKSIZE); FFmpegStreamOpen(h, filename, URL_RDONLY); ps^^.pb := avio_alloc_context(buffer, BLOCKSIZE, 0, h, FFmpegStreamRead, FFmpegStreamWrite, FFmpegStreamSeek); Result := avformat_open_input(ps, filename, nil, nil); + {$ELSE} + Result := 0; + {$ENDIF} end; procedure TMediaCore_FFmpeg.AVFormatCloseInput(ps: PPAVFormatContext); begin + {$IF LIBAVFORMAT_VERSION >= 54029104} av_free(ps^^.pb.buffer); FFmpegStreamClose(ps^^.pb.opaque); { avformat_close_input frees AVIOContext pb, no avio_close needed } { avformat_close_input frees AVFormatContext, no additional avformat_free_context needed } avformat_close_input(ps); + {$ENDIF} end; { TPacketQueue } -- cgit v1.2.3