summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2014-07-15 10:55:23 (GMT)
committerNirbheek Chauhan <nirbheek@centricular.com>2014-07-15 10:55:23 (GMT)
commit92f29b97038ba686fe298b55681802b9ef8de73d (patch)
tree1e0000bc3987f1274efc962eda82cbdbd1e40e72 /src
parente803e9fbda506f88cb4688c6ff7224877cfad2b4 (diff)
downloadsoup-transcoding-proxy-92f29b97038ba686fe298b55681802b9ef8de73d.zip
soup-transcoding-proxy-92f29b97038ba686fe298b55681802b9ef8de73d.tar.gz
appsink: Fix a rare crash
Diffstat (limited to 'src')
-rw-r--r--src/main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index b0a102c..44b3201 100644
--- a/src/main.c
+++ b/src/main.c
@@ -121,6 +121,13 @@ invoke_write_client_chunk (TranscodeClientCtx *ctx)
gboolean eos;
stp_print_status ("*");
+
+ /* XXX: If samples are coming in too quickly, this can get invoked
+ * after the client has disconnected and the SoupMessage is invalid
+ * So, we check if the msg is still a msg before trying to append. */
+ if (G_UNLIKELY (!SOUP_IS_MESSAGE (ctx->msg)))
+ return FALSE;
+
g_signal_emit_by_name (ctx->appsink, "pull-sample", &sample);
if (!sample) {
g_debug ("Null sample, ending stream");