[vlc-commits] test: media: use a sem

2015-11-05 Thread Thomas Guillem
vlc | branch: master | Thomas Guillem  | Thu Nov  5 09:40:00 
2015 +0100| [341e98d348d5a42730b80f92ff272e3b549efcf4] | committer: Thomas 
Guillem

test: media: use a sem

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=341e98d348d5a42730b80f92ff272e3b549efcf4
---

 test/libvlc/media.c |   33 +++--
 1 file changed, 7 insertions(+), 26 deletions(-)

diff --git a/test/libvlc/media.c b/test/libvlc/media.c
index 2a6e13f..aceba84 100644
--- a/test/libvlc/media.c
+++ b/test/libvlc/media.c
@@ -26,23 +26,11 @@
 #include 
 #include 
 
-struct test_media_preparsed_sys
-{
-vlc_mutex_t lock;
-vlc_cond_t wait;
-bool preparsed;
-};
-
 static void preparsed_changed(const libvlc_event_t *event, void *user_data)
 {
 (void)event;
-
-struct test_media_preparsed_sys *sys = user_data;
-
-vlc_mutex_lock (>lock);
-sys->preparsed = true;
-vlc_cond_signal (>wait);
-vlc_mutex_unlock (>lock);
+vlc_sem_t *sem = user_data;
+vlc_sem_post (sem);
 }
 
 static void test_media_preparsed(const char** argv, int argc)
@@ -58,23 +46,19 @@ static void test_media_preparsed(const char** argv, int 
argc)
 libvlc_media_t *media = libvlc_media_new_path (vlc, file);
 assert (media != NULL);
 
-struct test_media_preparsed_sys preparsed_sys, *sys = _sys;
-sys->preparsed = false;
-vlc_mutex_init (>lock);
-vlc_cond_init (>wait);
+vlc_sem_t sem;
+vlc_sem_init (, 0);
 
 // Check to see if we are properly receiving the event.
 libvlc_event_manager_t *em = libvlc_media_event_manager (media);
-libvlc_event_attach (em, libvlc_MediaParsedChanged, preparsed_changed, 
sys);
+libvlc_event_attach (em, libvlc_MediaParsedChanged, preparsed_changed, 
);
 
 // Parse the media. This is synchronous.
 libvlc_media_parse_async(media);
 
 // Wait for preparsed event
-vlc_mutex_lock (>lock);
-while (!sys->preparsed)
-vlc_cond_wait (>wait, >lock);
-vlc_mutex_unlock (>lock);
+vlc_sem_wait ();
+vlc_sem_destroy ();
 
 // We are good, now check Elementary Stream info.
 libvlc_media_track_t **tracks;
@@ -83,9 +67,6 @@ static void test_media_preparsed(const char** argv, int argc)
 assert (tracks[0]->i_type == libvlc_track_video);
 libvlc_media_tracks_release (tracks, nb_tracks);
 
-vlc_mutex_destroy (>lock);
-vlc_cond_destroy (>wait);
-
 libvlc_media_release (media);
 libvlc_release (vlc);
 }

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] Remove tabs in source code

2015-11-05 Thread Jean-Baptiste Kempf
vlc | branch: master | Jean-Baptiste Kempf  | Thu Nov  5 
10:00:01 2015 +0100| [9c9e634693b6434493442fed56ed056020808bc9] | committer: 
Jean-Baptiste Kempf

Remove tabs in source code

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9c9e634693b6434493442fed56ed056020808bc9
---

 src/input/es_out_timeshift.c |2 +-
 src/misc/events.c|2 +-
 src/posix/filesystem.c   |6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/input/es_out_timeshift.c b/src/input/es_out_timeshift.c
index 33a965e..befc1b7 100644
--- a/src/input/es_out_timeshift.c
+++ b/src/input/es_out_timeshift.c
@@ -213,7 +213,7 @@ struct es_out_id_t
 struct es_out_sys_t
 {
 input_thread_t *p_input;
-   es_out_t   *p_out;
+es_out_t   *p_out;
 
 /* Configuration */
 int64_ti_tmp_size_max;/* Maximal temporary file size in byte */
diff --git a/src/misc/events.c b/src/misc/events.c
index 81f901e..d924108 100644
--- a/src/misc/events.c
+++ b/src/misc/events.c
@@ -223,7 +223,7 @@ void vlc_event_send( vlc_event_manager_t * p_em,
 if( listeners_group->b_sublistener_removed )
 {
 /* If a callback was removed inside one of our callback, this gets
-* called */
+ * called */
 bool valid_listener;
 vlc_mutex_lock( _em->object_lock );
 valid_listener = group_contains_listener( listeners_group, 
cached_listener );
diff --git a/src/posix/filesystem.c b/src/posix/filesystem.c
index 9cf6876..0bced24 100644
--- a/src/posix/filesystem.c
+++ b/src/posix/filesystem.c
@@ -88,9 +88,9 @@ int vlc_openat (int dir, const char *filename, int flags, ...)
 if (fd != -1)
 fcntl (fd, F_SETFD, FD_CLOEXEC);
 #else
-   VLC_UNUSED (dir);
-   VLC_UNUSED (filename);
-   VLC_UNUSED (mode);
+VLC_UNUSED (dir);
+VLC_UNUSED (filename);
+VLC_UNUSED (mode);
 
 int fd = -1;
 errno = ENOSYS;

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] Modules: Remove tabs in source code

2015-11-05 Thread Jean-Baptiste Kempf
vlc | branch: master | Jean-Baptiste Kempf  | Thu Nov  5 
10:03:19 2015 +0100| [5dafc001bb1f8fc6a2dc2b51eed7a4486ab2f9f2] | committer: 
Jean-Baptiste Kempf

Modules: Remove tabs in source code

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5dafc001bb1f8fc6a2dc2b51eed7a4486ab2f9f2
---

 modules/access/mtp.c|2 +-
 modules/audio_output/audioqueue.c   |8 
 modules/audio_output/sndio.c|   38 +--
 modules/codec/kate.c|2 +-
 modules/control/oldrc.c |2 +-
 modules/demux/mjpeg.c   |   16 +++
 modules/lua/libs/playlist.c |2 +-
 modules/lua/vlc.h   |7 ---
 modules/misc/securetransport.c  |4 ++--
 modules/video_chroma/i420_rgb_mmx.h |   10 -
 10 files changed, 46 insertions(+), 45 deletions(-)

diff --git a/modules/access/mtp.c b/modules/access/mtp.c
index bc4ff70..a80299a 100644
--- a/modules/access/mtp.c
+++ b/modules/access/mtp.c
@@ -165,7 +165,7 @@ static void Close( vlc_object_t * p_this )
 access_sys_t *p_sys = p_access->p_sys;
 
 close ( p_sys->fd );
-if(vlc_unlink( p_access->psz_filepath ) != 0 )
+if( vlc_unlink( p_access->psz_filepath ) != 0 )
 msg_Err( p_access, "Error deleting file %s, %s",
  p_access->psz_filepath, vlc_strerror_c(errno) );
 free( p_sys );
diff --git a/modules/audio_output/audioqueue.c 
b/modules/audio_output/audioqueue.c
index 312fcb9..b594a8f 100644
--- a/modules/audio_output/audioqueue.c
+++ b/modules/audio_output/audioqueue.c
@@ -165,10 +165,10 @@ static int Start(audio_output_t *p_aout, 
audio_sample_format_t *restrict fmt)
 NULL,
 NULL);
 
-   // Set audio session to mediaplayback
-   UInt32 sessionCategory = kAudioSessionCategory_MediaPlayback;
-   AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, 
sizeof(sessionCategory),);
-   AudioSessionSetActive(true);
+// Set audio session to mediaplayback
+UInt32 sessionCategory = kAudioSessionCategory_MediaPlayback;
+AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, 
sizeof(sessionCategory),);
+AudioSessionSetActive(true);
 #endif
 
 p_aout->sys->b_started = true;
diff --git a/modules/audio_output/sndio.c b/modules/audio_output/sndio.c
index ecc0bfd..4d023a0 100644
--- a/modules/audio_output/sndio.c
+++ b/modules/audio_output/sndio.c
@@ -77,26 +77,26 @@ static int Start (audio_output_t *aout, 
audio_sample_format_t *restrict fmt)
 sio_initpar ();
 switch (fmt->i_format) {
 case VLC_CODEC_U8:
-   par.bits = 8;
-   par.sig = 0;
-   break;
+par.bits = 8;
+par.sig = 0;
+break;
 case VLC_CODEC_S16N:
-   par.bits = 16;
-   par.sig = 1;
-   par.le = SIO_LE_NATIVE;
-   break;
+par.bits = 16;
+par.sig = 1;
+par.le = SIO_LE_NATIVE;
+break;
 case VLC_CODEC_S32N:
 case VLC_CODEC_FL32:
 case VLC_CODEC_FL64:
-   par.bits = 32;
-   par.sig = 1;
-   par.le = SIO_LE_NATIVE;
-   break;
+par.bits = 32;
+par.sig = 1;
+par.le = SIO_LE_NATIVE;
+break;
 default:
-   /* use a common audio format */
-   par.bits = 16;
-   par.sig = 1;
-   par.le = SIO_LE_NATIVE;
+/* use a common audio format */
+par.bits = 16;
+par.sig = 1;
+par.le = SIO_LE_NATIVE;
 }
 par.pchan = aout_FormatNbChannels (fmt);
 par.rate = fmt->i_rate;
