[FFmpeg-devel] [PATCH] fftools/ffmpeg_mux: keep write_header and write_packet in the same thread

Michael Niedermayer michael at niedermayer.cc
Wed Nov 1 23:44:45 EET 2023


On Wed, Nov 01, 2023 at 05:01:15PM +0800, angus.chen-at-intel.com at ffmpeg.org wrote:
> From: "Chen, Angus" <angus.chen at intel.com>
> 
> sdl2_muxer(wayland):
> In ffmpeg6, we create a separate thread for muxer after calling avformat_write_header().
> It may generate EGL_BAD_ACCESS when we call write_packet. This is because egl_context
> is bound to previous thread.
> From EGL spec: If ctx is current to some other thread, or if either draw or read are
> bound to contexts in another thread, an EGL_BAD_ACCESS error is generated.
> 
> Signed-off-by: Chen, Angus <angus.chen at intel.com>
> ---
>  fftools/ffmpeg_mux.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)

this breaks
./ffmpeg -itsoffset 1 -re -i ~/videos/mm-short.mpg -acodec libspeex -ar 16K -ac 1 -vn -bitexact -t 1 -f rtp rtp://127.0.0.1:12345 -sdp_file /tmp/speexfile.sd


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Whats the most studid thing your enemy could do ? Blow himself up
Whats the most studid thing you could do ? Give up your rights and
freedom because your enemy blew himself up.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20231101/5968a594/attachment.sig>


More information about the ffmpeg-devel mailing list