From: Sebastian Dröge Date: Fri, 27 May 2011 08:32:26 +0000 (+0200) Subject: voaacenc: The encoder library currently only supports 1 or 2 channels X-Git-Tag: 1.19.3~507^2~16050^2~83 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b87ff1a1df4d26e5723e9e03209b0007ab551da4;p=platform%2Fupstream%2Fgstreamer.git voaacenc: The encoder library currently only supports 1 or 2 channels --- diff --git a/ext/voaacenc/gstvoaacenc.c b/ext/voaacenc/gstvoaacenc.c index 4e55190..0a19522 100644 --- a/ext/voaacenc/gstvoaacenc.c +++ b/ext/voaacenc/gstvoaacenc.c @@ -62,7 +62,7 @@ static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", "depth = (int) 16, " "signed = (boolean) TRUE, " "endianness = (int) BYTE_ORDER, " - "rate = (int) [8000, 96000], " "channels = (int) [1, 6]") + "rate = (int) [8000, 96000], " "channels = (int) [1, 2]") ); static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src", @@ -71,7 +71,7 @@ static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src", GST_STATIC_CAPS ("audio/mpeg, " "mpegversion = (int) 4, " "rate = (int) [8000, 96000], " - "channels = (int) [1, 6], " + "channels = (int) [1, 2], " "stream-format = (string) { adts, raw }, " "base-profile = (string) lc") ); @@ -614,6 +614,8 @@ static gboolean voaacenc_core_set_parameter (GstVoAacEnc * voaacenc) { AACENC_PARAM params = { 0 }; + guint32 ret; + params.sampleRate = voaacenc->rate; params.bitRate = voaacenc->bitrate; params.nChannels = voaacenc->channels; @@ -622,8 +624,12 @@ voaacenc_core_set_parameter (GstVoAacEnc * voaacenc) } else { params.adtsUsed = 0; } - if (voaacenc->codec_api.SetParam (voaacenc->handle, VO_PID_AAC_ENCPARAM, - ¶ms) != VO_ERR_NONE) { + + ret = + voaacenc->codec_api.SetParam (voaacenc->handle, VO_PID_AAC_ENCPARAM, + ¶ms); + if (ret != VO_ERR_NONE) { + GST_ERROR_OBJECT (voaacenc, "Failed to set encoder parameters"); return FALSE; } return TRUE;