@mercury
it’s no need to change LibFFplay when update ffmpeg to a new version
It's not that simple: Have a Look at former Versions of FFmpeg/FFPlay, and You'll see, that the Developers do
Changes quite often (Restructuring Code, diverse Renamings, Changing DataStructures, etc.).
But, of course, 'LibFFplay' needs much less Adaptations to newer FFmpeg-Versions than my 'FFPlay4Laz'.
See http://dranger.com... + You must synchronize it yourself
Thanks - I know that Link, and the Tutorial, and its Content.
I wasn't talking about the Synchronization of VideoFrames by Time, only about
the Order, in which they are output by FFmpeg.
Please post your environment details
OS : WinXP SP3 32bit.
Compiler: MinGW32 with the 'gcc v4.9.2', that comes with CodeBlocks v16.01.
FFmpeg : Zeranoe's Dev-Build of FFmpeg v2.8.6 for Windows 32bit, see:
https://ffmpeg.zeranoe.com/builds/win32/dev/ -> 'ffmpeg-2.8.6-win32-dev.7z'
The pre-compiled library...
Which "pre-compiled library" ? - You included the Headers, but Your 'LibFFplay\lib'-Folder is empty.
...and demo are tested under Windows XP to 8.1 both x86 & x64.
Sorry, but whatever I tried, either with Your compiled Binaries ('libffplay.dll', 'project1.exe'), or
with Your CodeBlock-/Lazarus-ProjectFiles, I always got the same Result:
The Host-App opens; Audio- and Video-Files are loaded and played; Seeking, Audio-Playback and VolumeSetting work, but:
There is no VideoImage, even not a black Screen.So I had a deeper Look on Your Code...and made some Changes on it.
MainChanges:- Added: '#define MAKE_FFPLAY_DLL' for conditional Compilation.
-> Now, You can switch between the original EXE-Code, and the modified DLL-Code.
Furthermore, anyone can find easily the Modifications for the DLL, w/o further Documentation.
- Deleted: Your Code to "Create a 32-bit surface"; it's not needed to export VideoFrame-Data itself.
- Rewritten: The Code to export the VideoFrames (= still BEFORE being put into the FrameQueue).
-> Now(!), I have a runnig Video, furthermore with fewer Modifications on the original C-File.
- Reactivated: The Code to display and resize the SDL-Screen.
-> Now, You can see the original SDL-Screen and the currently exported VideoImages simultaneously.
-> Indeed, the Sync-Difference is not very big, but there is, specially after Seeking.
=> Consider exporting VideoData AFTER the FrameQueue.
- I used Zeranoe's Dev-Builds:
-> Pros: - No Need to build the entire FFmpeg-Project -> faster.
- No Internet needed for Building.
(BTW: Afaik, building FFmpeg is as good as impossible w/o InternetConnection.)
- The resulting 'libffplay.dll' is much smaller (only 136KB) -> easier to redistribute.
-> Cons: - No more single LibFFPlay-DLL.
- You have to add the corresponding FFmpeg-DLLs, downloadable e.g. here:
https://ffmpeg.zeranoe.com/builds/win32/shared/ -> Download 'ffmpeg-2.8.6-win32-shared.7z'.
The 'ffplay.c' with my Modifications and the resulting 'libffplay.dll' are in the Attachment(= 'LibFFPlay_ModifiedByMetis_01.7z').
Note:Pause/Resume will raise Error "Invalid floating point operation" with Your 'project1.exe', but
this is not the DLL's Fault.
-> You should check Your 'Demo Pascal' in
Debug-Mode - You will be surprised.
Keep on going - will be nice.
What's Your DeadLine ?