Skip to content
This repository was archived by the owner on May 21, 2025. It is now read-only.

Commit 30a6544

Browse files
committed
krkrwine v9.0 - rewrite almost everything
1 parent c202934 commit 30a6544

File tree

9 files changed

+785
-2251
lines changed

9 files changed

+785
-2251
lines changed

Makefile

Lines changed: 36 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -28,31 +28,34 @@ krkrwine-i386.dll: krkrwine.cpp Makefile
2828
$(MINGW32) krkrwine.cpp -shared -fPIC -o krkrwine-i386.dll -lole32
2929

3030
prepare:
31-
cp $(EGGROLL)/files/lib64/gstreamer-1.0/libgstmpegpsdemux.so Glorious-Eggroll/x86_64-libgstmpegpsdemux.so
32-
cp $(EGGROLL)/files/lib64/gstreamer-1.0/libgstasf.so Glorious-Eggroll/x86_64-libgstasf.so
33-
cp $(EGGROLL)/files/lib64/libgstcodecparsers-1.0.so.0 Glorious-Eggroll/x86_64-libgstcodecparsers-1.0.so.0
34-
cp $(EGGROLL)/files/lib64/libavcodec.so.58 Glorious-Eggroll/x86_64-libavcodec.so.58
35-
cp $(EGGROLL)/files/lib64/libavutil.so.56 Glorious-Eggroll/x86_64-libavutil.so.56
36-
cp $(EGGROLL)/files/lib64/libavfilter.so.7 Glorious-Eggroll/x86_64-libavfilter.so.7
37-
cp $(EGGROLL)/files/lib64/libavformat.so.58 Glorious-Eggroll/x86_64-libavformat.so.58
38-
cp $(EGGROLL)/files/lib64/libavdevice.so.58 Glorious-Eggroll/x86_64-libavdevice.so.58
39-
cp $(EGGROLL)/files/lib64/libswresample.so.3 Glorious-Eggroll/x86_64-libswresample.so.3
40-
cp $(EGGROLL)/files/lib64/libswscale.so.5 Glorious-Eggroll/x86_64-libswscale.so.5
41-
cp $(EGGROLL)/files/lib/gstreamer-1.0/libgstmpegpsdemux.so Glorious-Eggroll/i386-libgstmpegpsdemux.so
42-
cp $(EGGROLL)/files/lib/gstreamer-1.0/libgstasf.so Glorious-Eggroll/i386-libgstasf.so
43-
cp $(EGGROLL)/files/lib/libgstcodecparsers-1.0.so.0 Glorious-Eggroll/i386-libgstcodecparsers-1.0.so.0
44-
cp $(EGGROLL)/files/lib/libavcodec.so.58 Glorious-Eggroll/i386-libavcodec.so.58
45-
cp $(EGGROLL)/files/lib/libavutil.so.56 Glorious-Eggroll/i386-libavutil.so.56
46-
cp $(EGGROLL)/files/lib/libavfilter.so.7 Glorious-Eggroll/i386-libavfilter.so.7
47-
cp $(EGGROLL)/files/lib/libavformat.so.58 Glorious-Eggroll/i386-libavformat.so.58
48-
cp $(EGGROLL)/files/lib/libavdevice.so.58 Glorious-Eggroll/i386-libavdevice.so.58
49-
cp $(EGGROLL)/files/lib/libswresample.so.3 Glorious-Eggroll/i386-libswresample.so.3
50-
cp $(EGGROLL)/files/lib/libswscale.so.5 Glorious-Eggroll/i386-libswscale.so.5
31+
mkdir Glorious-Eggroll/
32+
cp $(EGGROLL)/files/lib64/gstreamer-1.0/libgstmpegpsdemux.so Glorious-Eggroll/x86_64-libgstmpegpsdemux.so
33+
cp $(EGGROLL)/files/lib64/gstreamer-1.0/libgstasf.so Glorious-Eggroll/x86_64-libgstasf.so
34+
cp $(EGGROLL)/files/lib64/gstreamer-1.0/libgstvideoparsersbad.so Glorious-Eggroll/x86_64-libgstvideoparsersbad.so
35+
cp $(EGGROLL)/files/lib64/libgstcodecparsers-1.0.so.0 Glorious-Eggroll/x86_64-libgstcodecparsers-1.0.so.0
36+
cp $(EGGROLL)/files/lib64/libavcodec.so.58 Glorious-Eggroll/x86_64-libavcodec.so.58
37+
cp $(EGGROLL)/files/lib64/libavutil.so.56 Glorious-Eggroll/x86_64-libavutil.so.56
38+
cp $(EGGROLL)/files/lib64/libavfilter.so.7 Glorious-Eggroll/x86_64-libavfilter.so.7
39+
cp $(EGGROLL)/files/lib64/libavformat.so.58 Glorious-Eggroll/x86_64-libavformat.so.58
40+
cp $(EGGROLL)/files/lib64/libavdevice.so.58 Glorious-Eggroll/x86_64-libavdevice.so.58
41+
cp $(EGGROLL)/files/lib64/libswresample.so.3 Glorious-Eggroll/x86_64-libswresample.so.3
42+
cp $(EGGROLL)/files/lib64/libswscale.so.5 Glorious-Eggroll/x86_64-libswscale.so.5
43+
cp $(EGGROLL)/files/lib/gstreamer-1.0/libgstmpegpsdemux.so Glorious-Eggroll/i386-libgstmpegpsdemux.so
44+
cp $(EGGROLL)/files/lib/gstreamer-1.0/libgstasf.so Glorious-Eggroll/i386-libgstasf.so
45+
cp $(EGGROLL)/files/lib/lib/gstreamer-1.0/libgstvideoparsersbad.so Glorious-Eggroll/i386-libgstvideoparsersbad.so
46+
cp $(EGGROLL)/files/lib/libgstcodecparsers-1.0.so.0 Glorious-Eggroll/i386-libgstcodecparsers-1.0.so.0
47+
cp $(EGGROLL)/files/lib/libavcodec.so.58 Glorious-Eggroll/i386-libavcodec.so.58
48+
cp $(EGGROLL)/files/lib/libavutil.so.56 Glorious-Eggroll/i386-libavutil.so.56
49+
cp $(EGGROLL)/files/lib/libavfilter.so.7 Glorious-Eggroll/i386-libavfilter.so.7
50+
cp $(EGGROLL)/files/lib/libavformat.so.58 Glorious-Eggroll/i386-libavformat.so.58
51+
cp $(EGGROLL)/files/lib/libavdevice.so.58 Glorious-Eggroll/i386-libavdevice.so.58
52+
cp $(EGGROLL)/files/lib/libswresample.so.3 Glorious-Eggroll/i386-libswresample.so.3
53+
cp $(EGGROLL)/files/lib/libswscale.so.5 Glorious-Eggroll/i386-libswscale.so.5
5154

