Example #1
0
int format_get_plugin (format_plugin_t *plugin)
{
    int ret = -1;

    if (plugin->_state)
    {
        INFO1 ("internal format details already created for %s", plugin->mount);
        return 0;
    }
    switch (plugin->type)
    {
        case FORMAT_TYPE_OGG:
            ret = format_ogg_get_plugin (plugin);
            break;
        case FORMAT_TYPE_AAC:
        case FORMAT_TYPE_MPEG:
            ret = format_mp3_get_plugin (plugin);
            break;
        case FORMAT_TYPE_EBML:
            ret = format_ebml_get_plugin (plugin);
            break;
        default:
            INFO1 ("unparsed format detected for %s", plugin->mount);
            break;
    }

    return ret;
}
Example #2
0
int format_get_plugin(format_type_t type, source_t *source)
{
    int ret = -1;

    switch (type) {
        case FORMAT_TYPE_OGG:
            ret = format_ogg_get_plugin(source);
        break;
        case FORMAT_TYPE_EBML:
            ret = format_ebml_get_plugin(source);
        break;
        case FORMAT_TYPE_GENERIC:
            ret = format_mp3_get_plugin(source);
        break;
        default:
        break;
    }
    if (ret < 0)
        stats_event (source->mount, "content-type",
                source->format->contenttype);

    return ret;
}