@@ -124,7 +124,7 @@ static int Start (audio_output_t *aout, 
audio_sample_format_t *restrict fmt)
 if (par.bps > 1 && par.le != SIO_LE_NATIVE)
 {
 msg_Err (aout, "unsupported audio sample format (%s endian)",
-par.le ? "little" : "big");
+ par.le ? "little" : "big");
 goto error;
 }
 switch (par.bits)
@@ -221,7 +221,7 @@ static int TimeGet (audio_output_t *aout, mtime_t *restrict 
delay)
 aout_sys_t *sys = aout->sys;
 
 if (!sys->started)
-   return -1;
+return -1;
 *delay = (mtime_t)sys->delay * CLOCK_FREQ / sys->rate;
 return 0;
 }
@@ -263,9 +263,9 @@ static int VolumeSet (audio_output_t *aout, float fvol)
 unsigned volume;
 
 if (fvol < 0)
-   fvol = 0;
+fvol = 0;
 if (fvol > 1)
-   fvol = 1;
+fvol = 1;
 volume = lroundf (fvol * SIO_MAXVOL);
 if (!sys->mute && !sio_setvol (sys->hdl, volume))
 return -1;
diff --git a/modules/codec/kate.c b/modules/codec/kate.c
index e3bb494..b427662 100644
--- a/modules/codec/kate.c
+++ b/modules/codec/kate.c
@@ -657,7 +657,7 @@ static void GetVideoSize( decoder_t *p_dec, int *w, int *h )
 *w = p_sys->ki.original_canvas_width;
 *h = p_sys->ki.original_canvas_height;
 msg_Dbg( p_dec, "original canvas %zu %zu",
-p_sys->ki.original_canvas_width, 

[vlc-commits] libvlc: don't release media_list while it's used by media

2015-11-05 Thread Thomas Guillem
vlc/vlc-2.2 | branch: master | Thomas Guillem  | Thu Nov  5 
12:35:21 2015 +0100| [863a4259336594469436fa072f7277e4924721f5] | committer: 
Jean-Baptiste Kempf

libvlc: don't release media_list while it's used by media

Indeed, events callbacks can access the media_list.

(cherry picked from commit 860f831fc1ee17caca4225e40bb78fc5b8964dc7)
Signed-off-by: Jean-Baptiste Kempf 

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=863a4259336594469436fa072f7277e4924721f5
---

 lib/media.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/media.c b/lib/media.c
index 6f324aa..18d6e6d 100644
--- a/lib/media.c
+++ b/lib/media.c
@@ -435,10 +435,11 @@ void libvlc_media_release( libvlc_media_t *p_md )
 if( p_md->i_refcount > 0 )
 return;
 
+uninstall_input_item_observer( p_md );
+
 if( p_md->p_subitems )
 libvlc_media_list_release( p_md->p_subitems );
 
-uninstall_input_item_observer( p_md );
 vlc_gc_decref( p_md->p_input_item );
 
 vlc_cond_destroy( _md->parsed_cond );

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] libvlc: don't release media_list while it's used by media

2015-11-05 Thread Thomas Guillem
vlc | branch: master | Thomas Guillem  | Thu Nov  5 12:35:21 
2015 +0100| [860f831fc1ee17caca4225e40bb78fc5b8964dc7] | committer: Thomas 
Guillem

libvlc: don't release media_list while it's used by media

Indeed, events callbacks can access the media_list.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=860f831fc1ee17caca4225e40bb78fc5b8964dc7
---

 lib/media.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/media.c b/lib/media.c
index 8919093..20266ae 100644
--- a/lib/media.c
+++ b/lib/media.c
@@ -507,10 +507,11 @@ void libvlc_media_release( libvlc_media_t *p_md )
 if( p_md->i_refcount > 0 )
 return;
 
+uninstall_input_item_observer( p_md );
+
 if( p_md->p_subitems )
 libvlc_media_list_release( p_md->p_subitems );
 
-uninstall_input_item_observer( p_md );
 vlc_gc_decref( p_md->p_input_item );
 
 vlc_cond_destroy( _md->parsed_cond );

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] directory: (mostly) cosmetic changes

2015-11-05 Thread Rémi Denis-Courmont
vlc | branch: master | Rémi Denis-Courmont  | Thu Nov  5 
21:22:14 2015 +0200| [8b83104e218153be159c977102e24d4dabd27da4] | committer: 
Rémi Denis-Courmont

directory: (mostly) cosmetic changes

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8b83104e218153be159c977102e24d4dabd27da4
---

 modules/access/directory.c |   92 +---
 modules/access/fs.c|1 +
 2 files changed, 45 insertions(+), 48 deletions(-)

diff --git a/modules/access/directory.c b/modules/access/directory.c
index 9b16b16..4ae3e23 100644
--- a/modules/access/directory.c
+++ b/modules/access/directory.c
@@ -43,88 +43,85 @@
 
 struct access_sys_t
 {
-char *psz_base_uri;
-DIR *p_dir;
+char *base_uri;
+DIR *dir;
 };
 
 /*
  * DirInit: Init the directory access with a directory stream
  */
-int DirInit (access_t *p_access, DIR *p_dir)
+int DirInit (access_t *access, DIR *dir)
 {
-char *psz_base_uri;
+access_sys_t *sys = malloc(sizeof (*sys));
+if (unlikely(sys == NULL))
+goto error;
 
-if (!strcmp (p_access->psz_access, "fd"))
+if (!strcmp(access->psz_access, "fd"))
 {
-if (asprintf (_base_uri, "fd://%s", p_access->psz_location) == -1)
-psz_base_uri = NULL;
+if (unlikely(asprintf(>base_uri, "fd://%s",
+  access->psz_location) == -1))
+sys->base_uri = NULL;
 }
 else
-psz_base_uri = vlc_path2uri (p_access->psz_filepath, "file");
-if (unlikely (psz_base_uri == NULL))
-{
-closedir (p_dir);
-return VLC_ENOMEM;
-}
+sys->base_uri = vlc_path2uri(access->psz_filepath, "file");
+if (unlikely(sys->base_uri == NULL))
+goto error;
 
-p_access->p_sys = calloc (1, sizeof(access_sys_t));
-if (!p_access->p_sys)
-{
-closedir(p_dir);
-free( psz_base_uri );
-return VLC_ENOMEM;
-}
-p_access->p_sys->p_dir = p_dir;
-p_access->p_sys->psz_base_uri = psz_base_uri;
-p_access->pf_readdir = DirRead;
-p_access->pf_control = access_vaDirectoryControlHelper;
+sys->dir = dir;
 
+access->p_sys = sys;
+access->pf_readdir = DirRead;
+access->pf_control = access_vaDirectoryControlHelper;
 return VLC_SUCCESS;
+
+error:
+closedir(dir);
+free(sys);
+return VLC_ENOMEM;
 }
 
 /*
  * DirOpen: Open the directory access
  */
-int DirOpen (vlc_object_t *p_this)
+int DirOpen (vlc_object_t *obj)
 {
-access_t *access = (access_t *)p_this;
+access_t *access = (access_t *)obj;
 
 if (access->psz_filepath == NULL)
 return VLC_EGENERIC;
 
-DIR *dir = vlc_opendir (access->psz_filepath);
+DIR *dir = vlc_opendir(access->psz_filepath);
 if (dir == NULL)
 return VLC_EGENERIC;
 
-return DirInit (access, dir);
+return DirInit(access, dir);
 }
 
 /*
  * Close: close the target
  */
-void DirClose( vlc_object_t * p_this )
+void DirClose(vlc_object_t *obj)
 {
-access_t *p_access = (access_t*)p_this;
-access_sys_t *p_sys = p_access->p_sys;
-
-free (p_sys->psz_base_uri);
-closedir (p_sys->p_dir);
+access_t *access = (access_t *)obj;
+access_sys_t *sys = access->p_sys;
 
-free (p_sys);
+free(sys->base_uri);
+closedir(sys->dir);
+free(sys);
 }
 