5255

5356
krkrwine.tar.gz: | Glorious-Eggroll/x86_64-libgstmpegpsdemux.so
5457
$(MAKE) clean
55-
$(MAKE) OPT=1
58+
$(MAKE) OPT=1 -j4
5659
-rm krkrwine.tar.gz
5760
tar -czvf krkrwine.tar.gz --transform='s%^%krkrwine/%' --show-transformed-names README.md install.py gstkrkr-i386.so gstkrkr-x86_64.so krkrwine-i386.dll krkrwine-x86_64.dll Glorious-Eggroll/
5861

@@ -105,11 +108,11 @@ wai:
105108
ln -s $(shell realpath .)/krmovie.dll /games/wine/waga/waga/plugin/krmovie.dll
106109

107110
X1_HOME = /home/walrus/mount/x1/home/x1/
108-
X1_PROTON = $(X1_HOME)steam/steamapps/common/"Proton 8.0"/
109-
X1_PFX = $(X1_PROTON)dist/share/default_pfx/
110-
X1_DLL = $(X1_PFX)drive_c/windows/syswow64/krkrwine.dll
111+
X1_PROTON = $(X1_HOME)steam/steamapps/common/"Proton 9.0 (Beta)"/
112+
X1_TARGET = $(X1_PROTON)krkrwine/
113+
X1_DLL = $(X1_TARGET)krkrwine-i386.dll
114+
X1_GST = $(X1_TARGET)gstkrkr-i386.so
111115
X1_EXE = $(X1_HOME)Desktop/a.exe
112-
X1_GST = $(X1_PROTON)dist/lib/gstreamer-1.0/gstkrkr-i386.so
113116
ax1: run32.exe krkrwine-i386.dll gstkrkr-i386.so
114117
-rm $(X1_DLL) $(X1_EXE) $(X1_GST)
115118
cp krkrwine-i386.dll $(X1_DLL)
@@ -119,12 +122,15 @@ ax1: run32.exe krkrwine-i386.dll gstkrkr-i386.so
119122
installx1: all
120123
./install.py $(X1_PROTON)
121124

