[asterisk-commits] russell: branch russell/jack r98557 - /team/russell/jack/apps/app_jack.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Jan 12 13:01:26 CST 2008


Author: russell
Date: Sat Jan 12 13:01:26 2008
New Revision: 98557

URL: http://svn.digium.com/view/asterisk?view=rev&rev=98557
Log:
 - Add an error message for a certain error condition
 - Document handle_jack_audio() some more

Modified:
    team/russell/jack/apps/app_jack.c

Modified: team/russell/jack/apps/app_jack.c
URL: http://svn.digium.com/view/asterisk/team/russell/jack/apps/app_jack.c?view=diff&rev=98557&r1=98556&r2=98557
==============================================================================
--- team/russell/jack/apps/app_jack.c (original)
+++ team/russell/jack/apps/app_jack.c Sat Jan 12 13:01:26 2008
@@ -536,8 +536,21 @@
 /*!
  * \brief handle jack audio
  *
+ * \param[in]  chan The Asterisk channel to write the frames to if no output frame
+ *             is provided.
+ * \param[in]  jack_data This is the jack_data struct that contains the input
+ *             ringbuffer that audio will be read from.
+ * \param[out] out_frame If this argument is non-NULL, then assuming there is
+ *             enough data avilable in the ringbuffer, the audio in this frame
+ *             will get replaced with audio from the input buffer.  If there is
+ *             not enough data available to read at this time, then the frame
+ *             data gets zeroed out.
+ *
  * Read data from the input ringbuffer, which is the properly resampled audio
- * that was read from the jack input port.  Write it to the channel in 20 ms frames.
+ * that was read from the jack input port.  Write it to the channel in 20 ms frames,
+ * or fill up an output frame instead if one is provided.
+ *
+ * \return Nothing.
  */
 static void handle_jack_audio(struct ast_channel *chan, struct jack_data *jack_data,
 	struct ast_frame *out_frame)
@@ -755,6 +768,12 @@
 
 	if (frame->frametype != AST_FRAME_VOICE)
 		return 0;
+
+	if (frame->subclass != AST_FORMAT_SLINEAR) {
+		ast_log(LOG_WARNING, "Expected frame in SLINEAR for the audiohook, but got format %d\n",
+			frame->subclass);
+		return 0;
+	}
 
 	ast_channel_lock(chan);
 




More information about the asterisk-commits mailing list