-input_item_t* DirRead (access_t *p_access)
+input_item_t *DirRead(access_t *access)
 {
-access_sys_t *p_sys = p_access->p_sys;
+access_sys_t *sys = access->p_sys;
 const char *entry;
 
-while ((entry = vlc_readdir (p_sys->p_dir)) != NULL)
+while ((entry = vlc_readdir(sys->dir)) != NULL)
 {
 int type;
 #ifdef HAVE_OPENAT
 struct stat st;
 
-if (fstatat (dirfd (p_sys->p_dir), entry, , 0))
+if (fstatat(dirfd(sys->dir), entry, , 0))
 continue;
 
 switch (st.st_mode & S_IFMT)
@@ -143,21 +140,20 @@ input_item_t* DirRead (access_t *p_access)
 #endif
 
 /* Create an input item for the current entry */
-char *encoded_entry = encode_URI_component (entry);
+char *encoded= encode_URI_component(entry);
 if (unlikely(entry == NULL))
-return NULL;
+continue;
 
 char *uri;
-if (unlikely(asprintf (, "%s/%s", p_sys->psz_base_uri,
-   encoded_entry) == -1))
+if (unlikely(asprintf(, "%s/%s", sys->base_uri, encoded) == -1))
 uri = NULL;
-free (encoded_entry);
+free(encoded);
 if (unlikely(uri == NULL))

[vlc-commits] directory: ignore non-regular non-directory files by default

2015-11-05 Thread Rémi Denis-Courmont
vlc | branch: master | Rémi Denis-Courmont  | Thu Nov  5 
21:23:45 2015 +0200| [d2ed3fb624274e824ab5ba892e8898f3d0eb1502] | committer: 
Rémi Denis-Courmont

directory: ignore non-regular non-directory files by default

Playing FIFOs and devices (especially character devices) typically
only makes sense if explicitly requested. Playing FIFOs will usually
lock up. Playing devices could have any effects.

Add an option to restore the old behaviour in case someone wants it.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d2ed3fb624274e824ab5ba892e8898f3d0eb1502
---

 NEWS   |2 ++
 modules/access/directory.c |   31 +--
 modules/access/fs.c|2 ++
 3 files changed, 29 insertions(+), 6 deletions(-)

diff --git a/NEWS b/NEWS
index 5a3d43a..a5d7ae7 100644
--- a/NEWS
+++ b/NEWS
@@ -27,6 +27,8 @@ Access:
  * SMB/FTP/SFTP accesses can list directories
  * Support for SAT>IP server dialect for RTSP (satip://)
  * New "concat" access module for concatenating byte streams
+ * Named pipes and device nodes are no longer included in directory listings
+   by default. Use --list-special-files to include them back.
 
 Decoder:
  * OMX GPU-zerocopy support for decoding and display on Android using OpenMax 
IL
diff --git a/modules/access/directory.c b/modules/access/directory.c
index 4ae3e23..f0e5826 100644
--- a/modules/access/directory.c
+++ b/modules/access/directory.c
@@ -45,6 +45,7 @@ struct access_sys_t
 {
 char *base_uri;
 DIR *dir;
+bool special_files;
 };
 
 /*
@@ -68,6 +69,7 @@ int DirInit (access_t *access, DIR *dir)
 goto error;
 
 sys->dir = dir;
+sys->special_files = var_InheritBool(access, "list-special-files");
 
 access->p_sys = sys;
 access->pf_readdir = DirRead;
@@ -126,14 +128,31 @@ input_item_t *DirRead(access_t *access)
 
 switch (st.st_mode & S_IFMT)
 {
-case S_IFBLK: type = ITEM_TYPE_DISC;  break;
-case S_IFCHR: type = ITEM_TYPE_CARD;  break;
-case S_IFIFO: type = ITEM_TYPE_STREAM;break;
-case S_IFREG: type = ITEM_TYPE_FILE;  break;
-case S_IFDIR: type = ITEM_TYPE_DIRECTORY; break;
+case S_IFBLK:
+if (!sys->special_files)
+continue;
+type = ITEM_TYPE_DISC;
+break;
+case S_IFCHR:
+if (!sys->special_files)
+continue;
+type = ITEM_TYPE_CARD;
+break;
+case S_IFIFO:
+if (!sys->special_files)
+continue;
+type = ITEM_TYPE_STREAM;
+break;
+case S_IFREG:
+type = ITEM_TYPE_FILE;
+break;
+case S_IFDIR:
+type = ITEM_TYPE_DIRECTORY;
+break;
 /* S_IFLNK cannot occur while following symbolic links */
 /* S_IFSOCK cannot be opened with open()/openat() */
-default:  continue; /* ignore */
+default:
+continue; /* ignore */
 }
 #else
 type = ITEM_TYPE_FILE;
diff --git a/modules/access/fs.c b/modules/access/fs.c
index 89a6cb1..edce520 100644
--- a/modules/access/fs.c
+++ b/modules/access/fs.c
@@ -50,4 +50,6 @@ vlc_module_begin ()
 #endif
 set_callbacks( DirOpen, DirClose )
 
+add_bool("list-special-files", false, N_("List special files"),
+ N_("Include devices and pipes when listing directories"), true)
 vlc_module_end ()

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] demux: smooth: missing switch policy

2015-11-05 Thread Francois Cartegnie
vlc | branch: master | Francois Cartegnie  | Thu Nov  5 
20:19:32 2015 +0100| [f94fadda7510cfb8d1908446cc142bd480e453a0] | committer: 
Francois Cartegnie

demux: smooth: missing switch policy

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f94fadda7510cfb8d1908446cc142bd480e453a0
---

 modules/demux/smooth/playlist/Representation.cpp |1 +
 1 file changed, 1 insertion(+)

diff --git a/modules/demux/smooth/playlist/Representation.cpp 
b/modules/demux/smooth/playlist/Representation.cpp
index e1d4760..a744127 100644
--- a/modules/demux/smooth/playlist/Representation.cpp
+++ b/modules/demux/smooth/playlist/Representation.cpp
@@ -29,6 +29,7 @@ using namespace smooth::playlist;
 Representation::Representation  ( BaseAdaptationSet *set ) :
 BaseRepresentation( set )
 {
+switchpolicy = SegmentInformation::SWITCH_SEGMENT_ALIGNED;
 }
 
 Representation::~Representation ()

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] decoder: remove incorrect assertion

2015-11-05 Thread Rémi Denis-Courmont
vlc | branch: master | Rémi Denis-Courmont  | Thu Nov  5 
21:41:28 2015 +0200| [d0efd59165021ece141d34e155ae6ea5cc482901] | committer: 
Rémi Denis-Courmont

decoder: remove incorrect assertion

