aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/FFmpeg_Test6.pas40
-rw-r--r--test/menuswoosh.mp3bin0 -> 5246 bytes
2 files changed, 40 insertions, 0 deletions
diff --git a/test/FFmpeg_Test6.pas b/test/FFmpeg_Test6.pas
new file mode 100644
index 00000000..88751853
--- /dev/null
+++ b/test/FFmpeg_Test6.pas
@@ -0,0 +1,40 @@
+Program FFmpeg_Test6;
+
+{$IFDEF FPC}
+ {$MODE Delphi}
+{$ENDIF}
+
+(**
+ * Test of function TFFmpegDecodeStream.Open in media/UAudioDecoder_FFmpeg.pas
+ * after configure for selecting the installed FFmpeg lib compile with:
+ *
+ * fpc -Fi../src -Fu../src/base -Fu../src/lib/FFmpeg-0.... FFmpeg_Test6.pas
+ *)
+
+uses
+ avcodec,
+ avformat;
+
+const
+ Filename: PAnsiChar = 'menuswoosh.mp3';
+
+var
+ fFormatCtx: PAVFormatContext;
+ TestFrame: TAVPacket;
+
+begin
+ av_register_all;
+ if (av_open_input_file(fFormatCtx, Filename, nil, 0, nil) <> 0) then
+ writeln('av_open_input_file failed: File not found: ', Filename);
+
+ if (av_read_frame(fFormatCtx, TestFrame) < 0) then
+ writeln('av_read_frame failed');
+
+ dump_format(fFormatCtx, 0, argv[1], 0);
+
+ if (fFormatCtx <> nil) then
+ begin
+ av_close_input_file(fFormatCtx);
+ fFormatCtx := nil;
+ end;
+end.
diff --git a/test/menuswoosh.mp3 b/test/menuswoosh.mp3
new file mode 100644
index 00000000..1025a86f
--- /dev/null
+++ b/test/menuswoosh.mp3
Binary files differ