コード例 #1
0
const SjExtList* SjPlayer::DoGetExtList()
{
	wxASSERT( m_impl );
	if( m_impl == NULL ) { return NULL; }

	if( !m_impl->m_extListInitialized )
	{
		m_impl->m_extListInitialized = true;
		if( m_impl->InitXine() )
		{
			char* spaceSeparatedExtListPtr = xine_get_file_extensions(m_impl->m_xine); // the returned pointer must be free()d when no longer used
			if( spaceSeparatedExtListPtr )
			{
				SjExtList allExt(wxString(spaceSeparatedExtListPtr, wxConvUTF8)); // allExt also includes images, playlists etc.
				free(spaceSeparatedExtListPtr);

				// do not add extensions that are known-unplayable (we do not use a positive list to be ready for unknwon formats,
				// if we fail here, ther user can ignore the extension manually)
				for( int i = allExt.GetCount()-1; i>=0; i-- ) {
					if( SjExtList::RepositoryType(allExt.GetExt(i)) != SJ_EXT_TYPE_KNOWN_UNPLAYABLE ) {
						m_impl->m_extList.AddExt(allExt.GetExt(i));
					}
				}
			}
		}
	}


	return &m_impl->m_extList;
}
コード例 #2
0
ファイル: engine.c プロジェクト: stefanlenselink/mjs
int engine_extention_is_supported(char * ext)
{
	char * xine_file_extensions = xine_get_file_extensions(engine);
	int res = strcasestr("mp3 ogg flac acc wav voc", ext) && strcasestr(xine_file_extensions, ext);
	free(xine_file_extensions);
	return res;
}
コード例 #3
0
ファイル: xine.c プロジェクト: clones/kaa
PyObject *
Xine_PyObject_get_file_extensions(Xine_PyObject *self, PyObject *args, PyObject *kwargs)
{
    PyObject *o;
    char *s = xine_get_file_extensions(self->xine);
    o = Py_BuildValue("z", s);
    free(s);
    return o;
}