diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2012-01-25 13:22:43 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2012-01-25 13:22:43 +0100 |
commit | a2a430024136fd947637ff56a4fea6a2689ca59d (patch) | |
tree | 8cab3177242814f02b1e49a51d81b5f2f1660621 /gst/festival | |
parent | 071c6e8f15f2afff7ca4ce5934c3bae1d76aea95 (diff) | |
parent | 8fb0beaf00aeae2ef6081d08f0d74d6e655a53da (diff) | |
download | gstreamer-plugins-bad-a2a430024136fd947637ff56a4fea6a2689ca59d.tar.gz |
Merge branch 'master' into 0.11
Conflicts:
configure.ac
ext/kate/gstkateenc.c
gst/colorspace/colorspace.c
gst/mpegvideoparse/mpegvideoparse.c
Diffstat (limited to 'gst/festival')
-rw-r--r-- | gst/festival/gstfestival.c | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/gst/festival/gstfestival.c b/gst/festival/gstfestival.c index 6423bf5b9..3c9e0949c 100644 --- a/gst/festival/gstfestival.c +++ b/gst/festival/gstfestival.c @@ -297,22 +297,29 @@ gst_festival_chain (GstPad * pad, GstBuffer * buf) GstFlowReturn ret = GST_FLOW_OK; GstFestival *festival; guint8 *p, *ep; + gint f; FILE *fd; festival = GST_FESTIVAL (GST_PAD_PARENT (pad)); GST_LOG_OBJECT (festival, "Got text buffer, %u bytes", GST_BUFFER_SIZE (buf)); - fd = fdopen (dup (festival->info->server_fd), "wb"); + f = dup (festival->info->server_fd); + if (f < 0) + goto fail_open; + fd = fdopen (f, "wb"); + if (fd == NULL) { + close (f); + goto fail_open; + } /* Copy text over to server, escaping any quotes */ fprintf (fd, "(Parameter.set 'Audio_Required_Rate 16000)\n"); fflush (fd); GST_DEBUG_OBJECT (festival, "issued Parameter.set command"); if (read_response (festival) == FALSE) { - ret = GST_FLOW_ERROR; fclose (fd); - goto out; + goto fail_read; } fprintf (fd, "(tts_textall \""); @@ -332,11 +339,25 @@ gst_festival_chain (GstPad * pad, GstBuffer * buf) /* Read back info from server */ if (read_response (festival) == FALSE) - ret = GST_FLOW_ERROR; + goto fail_read; out: gst_buffer_unref (buf); return ret; + + /* ERRORS */ +fail_open: + { + GST_ELEMENT_ERROR (festival, RESOURCE, OPEN_WRITE, (NULL), (NULL)); + ret = GST_FLOW_ERROR; + goto out; + } +fail_read: + { + GST_ELEMENT_ERROR (festival, RESOURCE, READ, (NULL), (NULL)); + ret = GST_FLOW_ERROR; + goto out; + } } static FT_Info * |