Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
e62092da
Kaydet (Commit)
e62092da
authored
Eyl 15, 2013
tarafından
Minh Ngo
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Avmedia/VLC: Error handling & Fixing a bug with a zero duration.
Change-Id: I45baeca91b9f5fc725164490b5880c9040acd679
üst
fcc436bc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
2 deletions
+27
-2
Common.cxx
avmedia/source/vlc/wrapper/Common.cxx
+9
-1
Common.hxx
avmedia/source/vlc/wrapper/Common.hxx
+1
-0
Media.cxx
avmedia/source/vlc/wrapper/Media.cxx
+17
-1
No files found.
avmedia/source/vlc/wrapper/Common.cxx
Dosyayı görüntüle @
e62092da
...
...
@@ -12,6 +12,7 @@
namespace
{
const
char
*
(
*
libvlc_get_version
)
(
void
);
char
*
(
*
libvlc_errmsg
)
(
void
);
}
namespace
avmedia
...
...
@@ -24,7 +25,8 @@ bool Common::LoadSymbols()
{
ApiMap
VLC_COMMON_API
[]
=
{
SYM_MAP
(
libvlc_get_version
)
SYM_MAP
(
libvlc_get_version
),
SYM_MAP
(
libvlc_errmsg
)
};
return
InitApiMap
(
VLC_COMMON_API
);
...
...
@@ -34,6 +36,11 @@ const char* Common::Version()
{
return
libvlc_get_version
();
}
const
char
*
Common
::
LastErrorMessage
()
{
return
libvlc_errmsg
();
}
}
}
}
\ No newline at end of file
avmedia/source/vlc/wrapper/Common.hxx
Dosyayı görüntüle @
e62092da
...
...
@@ -21,6 +21,7 @@ namespace wrapper
public
:
static
bool
LoadSymbols
();
static
const
char
*
Version
();
static
const
char
*
LastErrorMessage
();
};
}
}
...
...
avmedia/source/vlc/wrapper/Media.cxx
Dosyayı görüntüle @
e62092da
...
...
@@ -12,6 +12,7 @@
#include "SymbolLoader.hxx"
#include "Instance.hxx"
#include "Types.hxx"
#include "Common.hxx"
struct
libvlc_instance_t
;
...
...
@@ -27,6 +28,8 @@ namespace
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
);
libvlc_media_t
*
InitMedia
(
const
rtl
::
OUString
&
url
,
Instance
&
instance
)
{
...
...
@@ -44,7 +47,9 @@ bool Media::LoadSymbols()
SYM_MAP
(
libvlc_media_new_path
),
SYM_MAP
(
libvlc_media_release
),
SYM_MAP
(
libvlc_media_retain
),
SYM_MAP
(
libvlc_media_get_duration
)
SYM_MAP
(
libvlc_media_get_duration
),
SYM_MAP
(
libvlc_media_parse
),
SYM_MAP
(
libvlc_media_is_parsed
)
};
return
InitApiMap
(
VLC_MEDIA_API
);
...
...
@@ -71,9 +76,20 @@ const Media& Media::operator=( const Media& other )
int
Media
::
getDuration
()
const
{
if
(
!
libvlc_media_is_parsed
(
mMedia
)
)
libvlc_media_parse
(
mMedia
);
const
int
duration
=
libvlc_media_get_duration
(
mMedia
);
if
(
duration
==
-
1
)
{
SAL_WARN
(
"avmedia"
,
Common
::
LastErrorMessage
());
return
0
;
}
else
if
(
duration
==
0
)
{
// A duration must be greater than 0
return
1
;
}
return
duration
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment