sbc: Some more coding style changes

This commit is contained in:
Marcel Holtmann 2007-10-24 21:51:37 +00:00 committed by Tim-Philipp Müller
parent d1062c97d1
commit f2441fe654

View file

@ -55,10 +55,7 @@ GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
"subbands = (int) { 4, 8 }, " "subbands = (int) { 4, 8 }, "
"allocation = (string) { snr, loudness }")); "allocation = (string) { snr, loudness }"));
/* /* reates a fixed caps from the caps given. */
Creates a fixed caps from the caps given.
*/
static GstCaps * static GstCaps *
sbc_parse_select_caps (GstSbcParse * parse, GstCaps * caps) sbc_parse_select_caps (GstSbcParse * parse, GstCaps * caps)
{ {
@ -73,7 +70,6 @@ sbc_parse_select_caps (GstSbcParse * parse, GstCaps * caps)
structure = gst_caps_get_structure (caps, 0); structure = gst_caps_get_structure (caps, 0);
/* rate */
if (!gst_structure_has_field (structure, "rate")) { if (!gst_structure_has_field (structure, "rate")) {
error = TRUE; error = TRUE;
error_message = "no rate."; error_message = "no rate.";
@ -90,7 +86,6 @@ sbc_parse_select_caps (GstSbcParse * parse, GstCaps * caps)
rate = temp; rate = temp;
} }
/* channels */
if (!gst_structure_has_field (structure, "channels")) { if (!gst_structure_has_field (structure, "channels")) {
error = TRUE; error = TRUE;
error_message = "no channels."; error_message = "no channels.";
@ -107,7 +102,6 @@ sbc_parse_select_caps (GstSbcParse * parse, GstCaps * caps)
channels = temp; channels = temp;
} }
/* blocks */
if (!gst_structure_has_field (structure, "blocks")) { if (!gst_structure_has_field (structure, "blocks")) {
error = TRUE; error = TRUE;
error_message = "no blocks."; error_message = "no blocks.";
@ -124,7 +118,6 @@ sbc_parse_select_caps (GstSbcParse * parse, GstCaps * caps)
blocks = temp; blocks = temp;
} }
/* subbands */
if (!gst_structure_has_field (structure, "subbands")) { if (!gst_structure_has_field (structure, "subbands")) {
error = TRUE; error = TRUE;
error_message = "no subbands."; error_message = "no subbands.";
@ -141,7 +134,6 @@ sbc_parse_select_caps (GstSbcParse * parse, GstCaps * caps)
subbands = temp; subbands = temp;
} }
/* allocation */
if (!gst_structure_has_field (structure, "allocation")) { if (!gst_structure_has_field (structure, "allocation")) {
error = TRUE; error = TRUE;
error_message = "no allocation."; error_message = "no allocation.";
@ -155,7 +147,6 @@ sbc_parse_select_caps (GstSbcParse * parse, GstCaps * caps)
} }
} }
/* mode */
if (!gst_structure_has_field (structure, "mode")) { if (!gst_structure_has_field (structure, "mode")) {
error = TRUE; error = TRUE;
error_message = "no mode."; error_message = "no mode.";
@ -175,7 +166,6 @@ error:
return NULL; return NULL;
} }
result = gst_caps_new_simple ("audio/x-sbc", result = gst_caps_new_simple ("audio/x-sbc",
"rate", G_TYPE_INT, rate, "rate", G_TYPE_INT, rate,
"channels", G_TYPE_INT, channels, "channels", G_TYPE_INT, channels,
@ -251,13 +241,11 @@ sbc_parse_chain (GstPad * pad, GstBuffer * buffer)
if (consumed <= 0) if (consumed <= 0)
break; break;
temp = GST_PAD_CAPS (parse->srcpad); temp = GST_PAD_CAPS (parse->srcpad);
res = gst_pad_alloc_buffer_and_set_caps (parse->srcpad, res = gst_pad_alloc_buffer_and_set_caps (parse->srcpad,
GST_BUFFER_OFFSET_NONE, consumed, temp, &output); GST_BUFFER_OFFSET_NONE, consumed, temp, &output);
if (res != GST_FLOW_OK) if (res != GST_FLOW_OK)
goto done; goto done;