aboutsummaryrefslogtreecommitdiffstats
path: root/src/media
diff options
context:
space:
mode:
Diffstat (limited to 'src/media')
-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;