diff options
author | Minh Ngo <nlminhtl@gmail.com> | 2013-10-07 10:18:29 +0300 |
---|---|---|
committer | Minh Ngo <nlminhtl@gmail.com> | 2013-10-07 10:26:42 +0300 |
commit | 926fcc560b7a5dc45968ddeffbf8cf185eb6f1c6 (patch) | |
tree | 3775a119d33cf2184400616d12ee9b470f5d76db /avmedia/source/vlc | |
parent | 3196e5b7a52580bfa9242a35175e241db328a49f (diff) |
Avmedia/VLC: Using *_new_location instead of *_new_path function.
There are some bug in *_new_location in the latest VLC versions. It
doesn't parse URI correctly from the string "file:///blah-blah-blah".
Change-Id: Iae54ad79fce0775a2f0a325766f713ff43e5d9ed
Diffstat (limited to 'avmedia/source/vlc')
-rw-r--r-- | avmedia/source/vlc/wrapper/Media.cxx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/avmedia/source/vlc/wrapper/Media.cxx b/avmedia/source/vlc/wrapper/Media.cxx index c2627dec3d1b..d48ad49619e2 100644 --- a/avmedia/source/vlc/wrapper/Media.cxx +++ b/avmedia/source/vlc/wrapper/Media.cxx @@ -25,18 +25,21 @@ namespace wrapper namespace { libvlc_media_t* ( *libvlc_media_new_path ) ( libvlc_instance_t *p_instance, const char *path ); + libvlc_media_t* ( *libvlc_media_new_location ) (libvlc_instance_t *p_instance, const char *psz_mrl); void ( *libvlc_media_release ) ( libvlc_media_t *p_md ); void ( *libvlc_media_retain ) ( libvlc_media_t *p_md ); libvlc_time_t ( *libvlc_media_get_duration ) ( libvlc_media_t *p_md ); void ( *libvlc_media_parse ) ( libvlc_media_t *p_md ); int ( *libvlc_media_is_parsed ) ( libvlc_media_t *p_md ); + char* ( *libvlc_media_get_mrl )(libvlc_media_t *p_md); + libvlc_media_t* InitMedia( const rtl::OUString& url, Instance& instance ) { rtl::OString dest; url.convertToString(&dest, RTL_TEXTENCODING_UTF8, 0); - return libvlc_media_new_path(instance, dest.getStr()); + return libvlc_media_new_location(instance, dest.getStr()); } } @@ -49,7 +52,9 @@ bool Media::LoadSymbols() SYM_MAP( libvlc_media_retain ), SYM_MAP( libvlc_media_get_duration ), SYM_MAP( libvlc_media_parse ), - SYM_MAP( libvlc_media_is_parsed ) + SYM_MAP( libvlc_media_is_parsed ), + SYM_MAP( libvlc_media_get_mrl ), + SYM_MAP( libvlc_media_new_location ) }; return InitApiMap( VLC_MEDIA_API ); @@ -58,6 +63,10 @@ bool Media::LoadSymbols() Media::Media( const rtl::OUString& url, Instance& instance ) : mMedia( InitMedia( url, instance ) ) { + if (mMedia == NULL) + { + // TODO: Error + } } Media::Media( const Media& other ) |