The decoder can be paused by the decoder owner while the decoder thread
is decoding. We still need to queue the last decoded picture(s) to the
(not yet paused) video output.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d0efd59165021ece141d34e155ae6ea5cc482901
---

 src/input/decoder.c |9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index f6dfbcf..5f7cc01 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -906,13 +906,10 @@ static void DecoderPlayVideo( decoder_t *p_dec, picture_t 
*p_picture,
 vlc_mutex_unlock( _owner->lock );
 
 /* FIXME: The *input* FIFO should not be locked here. This will not work
- * properly if/when pictures are queued asynchronously (c.f. assert()). */
+ * properly if/when pictures are queued asynchronously. */
 vlc_fifo_Lock( p_owner->p_fifo );
-if( p_owner->paused )
-{
-   assert( p_owner->frames_countdown > 0 );
-   p_owner->frames_countdown--;
-}
+if( unlikely(p_owner->paused) && likely(p_owner->frames_countdown > 0) )
+p_owner->frames_countdown--;
 vlc_fifo_Unlock( p_owner->p_fifo );
 
 /* */

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] input: check run-time against demuxer timeline (fixes #15814)

2015-11-05 Thread Rémi Denis-Courmont
vlc | branch: master | Rémi Denis-Courmont  | Wed Nov  4 
22:45:19 2015 +0200| [2ed45c184c888a8c3eb11c72242aaf3b1c8b10d0] | committer: 
Rémi Denis-Courmont

input: check run-time against demuxer timeline (fixes #15814)

The "run-time" parameter was measured in terms of how long the input
thread had actually been playing, i.e. the real time since the thread
was created minus the real time spent in paused state.

This is a bit odd. It does not make much sense when transcoding, and
also seems rather counter-intuitive when playing a non-nominal rate.

This patch changes the run-time variable to match the demuxer time, as
does the start-time and the stop-time.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2ed45c184c888a8c3eb11c72242aaf3b1c8b10d0
---

 src/input/input.c  |   32 
 src/input/input_internal.h |1 -
 2 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/src/input/input.c b/src/input/input.c
index 70ff07b..c3303ef 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -311,7 +311,6 @@ static input_thread_t *Create( vlc_object_t *p_parent, 
input_item_t *p_item,
 p_input->p->i_start = 0;
 p_input->p->i_time  = 0;
 p_input->p->i_stop  = 0;
-p_input->p->i_run   = 0;
 p_input->p->i_title = 0;
 p_input->p->title = NULL;
 p_input->p->i_title_offset = p_input->p->i_seekpoint_offset = 0;
@@ -527,14 +526,13 @@ bool input_Stopped( input_thread_t *input )
  * MainLoopDemux
  * It asks the demuxer to demux some data
  */
-static void MainLoopDemux( input_thread_t *p_input, bool *pb_changed, mtime_t 
i_start_mdate )
+static void MainLoopDemux( input_thread_t *p_input, bool *pb_changed )
 {
 int i_ret;
 
 *pb_changed = false;
 
-if( ( p_input->p->i_stop > 0 && p_input->p->i_time >= p_input->p->i_stop ) 
||
-( p_input->p->i_run > 0 && i_start_mdate+p_input->p->i_run < mdate() ) 
)
+if( p_input->p->i_stop > 0 && p_input->p->i_time >= p_input->p->i_stop )
 i_ret = 0; /* EOF */
 else
 i_ret = demux_Demux( p_input->p->master->p_demux );
@@ -572,7 +570,7 @@ static void MainLoopDemux( input_thread_t *p_input, bool 
*pb_changed, mtime_t i_
 SlaveDemux( p_input );
 }
 
-static int MainLoopTryRepeat( input_thread_t *p_input, mtime_t *pi_start_mdate 
)
+static int MainLoopTryRepeat( input_thread_t *p_input )
 {
 int i_repeat = var_GetInteger( p_input, "input-repeat" );
 if( i_repeat <= 0 )
@@ -613,8 +611,6 @@ static int MainLoopTryRepeat( input_thread_t *p_input, 
mtime_t *pi_start_mdate )
 input_ControlPush( p_input, INPUT_CONTROL_SET_POSITION,  );
 }
 
-/* */
-*pi_start_mdate = mdate();
 return VLC_SUCCESS;
 }
 
@@ -658,12 +654,11 @@ static void MainLoopStatistics( input_thread_t *p_input )
  */
 static void MainLoop( input_thread_t *p_input, bool b_interactive )
 {
-mtime_t i_start_mdate = mdate();
 mtime_t i_intf_update = 0;
 mtime_t i_last_seek_mdate = 0;
 
 if( b_interactive && var_InheritBool( p_input, "start-paused" ) )
-ControlPause( p_input, i_start_mdate );
+ControlPause( p_input, mdate() );
 
 bool b_pause_after_eof = b_interactive &&
  var_InheritBool( p_input, "play-and-pause" );
@@ -685,7 +680,7 @@ static void MainLoop( input_thread_t *p_input, bool 
b_interactive )
 {
 bool b_force_update = false;
 
-MainLoopDemux( p_input, _force_update, i_start_mdate );
+MainLoopDemux( p_input, _force_update );
 
 if( p_input->p->master->p_demux->pf_demux != NULL )
 i_wakeup = es_out_GetWakeup( p_input->p->p_es_out );
@@ -710,7 +705,7 @@ static void MainLoop( input_thread_t *p_input, bool 
b_interactive )
 }
 else
 {
-if( MainLoopTryRepeat( p_input, _start_mdate ) )
+if( MainLoopTryRepeat( p_input ) )
 break;
 }
 
@@ -883,12 +878,17 @@ static void StartTitle( input_thread_t * p_input )
  * var_GetFloat( p_input, "start-time" ));
 p_input->p->i_stop  = llroundf(100.f
  * var_GetFloat( p_input, "stop-time" ));
-p_input->p->i_run   = llroundf(100.f
- * var_GetFloat( p_input, "run-time" ));
-if( p_input->p->i_run < 0 )
+if( p_input->p->i_stop <= 0 )
 {
-msg_Warn( p_input, "invalid run-time ignored" );
-p_input->p->i_run = 0;
+p_input->p->i_stop = llroundf(100.f
+ * var_GetFloat( p_input, "run-time" ));
+if( p_input->p->i_stop < 0 )
+{
+msg_Warn( p_input, "invalid run-time ignored" );
+p_input->p->i_stop = 0;
+}
+else
+p_input->p->i_stop += p_input->p->i_start;
 }
 
 if( p_input->p->i_start > 0 )
diff --git 

[vlc-commits] directory: stat() fallback if *at() functions are missing

2015-11-05 Thread Rémi Denis-Courmont
vlc | branch: master | Rémi Denis-Courmont  | Thu Nov  5 
21:34:30 2015 +0200| [2b757516f903932473f30a5f7bc55a86dac41937] | committer: 
Rémi Denis-Courmont

directory: stat() fallback if *at() functions are missing

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2b757516f903932473f30a5f7bc55a86dac41937
---

 modules/access/directory.c |   13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/modules/access/directory.c b/modules/access/directory.c
index f0e5826..07614bc 100644
--- a/modules/access/directory.c
+++ b/modules/access/directory.c
@@ -119,13 +119,19 @@ input_item_t *DirRead(access_t *access)
 
 while ((entry = vlc_readdir(sys->dir)) != NULL)
 {
-int type;
-#ifdef HAVE_OPENAT
 struct stat st;
+int type;
 
+#ifdef HAVE_OPENAT
 if (fstatat(dirfd(sys->dir), entry, , 0))
 continue;
+#else
+char path[PATH_MAX];
 
+if (snprintf(path, PATH_MAX, "%s"DIR_SEP"%s", access->psz_filepath,
+ entry) >= PATH_MAX || vlc_stat(path, ))
+continue;
+#endif
 switch (st.st_mode & S_IFMT)
 {
 case S_IFBLK:
@@ -154,9 +160,6 @@ input_item_t *DirRead(access_t *access)
 default:
 continue; /* ignore */
 }
-#else
-type = ITEM_TYPE_FILE;
-#endif
 
 /* Create an input item for the current entry */
 char *encoded= encode_URI_component(entry);

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] vlc_common.h: remove legacy code for Darwin < 10 releases

2015-11-05 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Thu Nov  5 
23:42:57 2015 +0100| [206a974932403bea3486e21cdc3eadfc5f7e8065] | committer: 
Felix Paul Kühne

vlc_common.h: remove legacy code for Darwin < 10 releases

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=206a974932403bea3486e21cdc3eadfc5f7e8065
---

 include/vlc_common.h |   20 
 1 file changed, 20 deletions(-)

diff --git a/include/vlc_common.h b/include/vlc_common.h
index 786f349..6a6f6c6 100644
--- a/include/vlc_common.h
+++ b/include/vlc_common.h
@@ -825,26 +825,6 @@ VLC_API bool vlc_ureduce( unsigned *, unsigned *, 
uint64_t, uint64_t, uint64_t )
 #elif defined(_MSC_VER)
 # define vlc_memalign(align, size) (_aligned_malloc(size, align))
 # define vlc_free(base)(_aligned_free(base))
-#elif defined(__APPLE__) && !defined(MAC_OS_X_VERSION_10_6)
-static inline void *vlc_memalign(size_t align, size_t size)
-{
-long diff;
-void *ptr;
-
-ptr = malloc(size+align);
-if(!ptr)
-return ptr;
-diff = ((-(long)ptr - 1)&(align-1)) + 1;
-ptr  = (char*)ptr + diff;
-((char*)ptr)[-1]= diff;
-return ptr;
-}
-
-static void vlc_free(void *ptr)
-{
-if (ptr)
-free((char*)ptr - ((char*)ptr)[-1]);
-}
 #else
 static inline void *vlc_memalign(size_t align, size_t size)
 {

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] vlc_common.h: add Darwin include for PATH_MAX

2015-11-05 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Thu Nov  5 
23:37:52 2015 +0100| [c589758c44befea20cae0fca4224eb7c80fb933f] | committer: 
Felix Paul Kühne

vlc_common.h: add Darwin include for PATH_MAX

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c589758c44befea20cae0fca4224eb7c80fb933f
---

 include/vlc_common.h |8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/include/vlc_common.h b/include/vlc_common.h
index 57f3cb7..786f349 100644
--- a/include/vlc_common.h
+++ b/include/vlc_common.h
@@ -400,6 +400,11 @@ typedef enum
 #   include 
 #endif
 
+#ifdef __APPLE__
+#include 
+#include 
+#endif
+
 #ifdef __OS2__
 #   define OS2EMX_PLAIN_CHAR
 #   define INCL_BASE
@@ -813,9 +818,6 @@ static inline void SetQWLE (void *p, uint64_t qw)
 VLC_API bool vlc_ureduce( unsigned *, unsigned *, uint64_t, uint64_t, uint64_t 
);
 
 /* Aligned memory allocator */
-#ifdef __APPLE__
-#include 
-#endif
 
 #ifdef __MINGW32__
 # define vlc_memalign(align, size) (__mingw_aligned_malloc(size, align))

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] Rewrite README as restructured text

2015-11-05 Thread Olivier Aubert
vlc/python | branch: master | Olivier Aubert  | Thu 
Nov  5 23:54:52 2015 +0100| [ed305dbe236403def2c76f90217f645dfbe5b377] | 
committer: Olivier Aubert

Rewrite README as restructured text

> http://git.videolan.org/gitweb.cgi/vlc/python.git/?a=commit;h=ed305dbe236403def2c76f90217f645dfbe5b377
---

 README => README.rst |   78 --
 1 file changed, 43 insertions(+), 35 deletions(-)

diff --git a/README b/README.rst
similarity index 51%
rename from README
rename to README.rst
index 528f893..59464de 100644
--- a/README
+++ b/README.rst
@@ -1,21 +1,27 @@
-* Python ctypes-based bindings for libvlc
+Python ctypes-based bindings for libvlc
+===
 
 The bindings use ctypes to directly call the libvlc dynamic lib, and
 the code is generated from the include files defining the public
 API. The same module is compatible with various versions of libvlc
 2.*.
 
-** License
+License
+---
 
 The generated module is licensed, like libvlc, under the GNU Lesser
 General Public License 2.1 or later. The module generator itself is
 licensed under the GNU General Public License version 2 or later.
 
-** Building
+Building from source
+
+
+You can get the latest version of the code generator from
+
 
 To generate the vlc.py module and its documentation, use
-make
-or use the generated/vlc.py file.
+
+make
 
 To install it for development purposes (add a symlink to your Python
 library) simply do
@@ -27,9 +33,10 @@ preferably inside a virtualenv. You can uninstall it later 
with
 python setup.py develop --uninstall
 
 Documentation building needs epydoc. An online build is available at
-http://olivieraubert.net/vlc/python-ctypes/
+
 
-** Layout
+Layout
+--
 
 The module offers two ways of accessing the API - a raw access to all
 exported methods, and more convenient wrapper classes :
@@ -42,43 +49,44 @@ exported methods, and more convenient wrapper classes :
   Media, MediaPlayer, etc) are wrapped as classes, with shorter method
   names.
 
-** Using the module
+Using the module
+
 
-On win32, the simplest way is to put the vlc.py file in the same
+On win32, the simplest way is to put the ``vlc.py`` file in the same
 directory as the libvlc.dll file (standard location:
-c:\Program Files\VideoLAN\VLC ).
+``c:\Program Files\VideoLAN\VLC``).
 
 - Using raw access:
 