125+
X2_HOME = /home/walrus/mount/x2/home/x2/
126+
X2_PROTON = $(X2_HOME)steam/steamapps/common/"Proton 9.0 (Beta)"/
127+
X2_WAGA = $(X2_HOME)steam/steamapps/common/"WAGAMAMA HIGH SPEC"
128+
122129
installx2: all
123-
./install.py /home/walrus/mount/x2/home/x2/steam/steamapps/common/"Proton 8.0"/
130+
./install.py $(X2_PROTON)
124131

125-
X2_WAGAPATH = /home/walrus/mount/x2/home/x2/steam/steamapps/common/"WAGAMAMA HIGH SPEC"
126132
waux2:
127-
mv $(X2_WAGAPATH)/plugin/_rmovie.dll $(X2_WAGAPATH)/plugin/krmovie.dll
133+
mv $(X2_WAGA)/plugin/_rmovie.dll $(X2_WAGA)/plugin/krmovie.dll
128134
waix2: krmovie.dll
129-
mv -n $(X2_WAGAPATH)/plugin/krmovie.dll $(X2_WAGAPATH)/plugin/_rmovie.dll
130-
cp krmovie.dll $(X2_WAGAPATH)/plugin/krmovie.dll
135+
mv -n $(X2_WAGA)/plugin/krmovie.dll $(X2_WAGA)/plugin/_rmovie.dll
136+
cp krmovie.dll $(X2_WAGA)/plugin/krmovie.dll

README.md

Lines changed: 15 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,34 @@
11
krkrwine
22
========
33

4-
This program implements various missing functionality in Wine / Proton, such that videos work properly in Kirikiri-based visual novels. (Other games are not targetted by krkrwine, but they may be improved as well.)
4+
This program implements various missing functionality in Wine / Proton, such that videos work properly in Kirikiri- and BURIKO-based visual novels. (Other software is not targetted by krkrwine, but may be improved as well.)
5+
6+
While I am doing my best to upstream my fixes, Proton's release cycle is once a year; krkrwine allows me to run these VNs before Proton 10 releases in 2025.
57

68
Installation - Linux/Proton
79
---------------------------
810

9-
Simply download and extract [a release](https://github.com/Alcaro/krkrwine/releases), run ./install.py ~/steam/steamapps/common/Proton\ 8.0/, and it will install into every current and future game using that Proton. Installing krkrwine into Glorious Eggroll should work too, though this is untested.
11+
Simply download and extract [a release](https://github.com/Alcaro/krkrwine/releases), run `./install.py ~/'steam/steamapps/common/Proton 9.0 (Beta)/'`, and it will install into every current and future game using that Proton. Installing krkrwine into Glorious Eggroll should work too, though this is untested.
1012

1113
krkrwine does not replace any existing files, and Steam's updater ignores files it doesn't recognize; therefore, you don't need to reinstall krkrwine if Proton updates. (However, if you reinstall Proton, or download a new Proton version, you obviously need to reinstall krkrwine too.)
1214

13-
krkrwine is only tested in Proton 8.0; I don't think it'll break too hard in anything else, but it's untested.
15+
krkrwine is only tested in Proton 9.0, and may misbehave in other Proton versions. For Proton 8.0, use an older release; for older Proton, upgrade.
1416

1517
Installation - Linux/Wine
1618
-------------------------
1719

18-
On Debian,
19-
20-
- Download and extract [a release](https://github.com/Alcaro/krkrwine/releases)
21-
- sudo apt install gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-plugins-good:i386 gstreamer1.0-plugins-bad:i386 gstreamer1.0-plugins-ugly:i386 gstreamer1.0-libav:i386
22-
- ./install.py --wine
23-
24-
On other distros, the package names are different.
20+
Not recommended. I recommend using the latest Wine, such that krkrwine is unnecessary.
2521

26-
Note that on Debian, gstreamer1.0-libav is not part of, or a dependency of, gstreamer1.0-plugins-good, -bad, nor -ugly; it must be installed separately. I haven't checked other distros.
22+
If you or your distro feel otherwise, you can use `./install.py --wine`. (It will obey WINEPREFIX, if set.)
2723

28-
install.py will obey the WINEPREFIX environment variable, if set.
24+
Make sure to use the correct krkrwine version; krkrwine 9.0 needs Wine 9.0 or higher. For older Wine, use an older release.
2925

30-
krkrwine's GStreamer component will not be installed under Wine; it does nothing useful if you have the above plugins and don't have protonmediaconverter. If you want them anyways for development purposes, you can copy or link them to ~/.local/share/gstreamer-1.0/plugins/.
26+
Do not install krkrwine's codecs; instead (for Debian), `sudo apt install gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-plugins-good:i386 gstreamer1.0-plugins-bad:i386 gstreamer1.0-plugins-ugly:i386 gstreamer1.0-libav:i386`. For other distros, the packages have different names. (Note that on Debian, gstreamer1.0-libav is not part of, or a dependency of, gstreamer1.0-plugins-good, -bad, nor -ugly; it must be installed separately.)
3127

3228
Installation - macOS
3329
--------------------
3430

35-
See the Linux/Wine steps, it'll probably work. However, it's untested, and I can't help you if it breaks.
31+
Not recommended. Feel free to try the Linux/Wine steps, but it's more untested than Linux/Wine; I can't help you if it breaks.
3632

3733
Installation - Windows
3834
----------------------
@@ -46,8 +42,10 @@ Compilation
4642
- sudo apt install make gcc libgstreamer1.0-dev gcc-multilib libgstreamer1.0-dev:i386 g++-mingw-w64-i686-win32 g++-mingw-w64-x86-64-win32
4743
- make prepare EGGROLL=/home/user/steam/compatibilitytools.d/GE-Proton8-4/
4844
- make
49-
- ./install.py /home/user/steam/steamapps/common/Proton\ 8.0/
50-
If desired, you may acquire i686-w64-mingw32-g++-win32 and x86_64-w64-mingw32-g++-win32 programs from elsewhere. I use https://winlibs.com/ in Wine. (Compiling with *-mingw32-g++-posix is not recommended, since it adds dependencies on libwinpthread-1.dll, and possibly others; I don't know if installing that lib into system32 breaks anything, and I don't feel like finding out.)
45+
- ./install.py ~/'steam/steamapps/common/Proton 9.0 (Beta)/'
46+
If desired, you may acquire i686-w64-mingw32-g++-win32 and x86_64-w64-mingw32-g++-win32 from elsewhere. I use https://winlibs.com/ in Wine. (Compiling with *-mingw32-g++-posix is not recommended, since it adds dependencies on libwinpthread-1.dll, and possibly others; I don't know if installing that lib into system32 breaks anything, and I don't feel like finding out.)
47+
48+
If you want to use krkrwine's GStreamer components under Wine for debugging purposes, copy or link them to ~/.local/share/gstreamer-1.0/plugins/. For anyone else, use gst-libav.
5149

5250
License
5351
-------
@@ -59,22 +57,4 @@ The Glorious-Eggroll subdirectory of the releases is, as the name implies, copie
5957
Upstreaming
6058
-----------
6159

62-
Ideally, this project would be unnecessary (other than the codec installation). As such, I'm offering bounties on fixing the Windows-side issues in upstream Wine.
63-
64-
- $250 - CLSID_MPEG1Splitter video output, and CLSID_CMpegVideoCodec (these objects may use GStreamer, of course)
65-
- $25 - CLSID_MPEG1Splitter IAMStreamSelect (doesn't need to be fully implemented, just needs the parts Kirikiri uses)
66-
- ~~$25 - CLSID_VideoMixingRenderer9 ChangeD3DDevice and NotifyEvent~~ Resolved and claimed
67-
- $500 - WMCreateSyncReader compressed output, CLSID_CWMADecMediaObject, and CLSID_CWMVDecMediaObject
68-
- $100 - Direct3D 9 on WS_CHILD windows under wined3d in the Debian package - the bug doesn't reproduce if I compile Wine from source
69-
- $25 - make WMSyncReader resize its allocator, so it can output RGB32 properly
70-
- $100 - figure out what's going on with the memory allocator and VFW_E_NOT_COMMITTED, and solve it
71-
- $0 - anything involving gstkrkr and Proton's GStreamer. That's a patent issue; it's a question for lawyers, not programmers. It's only needed in Proton, not vanilla Wine.
72-
- Anything that Kirikiri needs but isn't in the above list - that's a bug in this readme, contact me
73-
74-
though I'm working on them myself, so fair chance I'll finish first.
75-
76-
You are allowed, but not required, to base such efforts on this project. My architecture is very different from Wine's existing objects, and many of them are implemented in an awful way, so most of my code is unusable; but you're welcome to look for hints on the objects' expected behavior, or otherwise use them to help implement yours. You may also use the Kirikiri source code, <https://github.com/krkrz/krkr2/tree/master/kirikiri2/trunk>
77-
78-
To claim a bounty, post at <https://github.com/Alcaro/krkrwine/discussions/1>, or email me at sir@walrus.se. These bounties can be combined with similar offers made by others.
79-
80-
If I see any of the above implemented, but nobody claims the bounty, I will wait one month, then donate it to Wine.
60+
All relevant pieces of this project have been upstreamed. The bounties that were here have been claimed.

fake-krmovie.cpp

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,19 @@
55
// (I'm not sure if headers and other required interopability data is covered by copyright, but better safe than sorry.)
66
// (I also don't know if Kirikiri is 2.0 only or 2.0 or later, so I'll pick the safe choice.)
77

8-
//#define DOIT
8+
#ifdef __MINGW32__
9+
# define _FILE_OFFSET_BITS 64
10+
// mingw *really* wants to define its own printf/scanf, which adds ~20KB random stuff to the binary
11+
// (on some 32bit mingw versions, it also adds a dependency on libgcc_s_sjlj-1.dll)
12+
// extra kilobytes and dlls is the opposite of what I want, and my want is stronger, so here's some shenanigans
13+
// comments say libstdc++ demands a POSIX printf, but I don't use libstdc++'s text functions, so I don't care
14+
# define __USE_MINGW_ANSI_STDIO 0 // trigger a warning if it's enabled already - probably wrong include order
15+
# include <cstdbool> // include some random c++ header; they all include <bits/c++config.h>,
16+
# undef __USE_MINGW_ANSI_STDIO // which ignores my #define above and sets this flag; re-clear it before including <stdio.h>
17+
# define __USE_MINGW_ANSI_STDIO 0 // (subsequent includes of c++config.h are harmless, there's an include guard)
18+
#endif
19+
20+
#define DOIT
921

1022
#define STRSAFE_NO_DEPRECATE
1123
#define INITGUID
@@ -16,6 +28,22 @@
1628
#include <d3d9.h>
1729
#include <vmr9.h>
1830

31+
// can't use stdout from wine/proton since 8.12 https://gitlab.winehq.org/wine/wine/-/commit/dcf0bf1f383f8429136cb761f5170a04503a297b
32+
static void my_puts(const char * a, bool linebreak=true)
33+
{
34+
static int __cdecl (*__wine_dbg_output)( const char *str );
35+
if (!__wine_dbg_output)
36+
__wine_dbg_output = (decltype(__wine_dbg_output))GetProcAddress(GetModuleHandle("ntdll.dll"), "__wine_dbg_output");
37+
if (__wine_dbg_output)
38+
{
39+
__wine_dbg_output(a);
40+
if (linebreak)
41+
__wine_dbg_output("\n");
42+
}
43+
}
44+
#define puts my_puts
45+
#define printf(...) do { char my_buf[4096]; sprintf(my_buf, __VA_ARGS__); my_puts(my_buf, false); } while(0)
46+
1947
#ifdef __i386__
2048
// needs some extra shenanigans to kill the stdcall @12 suffix
2149
#define EXPORT_STDCALL(ret, name, args) \
@@ -322,7 +350,6 @@ BOOL __stdcall myMoveWindow(HWND hWnd, int X, int Y, int nWidth, int nHeight, BO
322350
return MoveWindow(hWnd, X, Y, nWidth, nHeight, bRepaint);
323351
}
324352

325-
IDirect3DDevice9* g_d3ddev;
326353
bool dump_texture(IDirect3DSurface9* renderTarget, const char * filename)
327354
{
328355
HRESULT hr;
@@ -500,22 +527,23 @@ class fancy_iTVPVideoOverlay : public iTVPVideoOverlay // this is not a COM obje
500527
virtual void __stdcall GetStatus(tTVPVideoStatus* status) { puts("fancy_iTVPVideoOverlay GetStatus"); orig_overlay->GetStatus(status); }
501528
virtual void __stdcall GetEvent(long* evcode, long* param1, long* param2, bool* got)
502529
{
503-
//puts("fancy_iTVPVideoOverlay GetEvent");
530+
puts("fancy_iTVPVideoOverlay GetEvent");
504531
orig_overlay->GetEvent(evcode, param1, param2, got);
532+
printf("ev %ld %ld %ld %d\n", *evcode, *param1, *param2, *got);
505533
}
506534

507535
// Start: Add: T.Imoto
508536
virtual void __stdcall FreeEventParams(long evcode, long param1, long param2)
509537
{
510-
//puts("fancy_iTVPVideoOverlay FreeEventParams");
538+
puts("fancy_iTVPVideoOverlay FreeEventParams");
511539
orig_overlay->FreeEventParams(evcode, param1, param2);
512540
}
513541

514542
virtual void __stdcall Rewind() { puts("fancy_iTVPVideoOverlay Rewind"); orig_overlay->Rewind(); }
515543
virtual void __stdcall SetFrame( int f ) { puts("fancy_iTVPVideoOverlay SetFrame"); orig_overlay->SetFrame(f); }
516544
virtual void __stdcall GetFrame( int* f )
517545
{
518-
//puts("fancy_iTVPVideoOverlay GetFrame");
546+
puts("fancy_iTVPVideoOverlay GetFrame");
519547
orig_overlay->GetFrame(f);
520548
printf("frame=%d\n", *f);
521549
}

gstkrkr.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -256,15 +256,19 @@ static gboolean gst_krkr_video_sink_event(GstPad* pad, GstObject* parent, GstEve
256256

257257
static GstFlowReturn gst_krkr_video_sink_chain(GstPad* pad, GstObject* parent, GstBuffer* buf)
258258
{
259+
//fprintf(stderr, "gstkrkr: reading\n");
259260
GstKrkrPlMpegVideo* filter = GST_KRKRPLMPEG_VIDEO(parent);
260261
for (size_t n=0;n<gst_buffer_n_memory(buf);n++)
261262
{
262263
GstMapInfo meminf;
263264
GstMemory* mem = gst_buffer_get_memory(buf, n);
264265
mem = gst_memory_make_mapped(mem, &meminf, GST_MAP_READ);
266+
//fprintf(stderr, "gstkrkr: read %zu bytes\n", meminf.size);
265267
plm_buffer_write(filter->buf, meminf.data, meminf.size);
268+
gst_memory_unmap(mem, &meminf);
266269
gst_memory_unref(mem);
267270
}
271+
gst_buffer_unref(buf);
268272

269273
while (true)
270274
{
@@ -294,7 +298,7 @@ static GstFlowReturn gst_krkr_video_sink_chain(GstPad* pad, GstObject* parent, G
294298

295299
size_t buflen = frame->width*frame->height*12/8;
296300
uint8_t* ptr = g_malloc(buflen);
297-
GstBuffer* buf = gst_buffer_new_wrapped(ptr, buflen);
301+
GstBuffer* buf2 = gst_buffer_new_wrapped(ptr, buflen);
298302
for (int y=0;y<frame->height;y++)
299303
{
300304
memcpy(ptr, frame->y.data + frame->y.width*y, frame->width);
@@ -311,11 +315,11 @@ static GstFlowReturn gst_krkr_video_sink_chain(GstPad* pad, GstObject* parent, G
311315
ptr += frame->width/2;
312316
}
313317

314-
buf->pts = frame->time * 1000000000;
315-
buf->dts = frame->time * 1000000000;
316-
buf->duration = 1000000000 / plm_video_get_framerate(filter->decode);
317-
//fprintf(stderr, "gstkrkr: send frame, %lu bytes\n", gst_buffer_get_size(buf));
318-
gst_pad_push(filter->srcpad, buf);
318+
buf2->pts = frame->time * 1000000000;
319+
buf2->dts = frame->time * 1000000000;
320+
buf2->duration = 1000000000 / plm_video_get_framerate(filter->decode);
321+
//fprintf(stderr, "gstkrkr: send frame, %zu bytes\n", gst_buffer_get_size(buf2));
322+
gst_pad_push(filter->srcpad, buf2);
319323
}
320324

321325
return GST_FLOW_OK;

0 commit comments

Comments
 (0)