/* we have to differentiate between int and float formats */
mimetype = gst_structure_get_name (structure);
- if (!strncmp (mimetype, "audio/x-raw-int", 15)) {
+ if (g_str_equal (mimetype, "audio/x-raw-int")) {
gint endianness;
const FormatDef *def;
gint j, bytes;
spec->silence_sample[i * bytes + j] = def->silence[j];
}
}
- } else if (!strncmp (mimetype, "audio/x-raw-float", 17)) {
+ } else if (g_str_equal (mimetype, "audio/x-raw-float")) {
spec->type = GST_BUFTYPE_FLOAT;
}
/* float silence is all zeros.. */
memset (spec->silence_sample, 0, 32);
- } else if (!strncmp (mimetype, "audio/x-alaw", 12)) {
+ } else if (g_str_equal (mimetype, "audio/x-alaw")) {
/* extract the needed information from the cap */
if (!(gst_structure_get_int (structure, "rate", &spec->rate) &&
gst_structure_get_int (structure, "channels", &spec->channels)))
spec->depth = 8;
for (i = 0; i < spec->channels; i++)
spec->silence_sample[i] = 0xd5;
- } else if (!strncmp (mimetype, "audio/x-mulaw", 13)) {
+ } else if (g_str_equal (mimetype, "audio/x-mulaw")) {
/* extract the needed information from the cap */
if (!(gst_structure_get_int (structure, "rate", &spec->rate) &&
gst_structure_get_int (structure, "channels", &spec->channels)))
spec->depth = 8;
for (i = 0; i < spec->channels; i++)
spec->silence_sample[i] = 0xff;
- } else if (!strncmp (mimetype, "audio/x-iec958", 14)) {
+ } else if (g_str_equal (mimetype, "audio/x-iec958")) {
/* extract the needed information from the cap */
if (!(gst_structure_get_int (structure, "rate", &spec->rate)))
goto parse_error;
spec->width = 16;
spec->depth = 16;
spec->channels = 2;
- } else if (!strncmp (mimetype, "audio/x-ac3", 11)) {
+ } else if (g_str_equal (mimetype, "audio/x-ac3")) {
/* extract the needed information from the cap */
if (!(gst_structure_get_int (structure, "rate", &spec->rate)))
goto parse_error;
spec->width = 16;
spec->depth = 16;
spec->channels = 2;
- } else if (!strncmp (mimetype, "audio/x-eac3", 12)) {
+ } else if (g_str_equal (mimetype, "audio/x-eac3")) {
/* extract the needed information from the cap */
if (!(gst_structure_get_int (structure, "rate", &spec->rate)))
goto parse_error;
spec->width = 64;
spec->depth = 64;
spec->channels = 2;
- } else if (!strncmp (mimetype, "audio/x-dts", 11)) {
+ } else if (g_str_equal (mimetype, "audio/x-dts")) {
/* extract the needed information from the cap */
if (!(gst_structure_get_int (structure, "rate", &spec->rate)))
goto parse_error;
spec->width = 16;
spec->depth = 16;
spec->channels = 2;
- } else if (!strncmp (mimetype, "audio/mpeg", 10) &&
+ } else if (g_str_equal (mimetype, "audio/mpeg") &&
gst_structure_get_int (structure, "mpegaudioversion", &i) &&
(i == 1 || i == 2)) {
/* Now we know this is MPEG-1 or MPEG-2 (non AAC) */