->>> import vlc
->>> vlc.libvlc_get_version()
-'1.0.0 Goldeneye'
->>> e=vlc.VLCException()
->>> i=vlc.libvlc_new(0, [], e)
->>> i
-
->>> vlc.libvlc_audio_get_volume(i,e)
-50
+>>> import vlc
+>>> vlc.libvlc_get_version()
+'1.0.0 Goldeneye'
+>>> e=vlc.VLCException()
+>>> i=vlc.libvlc_new(0, [], e)
+>>> i
+
+>>> vlc.libvlc_audio_get_volume(i,e)
+50
 
 - Using wrapper classes:
 
->>> import vlc
->>> i=vlc.Instance('--no-audio', '--fullscreen')
->>> i.audio_get_volume()
-50
->>> p=i.media_player_new()
->>> m=i.media_new('file:///tmp/foo.avi')
->>> m.get_mrl()
-'file:///tmp/foo.avi'
->>> p.set_media(m)
->>> p.play()
+   >>> import vlc
+   >>> i=vlc.Instance('--no-audio', '--fullscreen')
+   >>> i.audio_get_volume()
+   50
+   >>> p=i.media_player_new()
+   >>> m=i.media_new('file:///tmp/foo.avi')
+   >>> m.get_mrl()
+   'file:///tmp/foo.avi'
+   >>> p.set_media(m)
+   >>> p.play()
 
 or shorter:
 
->>> import vlc
->>> p=vlc.MediaPlayer('file:///tmp/foo.avi')
->>> p.play()
+   >>> import vlc
+   >>> p=vlc.MediaPlayer('file:///tmp/foo.avi')
+   >>> p.play()
 
-In this latter case, a default vlc.Instance will be instanciated and
-stored in vlc._default_instance. It will be used to instanciate the
-various classes (Media, MediaList, MediaPlayer, etc).
+In this latter case, a default ``vlc.Instance`` will be instanciated and
+stored in ``vlc._default_instance``. It will be used to instanciate the
+various classes (``Media``, ``MediaList``, ``MediaPlayer``, etc).

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] Update setup.py with trove classifiers

2015-11-05 Thread Olivier Aubert
vlc/python | branch: master | Olivier Aubert  | Thu 
Nov  5 23:24:28 2015 +0100| [b3b1e6fa831d7b27c2d4a0ae64000207aea3bd42] | 
committer: Olivier Aubert

Update setup.py with trove classifiers

> http://git.videolan.org/gitweb.cgi/vlc/python.git/?a=commit;h=b3b1e6fa831d7b27c2d4a0ae64000207aea3bd42
---

 setup.py |   18 ++
 1 file changed, 18 insertions(+)

