aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authork-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2012-05-08 20:22:42 +0000
committerk-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2012-05-08 20:22:42 +0000
commit295a057b3b1ea7b24602e94307f7f11c36d981dd (patch)
tree918326adbc8e6813ad04763ac9f2438de5daa24b
parent38c112b32740e4ba456df8975993b9e90ebe6919 (diff)
downloadusdx-295a057b3b1ea7b24602e94307f7f11c36d981dd.tar.gz
usdx-295a057b3b1ea7b24602e94307f7f11c36d981dd.tar.xz
usdx-295a057b3b1ea7b24602e94307f7f11c36d981dd.zip
untested proposal for replacement of av_find_stream_info by av_read_frame
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2877 b956fd51-792f-4845-bead-9b4dfca2ff2c
-rw-r--r--src/media/UAudioDecoder_FFmpeg.pas9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/media/UAudioDecoder_FFmpeg.pas b/src/media/UAudioDecoder_FFmpeg.pas
index 630ae408..0a760e43 100644
--- a/src/media/UAudioDecoder_FFmpeg.pas
+++ b/src/media/UAudioDecoder_FFmpeg.pas
@@ -273,6 +273,7 @@ end;
function TFFmpegDecodeStream.Open(const Filename: IPath): boolean;
var
SampleFormat: TAudioSampleFormat;
+ TestFrame: TAVPacket;
AVResult: integer;
begin
Result := false;
@@ -306,6 +307,14 @@ begin
Exit;
end;
+{ av_find_stream_info is deprecated and should be replaced by av_read_frame. Untested.
+ if (av_read_frame(fFormatCtx, TestFrame) < 0) then
+ begin
+ Log.LogError('av_read_frame failed: "' + Filename.ToNative + '"', 'UAudio_FFmpeg');
+ Close();
+ Exit;
+ end;
+}
// FIXME: hack used by ffplay. Maybe should not use url_feof() to test for the end
fFormatCtx^.pb.eof_reached := 0;