$ git clone http://tcclient.ion.nu/tc_client.git
commit 85b0dda1f175a3972da36ff6eadfd80d7a39921f
Author: Alicia <...>
Date: Thu Oct 20 13:00:46 2016 +0200
tc_client-gtk: mark outgoing video keyframes as keyframes.
diff --git a/ChangeLog b/ChangeLog
index cd5e550..68b80f2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
0.41:
tc_client-gtk: bugfix: don't rely on stack allocated variables for GUI callbacks.
tc_client-gtk: install the camera placeholder animation for the 'install' target.
+tc_client-gtk: mark outgoing video keyframes as keyframes.
dist/appimage.sh: fix audio in appimages by building ffmpeg with support for nellymoser and speex, and depending on the system's libao and libpulse instead of including it in the appimage.
0.40:
Moved the backward compatibility code for avcodec_{send,receive}_{frame,packet} into a separate source file to avoid pulling libavcodec into utilities that don't use it.
diff --git a/utilities/gtk/media.c b/utilities/gtk/media.c
index 764a156..c809aa5 100644
--- a/utilities/gtk/media.c
+++ b/utilities/gtk/media.c
@@ -19,6 +19,7 @@
#include <gtk/gtk.h>
#include <libavcodec/avcodec.h>
#include <libswscale/swscale.h>
+#include <libavutil/opt.h>
#if LIBAVUTIL_VERSION_MAJOR>50 || (LIBAVUTIL_VERSION_MAJOR==50 && LIBAVUTIL_VERSION_MINOR>37)
#include <libavutil/imgutils.h>
#else
@@ -300,7 +301,8 @@ gboolean cam_encode(void* camera_)
avcodec_send_frame(cam->vctx, cam->dstframe);
gotpacket=avcodec_receive_packet(cam->vctx, &packet);
if(gotpacket){return G_SOURCE_CONTINUE;}
- unsigned char frameinfo=0x22; // Note: differentiating between keyframes and non-keyframes seems to break stuff, so let's just go with all being interframes (1=keyframe, 2=interframe, 3=disposable interframe)
+ char key=!!(packet.flags&AV_PKT_FLAG_KEY);
+ unsigned char frameinfo=(key?0x12:0x22); // In the first 4 bits: 1=keyframe, 2=interframe
// Send video
dprintf(tc_client_in[1], "/video %i\n", packet.size+1);
write(tc_client_in[1], &frameinfo, 1);