diff --git a/setup.py b/setup.py
index 3df31b7..ef96cd7 100644
--- a/setup.py
+++ b/setup.py
@@ -23,10 +23,28 @@ setup(name='python-vlc',
   version = '1.1.1',
   author='Olivier Aubert',
   author_email='cont...@olivieraubert.net',
+  maintainer='Olivier Aubert',
+  maintainer_email='cont...@olivieraubert.net',
   url='http://wiki.videolan.org/PythonBinding',
   py_modules=['vlc'],
   keywords = [ 'vlc', 'video' ],
   license = "GPL",
+  classifiers = [
+  "Development Status :: 5 - Production/Stable",
+  "Intended Audience :: Developers",
+  "License :: OSI Approved :: GNU Lesser General Public License v2 or 
later (LGPLv2+)",
+  "Operating System :: MacOS :: MacOS X",
+  "Operating System :: Microsoft :: Windows",
+  "Operating System :: POSIX :: Linux",
+  "Operating System :: POSIX :: Other",
+  "Programming Language :: Python",
+  "Programming Language :: Python :: 2",
+  "Programming Language :: Python :: 3",
+  "Topic :: Multimedia",
+  "Topic :: Multimedia :: Sound/Audio",
+  "Topic :: Multimedia :: Video",
+  "Topic :: Software Development :: Code Generators"
+  ],
   description = "VLC bindings for python.",
   long_description = """VLC bindings for python.
 

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] Move generator code and test module to subdirs

2015-11-05 Thread Olivier Aubert
vlc/python | branch: master | Olivier Aubert  | Thu 
Nov  5 23:41:49 2015 +0100| [3edec464912b1de7d583cfefb5c457021caf7571] | 
committer: Olivier Aubert

Move generator code and test module to subdirs

> http://git.videolan.org/gitweb.cgi/vlc/python.git/?a=commit;h=3edec464912b1de7d583cfefb5c457021caf7571
---

 Makefile   |8 
 generated/vlc.py   |2 +-
 LibVlc-footer.java => generator/LibVlc-footer.java |0
 LibVlc-header.java => generator/LibVlc-header.java |0
 boilerplate.java => generator/boilerplate.java |0
 footer.py => generator/footer.py   |0
 generate.py => generator/generate.py   |   16 +---
 header.py => generator/header.py   |0
 override.py => generator/override.py   |0
 test.py => tests/test.py   |0
 10 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/Makefile b/Makefile
index f972e50..0d4f466 100644
--- a/Makefile
+++ b/Makefile
@@ -2,17 +2,17 @@ MODULE_NAME=generated/vlc.py
 
 all: $(MODULE_NAME)
 
-$(MODULE_NAME): generate.py header.py footer.py override.py 
../../include/vlc/*.h
-   python generate.py ../../include/vlc/*.h -o $@
+$(MODULE_NAME): generator/generate.py generator/header.py generator/footer.py 
generator/override.py ../../include/vlc/*.h
+   python generator/generate.py ../../include/vlc/*.h -o $@
 
 doc: $(MODULE_NAME)
-epydoc -v -o doc $<
 
 test: $(MODULE_NAME)
-   PYTHONPATH=generated python test.py
+   PYTHONPATH=generated python tests/test.py
 
 test3: $(MODULE_NAME)
-   PYTHONPATH=generated python3 test.py
+   PYTHONPATH=generated python3 tests/test.py
 
 tests: test test3
 
diff --git a/generated/vlc.py b/generated/vlc.py
old mode 100755
new mode 100644
index 4065825..ae8da48
--- a/generated/vlc.py
+++ b/generated/vlc.py
@@ -49,7 +49,7 @@ import functools
 from inspect import getargspec
 
 __version__ = "N/A"
-build_date  = "Wed Sep 30 15:51:48 2015"
+build_date  = "Thu Nov  5 23:41:43 2015"
 
 # The libvlc doc states that filenames are expected to be in UTF8, do
 # not rely on sys.getfilesystemencoding() which will be confused,
diff --git a/LibVlc-footer.java b/generator/LibVlc-footer.java
similarity index 100%
rename from LibVlc-footer.java
rename to generator/LibVlc-footer.java
diff --git a/LibVlc-header.java b/generator/LibVlc-header.java
similarity index 100%
rename from LibVlc-header.java
rename to generator/LibVlc-header.java
diff --git a/boilerplate.java b/generator/boilerplate.java
similarity index 100%
rename from boilerplate.java
rename to generator/boilerplate.java
diff --git a/footer.py b/generator/footer.py
similarity index 100%
rename from footer.py
rename to generator/footer.py
diff --git a/generate.py b/generator/generate.py
similarity index 98%
rename from generate.py
rename to generator/generate.py
index e7230ed..38f111c 100755
--- a/generate.py
+++ b/generator/generate.py
@@ -61,6 +61,8 @@ import re
 import time
 import operator
 
+BASEDIR = os.path.abspath(os.path.dirname(sys.argv[0]))
+
 # Opener for text files
 if sys.hexversion < 0x300:
 def opener(name, mode='r'):
@@ -1040,7 +1042,7 @@ class _Enum(ctypes.c_uint):
 def striprefix(name):
 return name.replace(x, '').replace('libvlc_', '')
 
-codes, methods, docstrs = self.parse_override('override.py')
+codes, methods, docstrs = self.parse_override(os.path.join(BASEDIR, 
'override.py'))
 
 # sort functions on the type/class
 # of their first parameter
@@ -1158,14 +1160,14 @@ class _Enum(ctypes.c_uint):
 """Write Python bindings to a file or C{stdout}.
 """
 self.outopen(path or '-')
-self.insert_code('header.py', genums=True)
+self.insert_code(os.path.join(BASEDIR, 'header.py'), genums=True)
 
 self.generate_wrappers()
 self.generate_ctypes()
 
 self.unwrapped()
 
-self.insert_code('footer.py')
+self.insert_code(os.path.join(BASEDIR, 'footer.py'))
 self.outclose()
 
 
@@ -1228,7 +1230,7 @@ class JavaGenerator(_Generator):
 j = self.class4(e.name)
 self.outopen(j + '.java')
 
-self.insert_code('boilerplate.java')
+self.insert_code(os.path.join(BASEDIR, 'boilerplate.java'))
 self.output("""package org.videolan.jvlc.internal;
 
 public enum %s
@@ -1258,8 +1260,8 @@ public enum %s
 """
 self.outopen('LibVlc.java')
 
-self.insert_code('boilerplate.java')
-self.insert_code('LibVlc-header.java')
+self.insert_code(os.path.join(BASEDIR, 'boilerplate.java'))
+self.insert_code(os.path.join(BASEDIR, 'LibVlc-header.java'))
 
 self.generate_header()
 for f in self.parser.funcs:
@@ -1267,7 +1269,7 @@ public enum %s
 p =', '.join('%s %s' % 

[vlc-commits] Update version number

2015-11-05 Thread Olivier Aubert
vlc/python | branch: master | Olivier Aubert  | Thu 
Nov  5 23:14:19 2015 +0100| [e4654db1ee75d6848e8a8e2db2a71d140bc1f6d6] | 
committer: Olivier Aubert

Update version number

> http://git.videolan.org/gitweb.cgi/vlc/python.git/?a=commit;h=e4654db1ee75d6848e8a8e2db2a71d140bc1f6d6
---

 setup.py |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/setup.py b/setup.py
index ce8182e..3df31b7 100644
--- a/setup.py
+++ b/setup.py
@@ -20,7 +20,7 @@ else:
 shutil.copy(os.path.join('generated', 'vlc.py'), 'vlc.py')
 
 setup(name='python-vlc',
-  version = '1.1.0',
+  version = '1.1.1',
   author='Olivier Aubert',
   author_email='cont...@olivieraubert.net',
   url='http://wiki.videolan.org/PythonBinding',

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] Freetype: don't use deprecated Fribidi functions

2015-11-05 Thread Jean-Baptiste Kempf
vlc | branch: master | Jean-Baptiste Kempf  | Thu Nov  5 
23:26:18 2015 +0100| [17e9c422d795270aa76bde93202df5f2c8283d9e] | committer: 
Jean-Baptiste Kempf

Freetype: don't use deprecated Fribidi functions

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=17e9c422d795270aa76bde93202df5f2c8283d9e
---

 modules/text_renderer/text_layout.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/modules/text_renderer/text_layout.c 
b/modules/text_renderer/text_layout.c
index f0d6fc5..77c5969 100644
--- a/modules/text_renderer/text_layout.c
+++ b/modules/text_renderer/text_layout.c
@@ -52,6 +52,7 @@
 
 /* RTL */
 #if defined(HAVE_FRIBIDI)
+# define FRIBIDI_NO_DEPRECATED 1
 # include 
 #endif
 

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] Update README

2015-11-05 Thread Olivier Aubert
vlc/python | branch: master | Olivier Aubert  | Thu 
Nov  5 23:46:15 2015 +0100| [ecf6b031c90632a4cfd400ff7e26b7b0357b57ef] | 
committer: Olivier Aubert

Update README

> http://git.videolan.org/gitweb.cgi/vlc/python.git/?a=commit;h=ecf6b031c90632a4cfd400ff7e26b7b0357b57ef
---

 README |   10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/README b/README
index d4b43d3..528f893 100644
--- a/README
+++ b/README
@@ -1,7 +1,9 @@
 * Python ctypes-based bindings for libvlc
 
 The bindings use ctypes to directly call the libvlc dynamic lib, and
-the code is generated from the include files defining the public API.
+the code is generated from the include files defining the public
+API. The same module is compatible with various versions of libvlc
+2.*.
 
 ** License
 
@@ -24,8 +26,8 @@ preferably inside a virtualenv. You can uninstall it later 
with
 
 python setup.py develop --uninstall
 
-Documentation building needs epydoc. An online build is available at 
-http://advene.org/download/python-ctypes/
+Documentation building needs epydoc. An online build is available at
+http://olivieraubert.net/vlc/python-ctypes/
 
 ** Layout
 
@@ -34,7 +36,7 @@ exported methods, and more convenient wrapper classes :
 
 - Raw access: methods are available as attributes of the vlc
   module. Use their docstring (any introspective shell like ipython is
-  your friends) to explore them. 
+  your friends) to explore them.
 
 - Wrapper classes: most major structures of the libvlc API (Instance,
   Media, MediaPlayer, etc) are wrapped as classes, with shorter method

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] test: add test_media_subitems

2015-11-05 Thread Thomas Guillem
vlc | branch: master | Thomas Guillem  | Wed Nov  4 18:14:56 
2015 +0100| [e4695f0adfd6514ed00c1f0aac6881de4353b596] | committer: Thomas 
Guillem

test: add test_media_subitems

Test media subitems when parsing a directory via a path, via a fd and via
various locations.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e4695f0adfd6514ed00c1f0aac6881de4353b596
---

 test/libvlc/media.c |  143 ++-
 1 file changed, 142 insertions(+), 1 deletion(-)

diff --git a/test/libvlc/media.c b/test/libvlc/media.c
index aceba84..e6201c5 100644
--- a/test/libvlc/media.c
+++ b/test/libvlc/media.c
@@ -22,8 +22,12 @@
  **/
 
 #include "test.h"
+#include "../lib/libvlc_internal.h"
+
+#include 
+#include 
+#include 
 
-#include 
 #include 
 
 static void preparsed_changed(const libvlc_event_t *event, void *user_data)
@@ -71,11 +75,148 @@ static void test_media_preparsed(const char** argv, int 
argc)
 libvlc_release (vlc);
 }
 
+#define TEST_SUBITEMS_COUNT 6
+struct
+{
+const char *file;
+libvlc_media_type_t type;
+} test_media_subitems_list[TEST_SUBITEMS_COUNT] =
+{
+{ "directory", libvlc_media_type_directory, },
+{ "file.jpg", libvlc_media_type_file },
+{ "file.mkv", libvlc_media_type_file },
+{ "file.mp3", libvlc_media_type_file },
+{ "file.png", libvlc_media_type_file },
+{ "file.ts", libvlc_media_type_file },
+};
+
+static void subitem_tree_added(const libvlc_event_t *event, void *user_data)
+{
+(void)event;
+vlc_sem_t *sem = user_data;
+vlc_sem_post (sem);
+}
+
+static void subitem_added(const libvlc_event_t *event, void *user_data)
+{
+#ifdef _WIN32
+#define FILE_SEPARATOR   '\\'
+#else
+#define FILE_SEPARATOR   '/'
+#endif
+bool *subitems_found = user_data;
+libvlc_media_t *m = event->u.media_subitem_added.new_child;
+assert (m);
+
+char *mrl = libvlc_media_get_mrl (m);
+assert (mrl);
+
+const char *file = strrchr (mrl, FILE_SEPARATOR);
+assert (file);
+file++;
+log ("subitem_added, file: %s\n", file);
+
+for (unsigned i = 0; i < TEST_SUBITEMS_COUNT; ++i)
+{
+if (strcmp (test_media_subitems_list[i].file, file) == 0)
+{
+assert (!subitems_found[i]);
+assert (libvlc_media_get_type(m) == 
test_media_subitems_list[i].type);
+subitems_found[i] = true;
+}
+}
+free (mrl);
+#undef FILE_SEPARATOR
+}
+
+static void test_media_subitems_media(libvlc_media_t *media, bool play)
+{
+libvlc_media_add_option(media, ":ignore-filetypes= ");
+
+bool subitems_found[TEST_SUBITEMS_COUNT] = { 0 };
+vlc_sem_t sem;
+vlc_sem_init (, 0);
+
+libvlc_event_manager_t *em = libvlc_media_event_manager (media);
+libvlc_event_attach (em, libvlc_MediaSubItemTreeAdded, subitem_tree_added, 
);
+libvlc_event_attach (em, libvlc_MediaSubItemAdded, subitem_added, 
subitems_found);
+
+if (play)
+{
+/* XXX: libvlc_media_parse_async won't work with fd, since it won't be
+ * preparsed because fd:// is an unknown type, so play the file to
+ * force parsing. */
+libvlc_media_player_t *mp = libvlc_media_player_new_from_media (media);
+assert (mp);
+assert (libvlc_media_player_play (mp) != -1);
+vlc_sem_wait ();
+libvlc_media_player_release (mp);
+}
+else
+{
+libvlc_media_parse_async (media);
+vlc_sem_wait ();
+}
+
+vlc_sem_destroy ();
+
+for (unsigned i = 0; i < TEST_SUBITEMS_COUNT; ++i)
+{
+log ("test if %s was added\n", test_media_subitems_list[i].file);
+assert (subitems_found[i]);
+}
+}
+
+static void test_media_subitems(const char** argv, int argc)
+{
+const char *subitems_path = SRCDIR"/samples/subitems";
+
+libvlc_instance_t *vlc = libvlc_new (argc, argv);
+assert (vlc != NULL);
+libvlc_media_t *media;
+
+log ("Testing media_subitems: path: '%s'\n", subitems_path);
+media = libvlc_media_new_path (vlc, subitems_path);
+assert (media != NULL);
+test_media_subitems_media (media, false);
+libvlc_media_release (media);
+
+#define NB_LOCATIONS 3
+char *subitems_realpath = realpath (subitems_path, NULL);
+assert (subitems_realpath != NULL);
+const char *schemes[NB_LOCATIONS] = { "file://", "stream://", "dir://" };
+for (unsigned i = 0; i < NB_LOCATIONS; ++i)
+{
+char *location;
+assert (asprintf (, "%s%s", schemes[i], subitems_realpath) != 
-1);
+log ("Testing media_subitems: location: '%s'\n", location);
+media = libvlc_media_new_location (vlc, location);
+assert (media != NULL);
+test_media_subitems_media (media, false);
+free (location);
+libvlc_media_release (media);
+}
+free (subitems_realpath);
+
+int fd = open (subitems_path, O_RDONLY);
+log ("Testing media_subitems: 

[vlc-commits] demux: adaptative: fix warning

2015-11-05 Thread Francois Cartegnie
vlc | branch: master | Francois Cartegnie  | Thu Nov  5 
16:34:12 2015 +0100| [f09f614ba9c219843c67157fbd04a57325e70441] | committer: 
Francois Cartegnie

demux: adaptative: fix warning

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f09f614ba9c219843c67157fbd04a57325e70441
---

 modules/demux/dash/DASHManager.cpp|2 +-
 modules/demux/hls/playlist/Representation.cpp |2 +-
 modules/demux/hls/playlist/Representation.hpp |2 +-
 modules/demux/smooth/SmoothManager.cpp|2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/demux/dash/DASHManager.cpp 
b/modules/demux/dash/DASHManager.cpp
index b931c27..19e382f 100644
--- a/modules/demux/dash/DASHManager.cpp
+++ b/modules/demux/dash/DASHManager.cpp
@@ -134,7 +134,7 @@ bool DASHManager::updatePlaylist()
 nextPlaylistupdate = now + (mininterval + (maxinterval - mininterval) / 2) 
/ CLOCK_FREQ;
 
 msg_Dbg(p_demux, "Updated MPD, next update in %" PRId64 "s (%" PRId64 
"..%" PRId64 ")",
-nextPlaylistupdate - now, mininterval/ CLOCK_FREQ, maxinterval/ 
CLOCK_FREQ );
+(mtime_t) nextPlaylistupdate - now, mininterval/ CLOCK_FREQ, 
maxinterval/ CLOCK_FREQ );
 
 return true;
 }
diff --git a/modules/demux/hls/playlist/Representation.cpp 
b/modules/demux/hls/playlist/Representation.cpp
index 2b040d3..1e8e8c5 100644
--- a/modules/demux/hls/playlist/Representation.cpp
+++ b/modules/demux/hls/playlist/Representation.cpp
@@ -131,7 +131,7 @@ void Representation::runLocalUpdates(mtime_t 
/*currentplaybacktime*/, uint64_t n
 nextPlaylistupdate = now + (mininterval + (maxinterval - mininterval) 
/ 2) / CLOCK_FREQ;
 
 msg_Dbg(playlist->getVLCObject(), "Updated playlist ID %s, next update 
in %" PRId64 "s",
-getID().str().c_str(), nextPlaylistupdate - now);
+getID().str().c_str(), (mtime_t) nextPlaylistupdate - now);
 
 debug(playlist->getVLCObject(), 0);
 }
diff --git a/modules/demux/hls/playlist/Representation.hpp 
b/modules/demux/hls/playlist/Representation.hpp
index 706d791..780d1fd 100644
--- a/modules/demux/hls/playlist/Representation.hpp
+++ b/modules/demux/hls/playlist/Representation.hpp
@@ -56,7 +56,7 @@ namespace hls
 StreamFormat streamFormat;
 bool b_live;
 bool b_loaded;
-mtime_t nextPlaylistupdate;
+time_t nextPlaylistupdate;
 Url playlistUrl;
 Property audio;
 Property video;
diff --git a/modules/demux/smooth/SmoothManager.cpp 
b/modules/demux/smooth/SmoothManager.cpp
index 10919b4..42e9ed9 100644
--- a/modules/demux/smooth/SmoothManager.cpp
+++ b/modules/demux/smooth/SmoothManager.cpp
@@ -143,7 +143,7 @@ bool SmoothManager::updatePlaylist()
 nextPlaylistupdate = now + (mininterval + (maxinterval - mininterval) / 2) 
/ CLOCK_FREQ;
 
 //msg_Dbg(p_demux, "Updated Manifest, next update in %" PRId64 "s (%" 
PRId64 "..%" PRId64 ")",
-//nextPlaylistupdate - now, mininterval/ CLOCK_FREQ, maxinterval/ 
CLOCK_FREQ );
+//   (mtime_t) nextPlaylistupdate - now, mininterval/ CLOCK_FREQ, 
maxinterval/ CLOCK_FREQ );
 
 return true;
 }

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] Contribs: update dvbpsi to 1.3.0

2015-11-05 Thread Thomas Guillem
vlc | branch: master | Thomas Guillem  | Thu Nov  5 16:08:47 
2015 +0100| [0ac74ba8d90824aa56da44f3de33a3be2f51fe6f] | committer: Thomas 
Guillem

Contribs: update dvbpsi to 1.3.0

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0ac74ba8d90824aa56da44f3de33a3be2f51fe6f
---

 contrib/src/dvbpsi/SHA512SUMS |2 +-
 contrib/src/dvbpsi/rules.mak  |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/contrib/src/dvbpsi/SHA512SUMS b/contrib/src/dvbpsi/SHA512SUMS
index 0efeaec..6af064d 100644
--- a/contrib/src/dvbpsi/SHA512SUMS
+++ b/contrib/src/dvbpsi/SHA512SUMS
@@ -1 +1 @@
-951db13f5645d4d6a160719fc6ac97fd31a32d5d17cb8e26db94702e65b6fac3d4e7a99c3c417e09fe5ce33f3b0c0ef86206c77b36816dcd8a3bd5b0bb4a9684
  libdvbpsi-1.2.0.tar.bz2
+59f097a1032e8cf461210128c7468da4204f077a61f68f2be3310e60004774157335cd7cba82271fcc89b7b6b17a12a06b6214357227ec9976281d9b50565c54
  libdvbpsi-1.3.0.tar.bz2
diff --git a/contrib/src/dvbpsi/rules.mak b/contrib/src/dvbpsi/rules.mak
index 556706e..18fd27e 100644
--- a/contrib/src/dvbpsi/rules.mak
+++ b/contrib/src/dvbpsi/rules.mak
@@ -1,6 +1,6 @@
 # dvbpsi
 
-DVBPSI_VERSION := 1.2.0
+DVBPSI_VERSION := 1.3.0
 DVBPSI_URL := 
$(VIDEOLAN)/libdvbpsi/$(DVBPSI_VERSION)/libdvbpsi-$(DVBPSI_VERSION).tar.bz2
 
 PKGS += dvbpsi

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] demux: adaptative: fix bitrate maths

2015-11-05 Thread Francois Cartegnie
vlc | branch: master | Francois Cartegnie  | Thu Nov  5 
15:57:06 2015 +0100| [be322be4264ec3043f7eced3987be981e0a06cfc] | committer: 
Francois Cartegnie

demux: adaptative: fix bitrate maths

::facepalm

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=be322be4264ec3043f7eced3987be981e0a06cfc
---

 modules/demux/adaptative/logic/RateBasedAdaptationLogic.cpp |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/demux/adaptative/logic/RateBasedAdaptationLogic.cpp 
b/modules/demux/adaptative/logic/RateBasedAdaptationLogic.cpp
index ada891f..a936f95 100644
--- a/modules/demux/adaptative/logic/RateBasedAdaptationLogic.cpp
+++ b/modules/demux/adaptative/logic/RateBasedAdaptationLogic.cpp
@@ -63,7 +63,7 @@ void RateBasedAdaptationLogic::updateDownloadRate(size_t 
size, mtime_t time)
 if(unlikely(time == 0))
 return;
 
-size_t current = bpsRemainder + size * 8000 / time;
+size_t current = bpsRemainder + CLOCK_FREQ * size * 8 / time;
 
 if (current >= bpsAvg)
 {

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] demux: mp4: remove unused CreateUUID

2015-11-05 Thread Francois Cartegnie
vlc | branch: master | Francois Cartegnie  | Wed Nov  4 
18:09:24 2015 +0100| [a5737c170eebf6a3cb53688358530fbbd3a5c7e7] | committer: 
Francois Cartegnie

demux: mp4: remove unused CreateUUID

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a5737c170eebf6a3cb53688358530fbbd3a5c7e7
---

 modules/demux/mp4/libmp4.c |8 +---
 modules/demux/mp4/libmp4.h |9 -
 2 files changed, 1 insertion(+), 16 deletions(-)

diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index 78758a6..8b3ad81 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -159,10 +159,7 @@ int MP4_PeekBoxHeader( stream_t *p_stream, MP4_Box_t 
*p_box )
 /* get extented type on 16 bytes */
 GetUUID( _box->i_uuid, p_peek );
 }
-else
-{
-CreateUUID( _box->i_uuid, p_box->i_type );
-}
+
 #ifdef MP4_ULTRA_VERBOSE
 if( p_box->i_size )
 {
@@ -4108,9 +4105,6 @@ MP4_Box_t *MP4_BoxGetRoot( stream_t *p_stream )
 if( i_size > 0 )
 p_vroot->i_size = i_size;
 
-/* could be a DASH stream for exemple, 0 means unknown or infinite size */
-CreateUUID( _vroot->i_uuid, p_vroot->i_type );
-
 /* First get the moov */
 const uint32_t stoplist[] = { ATOM_moov, ATOM_mdat, 0 };
 i_result = MP4_ReadBoxContainerChildren( p_stream, p_vroot, stoplist );
diff --git a/modules/demux/mp4/libmp4.h b/modules/demux/mp4/libmp4.h
index 79e7af7..d066e2a 100644
--- a/modules/demux/mp4/libmp4.h
+++ b/modules/demux/mp4/libmp4.h
@@ -1628,15 +1628,6 @@ static inline int CmpUUID( const UUID_t *u1, const 
UUID_t *u2 )
 return memcmp( u1, u2, 16 );
 }
 
-static inline void CreateUUID( UUID_t *p_uuid, uint32_t i_fourcc )
-{
-/* made by 0x-0011-0010-8000-00aa00389b71
-where  is the fourcc */
-/* FIXME implement this */
-(void)p_uuid;
-(void)i_fourcc;
-}
-
 static const UUID_t TfrfBoxUUID = {
 { 0xd4, 0x80, 0x7e, 0xf2, 0xca, 0x39, 0x46, 0x95,
   0x8e, 0x54, 0x26, 0xcb, 0x9e, 0x46, 0xa7, 0x9f } };

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] demux: mp4: remove superfluous include

2015-11-05 Thread Francois Cartegnie
vlc | branch: master | Francois Cartegnie  | Wed Nov  4 
18:09:48 2015 +0100| [bdd933951d35e3af917731d07a8d5152cf91d451] | committer: 
Francois Cartegnie

demux: mp4: remove superfluous include

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bdd933951d35e3af917731d07a8d5152cf91d451
---

 modules/demux/mp4/mp4.c |4 
 1 file changed, 4 deletions(-)

diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index 9bfcf0e..179939e 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -24,10 +24,6 @@
  * Preamble
  */
 
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
 #include "mp4.h"
 
 #include 

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] contrib: soxr: fix build with arm64

2015-11-05 Thread Thomas Guillem
vlc | branch: master | Thomas Guillem  | Thu Nov  5 14:45:38 
2015 +0100| [dacc4cb76266734692dc11d6ccd48a59ddd0ccd5] | committer: Thomas 
Guillem

contrib: soxr: fix build with arm64

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=dacc4cb76266734692dc11d6ccd48a59ddd0ccd5
---

 .../0003-config-use-stdint.h-and-stdbool.h.patch   |   53 
 contrib/src/soxr/rules.mak |1 +
 2 files changed, 54 insertions(+)

diff --git a/contrib/src/soxr/0003-config-use-stdint.h-and-stdbool.h.patch 
b/contrib/src/soxr/0003-config-use-stdint.h-and-stdbool.h.patch
new file mode 100644
index 000..a0866e9
--- /dev/null
+++ b/contrib/src/soxr/0003-config-use-stdint.h-and-stdbool.h.patch
@@ -0,0 +1,53 @@
+From 0a07b23a280b3a80dc933edc0db3aafd2bb5626f Mon Sep 17 00:00:00 2001
+From: Thomas Guillem 
+Date: Thu, 5 Nov 2015 14:16:51 +0100
+Subject: [PATCH 3/3] config: use stdint.h and stdbool.h
+
+---
+ soxr-config.h.in | 31 ++-
+ 1 file changed, 2 insertions(+), 29 deletions(-)
+
+diff --git a/soxr-config.h.in b/soxr-config.h.in
+index 227bcfd..539efe0 100644
+--- a/soxr-config.h.in
 b/soxr-config.h.in
+@@ -13,34 +13,7 @@
+ #define WORDS_BIGENDIAN   @WORDS_BIGENDIAN@
+ 
+ #include 
+-
+-#undef bool
+-#undef false
+-#undef true
+-#define bool int
+-#define false 0
+-#define true 1
+-
+-#undef int16_t
+-#undef int32_t
+-#undef int64_t
+-#undef uint32_t
+-#undef uint64_t
+-#define int16_t short
+-#if LONG_MAX > 2147483647L
+-  #define int32_t int
+-  #define int64_t long
+-#elif LONG_MAX < 2147483647L
+-#error this library requires that 'long int' has at least 32-bits
+-#else
+-  #define int32_t long
+-  #if defined _MSC_VER
+-#define int64_t __int64
+-  #else
+-#define int64_t long long
+-  #endif
+-#endif
+-#define uint32_t unsigned int32_t
+-#define uint64_t unsigned int64_t
++#include 
++#include 
+ 
+ #endif
+-- 
+2.1.4
+
diff --git a/contrib/src/soxr/rules.mak b/contrib/src/soxr/rules.mak
index 489c847..90b9b7d 100644
--- a/contrib/src/soxr/rules.mak
+++ b/contrib/src/soxr/rules.mak
@@ -17,6 +17,7 @@ soxr: soxr-$(SOXR_VERSION)-Source.tar.xz .sum-soxr
$(UNPACK)
$(APPLY) $(SRC)/soxr/0001-FindSIMD-add-arm-neon-detection.patch
$(APPLY) 
$(SRC)/soxr/0002-cpu_has_simd-detect-neon-via-av_get_cpu_flags.patch
+   $(APPLY) $(SRC)/soxr/0003-config-use-stdint.h-and-stdbool.h.patch
$(MOVE)
 
 .soxr: soxr toolchain.cmake

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] demux: mp4: simplify getnextchunk call

2015-11-05 Thread Francois Cartegnie
vlc | branch: master | Francois Cartegnie  | Wed Nov  4 
19:28:13 2015 +0100| [fc9609800ca7da65744134bf70ccad903ea83f24] | committer: 
Francois Cartegnie

demux: mp4: simplify getnextchunk call

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fc9609800ca7da65744134bf70ccad903ea83f24
---

 modules/demux/mp4/mp4.c |   25 -
 1 file changed, 4 insertions(+), 21 deletions(-)

diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index 179939e..3175ed3 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -3774,25 +3774,6 @@ int DemuxFrg( demux_t *p_demux )
 return 1;
 }
 
-static MP4_Box_t * LoadNextChunk( demux_t *p_demux )
-{
-/* Read Next Chunk */
-MP4_Box_t *p_chunk = MP4_BoxGetNextChunk( p_demux->s );
-if( !p_chunk )
-{
-msg_Warn( p_demux, "no next chunk" );
-return NULL;
-}
-
-if( !p_chunk->p_first )
-{
-msg_Warn( p_demux, "no next chunk child" );
-return NULL;
-}
-
-return p_chunk;
-}
-
 static bool BoxExistsInRootTree( MP4_Box_t *p_root, uint32_t i_type, uint64_t 
i_pos )
 {
 while ( p_root )
@@ -4804,7 +4785,9 @@ static int DemuxAsLeaf( demux_t *p_demux )
 const int i_tell = stream_Tell( p_demux->s );
 if ( i_tell >= 0 && ! BoxExistsInRootTree( p_sys->p_root, 
p_sys->context.i_current_box_type, (uint64_t)i_tell ) )
 {// only if !b_probed ??
-MP4_Box_t *p_vroot = LoadNextChunk( p_demux );
+MP4_Box_t *p_vroot = MP4_BoxGetNextChunk( p_demux->s );
+if(!p_vroot)
+return 1;
 
 MP4_Box_t *p_fragbox = MP4_BoxGet( p_vroot, "moof" );
 if( !p_fragbox )
@@ -4816,7 +4799,7 @@ static int DemuxAsLeaf( demux_t *p_demux )
 if(!p_fragbox)
 {
 MP4_BoxFree( p_vroot );
-msg_Err(p_demux, "no moof or moov in current chunk");
+msg_Info(p_demux, "no moof or moov in current chunk");
 return 1;
 }
 

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] demux: adaptative: handle peek error code (fix #15819)

2015-11-05 Thread Francois Cartegnie
vlc | branch: master | Francois Cartegnie  | Thu Nov  5 
14:54:08 2015 +0100| [b7d2d2a8ce271a60a519629928f62544128e3048] | committer: 
Francois Cartegnie

demux: adaptative: handle peek error code (fix #15819)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b7d2d2a8ce271a60a519629928f62544128e3048
---

 modules/demux/adaptative/adaptative.cpp |   25 ++---
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/modules/demux/adaptative/adaptative.cpp 
b/modules/demux/adaptative/adaptative.cpp
index 8f91a06..be12c05 100644
--- a/modules/demux/adaptative/adaptative.cpp
+++ b/modules/demux/adaptative/adaptative.cpp
@@ -161,22 +161,25 @@ static int Open(vlc_object_t *p_obj)
 {
 /* We need to probe content */
 const uint8_t *p_peek;
-const size_t i_peek = stream_Peek(p_demux->s, _peek, 2048);
-stream_t *peekstream = stream_MemoryNew(p_demux, 
const_cast(p_peek), i_peek, true);
-if(peekstream)
+const ssize_t i_peek = stream_Peek(p_demux->s, _peek, 2048);
+if(i_peek > 0)
 {
-if(xmlParser.reset(peekstream) && xmlParser.parse(false))
+stream_t *peekstream = stream_MemoryNew(p_demux, 
const_cast(p_peek), (size_t)i_peek, true);
+if(peekstream)
 {
-if(DASHManager::isDASH(xmlParser.getRootNode()))
+if(xmlParser.reset(peekstream) && xmlParser.parse(false))
 {
-p_manager = HandleDash(p_demux, xmlParser, 
playlisturl, logic);
-}
-else 
if(SmoothManager::isSmoothStreaming(xmlParser.getRootNode()))
-{
-p_manager = HandleSmooth(p_demux, xmlParser, 
playlisturl, logic);
+if(DASHManager::isDASH(xmlParser.getRootNode()))
+{
+p_manager = HandleDash(p_demux, xmlParser, 
playlisturl, logic);
+}
+else 
if(SmoothManager::isSmoothStreaming(xmlParser.getRootNode()))
+{
+p_manager = HandleSmooth(p_demux, xmlParser, 
playlisturl, logic);
+}
 }
+stream_Delete(peekstream);
 }
-stream_Delete(peekstream);
 }
 }
 }

___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits