[vlc-commits] videotoolbox: remove write-only variable

2015-12-05 Thread David Fuhrmann
vlc | branch: master | David Fuhrmann  | Sat Dec  5 
16:13:40 2015 +0100| [657705900ee01a8ae959d9fbaa88861519947119] | committer: 
David Fuhrmann

videotoolbox: remove write-only variable

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

 modules/codec/videotoolbox.m |1 -
 1 file changed, 1 deletion(-)

diff --git a/modules/codec/videotoolbox.m b/modules/codec/videotoolbox.m
index 415052d..61d86e8 100644
--- a/modules/codec/videotoolbox.m
+++ b/modules/codec/videotoolbox.m
@@ -308,7 +308,6 @@ static int StartVideoToolbox(decoder_t *p_dec, block_t 
*p_block)
 
 if (p_block == NULL) {
 int buf_size = p_dec->fmt_in.i_extra + 20;
-uint32_t i_nal_size = 0;
 size = p_dec->fmt_in.i_extra;
 
 p_alloc_buf = p_buf = malloc(buf_size);

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


[vlc-commits] h264_nal: fix memory corruption in parse_sps

2015-12-05 Thread David Fuhrmann
vlc | branch: master | David Fuhrmann  | Sat Dec  5 
16:16:19 2015 +0100| [d405bfb6fdeac41112482bcce793ee4efa8d5d51] | committer: 
David Fuhrmann

h264_nal: fix memory corruption in parse_sps

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

 modules/packetizer/h264_nal.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/packetizer/h264_nal.c b/modules/packetizer/h264_nal.c
index fee3f96..d5b04ae 100644
--- a/modules/packetizer/h264_nal.c
+++ b/modules/packetizer/h264_nal.c
@@ -417,7 +417,7 @@ int h264_parse_sps( const uint8_t *p_sps_buf, int 
i_sps_size,
 struct nal_sps *p_sps )
 {
 uint8_t *pb_dec = NULL;
-int i_dec = 0;
+size_t i_dec = 0;
 bs_t s;
 int i_tmp;
 

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


[vlc-commits] ftp: fix pf_readdir infinite loop

2015-12-05 Thread Thomas Guillem
vlc | branch: master | Thomas Guillem  | Sat Dec  5 13:46:50 
2015 +0100| [40669b1f39491ccf6033ad652290ebc2c4f33833] | committer: Thomas 
Guillem

ftp: fix pf_readdir infinite loop

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

 modules/access/ftp.c |   41 -
 1 file changed, 20 insertions(+), 21 deletions(-)

diff --git a/modules/access/ftp.c b/modules/access/ftp.c
index 80bb232..e8f4bea 100644
--- a/modules/access/ftp.c
+++ b/modules/access/ftp.c
@@ -861,29 +861,28 @@ static input_item_t* DirRead( access_t *p_access )
 assert( p_sys->data.fd != -1 );
 assert( !p_sys->out );
 
-for( ;;)
+char *psz_line;
+if( p_sys->data.p_tls != NULL )
+psz_line = vlc_tls_GetLine( p_sys->data.p_tls );
+else
+psz_line = net_Gets( p_access, p_sys->data.fd );
+if( psz_line == NULL )
+return NULL;
+
+char *psz_uri;
+if( asprintf( _uri, "%s://%s:%d%s%s/%s",
+  ( p_sys->tlsmode == NONE ) ? "ftp" :
+  ( ( p_sys->tlsmode == IMPLICIT ) ? "ftps" : "ftpes" ),
+  p_sys->url.psz_host, p_sys->url.i_port,
+  p_sys->url.psz_path ? "/" : "",
+  p_sys->url.psz_path ? p_sys->url.psz_path : "",
+  psz_line ) != -1 )
 {
-char *psz_line;
-if( p_sys->data.p_tls != NULL )
-psz_line = vlc_tls_GetLine( p_sys->data.p_tls );
-else
-psz_line = net_Gets( p_access, p_sys->data.fd );
-
-char *psz_uri;
-if( asprintf( _uri, "%s://%s:%d%s%s/%s",
-  ( p_sys->tlsmode == NONE ) ? "ftp" :
-  ( ( p_sys->tlsmode == IMPLICIT ) ? "ftps" : "ftpes" ),
-  p_sys->url.psz_host, p_sys->url.i_port,
-  p_sys->url.psz_path ? "/" : "",
-  p_sys->url.psz_path ? p_sys->url.psz_path : "",
-  psz_line ) != -1 )
-{
-p_item = input_item_NewWithTypeExt( psz_uri, psz_line, 0, NULL,
-0, -1, ITEM_TYPE_UNKNOWN, 1 );
-free( psz_uri );
-}
-free( psz_line );
+p_item = input_item_NewWithTypeExt( psz_uri, psz_line, 0, NULL,
+0, -1, ITEM_TYPE_UNKNOWN, 1 );
+free( psz_uri );
 }
+free( psz_line );
 return p_item;
 }
 

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


[vlc-commits] macosx: overhaul simple preferences interface

2015-12-05 Thread David Fuhrmann
vlc | branch: master | David Fuhrmann  | Sat Dec  5 
15:12:44 2015 +0100| [7e08a135c91a73a1f410cdbc1492465ae1b07114] | committer: 
David Fuhrmann

macosx: overhaul simple preferences interface

- cleanup interfaces section
- Regroup settings, move some to video section
- remove rarely used settings from the simple settings page
- reorder outlets and setup code

close #14504

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

 .../Resources/English.lproj/SimplePreferences.xib  |  863 ++--
 modules/gui/macosx/simple_prefs.h  |   76 +-
 modules/gui/macosx/simple_prefs.m  |  113 ++-
 3 files changed, 540 insertions(+), 512 deletions(-)

Diff:   
http://git.videolan.org/gitweb.cgi/vlc.git/?a=commitdiff;h=7e08a135c91a73a1f410cdbc1492465ae1b07114
___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] macosx: Allow to open https URLs, do not list VLC as a browser

2015-12-05 Thread David Fuhrmann
vlc | branch: master | David Fuhrmann  | Sat Dec  5 
17:12:22 2015 +0100| [66bab23eb7950a19279bad31dc642f8c87e90447] | committer: 
David Fuhrmann

macosx: Allow to open https URLs, do not list VLC as a browser

This allows to drop https URLs on the VLC icon as well, in addition
to http URLs.

Additionally, this removes VLC again from the list of web browsers
the user can choose in system settings --> general.

close #13672

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

 extras/package/macosx/Info.plist.in |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/extras/package/macosx/Info.plist.in 
b/extras/package/macosx/Info.plist.in
index 2f80fbc..3b3977a 100644
--- a/extras/package/macosx/Info.plist.in
+++ b/extras/package/macosx/Info.plist.in
@@ -1376,10 +1376,13 @@
CFBundleURLIconFile
generic
CFBundleURLName
-   http url
+   http(s) url
+   LSHandlerRank
+   None
CFBundleURLSchemes

http
+   https




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


[vlc-commits] Revert "macosx: update play and playback mode status on startup"

2015-12-05 Thread David Fuhrmann
vlc | branch: master | David Fuhrmann  | Sat Dec  5 
16:39:55 2015 +0100| [e2f1f6c44c514cea28dd1c4c5e9cc608792099ee] | committer: 
David Fuhrmann

Revert "macosx: update play and playback mode status on startup"

This hack is not needed anymore.

refs #14362
This reverts commit 5598f816905d5262928650c38d6b9a501b232deb.

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

 modules/gui/macosx/intf.m |7 ---
 1 file changed, 7 deletions(-)

diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index 61a609c..63d3e43 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -308,13 +308,6 @@ static VLCMain *sharedInstance = nil;
 [[self mainWindow] updateTimeSlider];
 [[self mainWindow] updateVolumeSlider];
 
-/* Hack: Playlist is started before the interface.
- * Thus, call additional updaters as we might miss these events if posted 
before
- * the callbacks are registered.
- */
-[_input_manager inputThreadChanged];
-[_playlist playbackModeUpdated];
-
 // respect playlist-autostart
 // note that PLAYLIST_PLAY will not stop any playback if already started
 playlist_t * p_playlist = pl_Get(VLCIntf);

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


[vlc-commits] macosx: improve logging for startup and shutdown

2015-12-05 Thread David Fuhrmann
vlc | branch: master | David Fuhrmann  | Sat Dec  5 
16:38:38 2015 +0100| [f312e26702a01c9b5476dee5c6a06f94decac8c8] | committer: 
David Fuhrmann

macosx: improve logging for startup and shutdown

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

 modules/gui/macosx/InputManager.m |2 ++
 modules/gui/macosx/PLModel.m  |2 ++
 modules/gui/macosx/intf.m |1 +
 3 files changed, 5 insertions(+)

diff --git a/modules/gui/macosx/InputManager.m 
b/modules/gui/macosx/InputManager.m
index d39c6a8..3703d1a 100644
--- a/modules/gui/macosx/InputManager.m
+++ b/modules/gui/macosx/InputManager.m
@@ -155,6 +155,8 @@ static int InputEvent(vlc_object_t *p_this, const char 
*psz_var,
 {
 self = [super init];
 if(self) {
+msg_Dbg(VLCIntf, "Initializing input manager");
+
 o_main = o_mainObj;
 var_AddCallback(pl_Get(VLCIntf), "input-current", InputThreadChanged, 
(__bridge void *)self);
 
diff --git a/modules/gui/macosx/PLModel.m b/modules/gui/macosx/PLModel.m
index ea5840b..57ea245 100644
--- a/modules/gui/macosx/PLModel.m
+++ b/modules/gui/macosx/PLModel.m
@@ -126,6 +126,7 @@ static int VolumeUpdated(vlc_object_t *p_this, const char 
*psz_var,
 _outlineView = outlineView;
 _playlist = plObj;
 
+msg_Dbg(VLCIntf, "Initializing playlist model");
 var_AddCallback(p_playlist, "item-change", PLItemUpdated, (__bridge 
void *)self);
 var_AddCallback(p_playlist, "playlist-item-append", PLItemAppended, 
(__bridge void *)self);
 var_AddCallback(p_playlist, "playlist-item-deleted", PLItemRemoved, 
(__bridge void *)self);
@@ -146,6 +147,7 @@ static int VolumeUpdated(vlc_object_t *p_this, const char 
*psz_var,
 
 - (void)dealloc
 {
+msg_Dbg(VLCIntf, "Deinitializing playlist model");
 var_DelCallback(p_playlist, "item-change", PLItemUpdated, (__bridge void 
*)self);
 var_DelCallback(p_playlist, "playlist-item-append", PLItemAppended, 
(__bridge void *)self);
 var_DelCallback(p_playlist, "playlist-item-deleted", PLItemRemoved, 
(__bridge void *)self);
diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index 96fb2e7..61a609c 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -96,6 +96,7 @@ int OpenIntf (vlc_object_t *p_this)
 [NSBundle loadNibNamed:@"MainMenu" owner:[[VLCMain sharedInstance] 
mainMenu]];
 [[[VLCMain sharedInstance] mainWindow] makeKeyAndOrderFront:nil];
 
+msg_Dbg(p_intf, "Finished loading macosx interface");
 return VLC_SUCCESS;
 }
 }

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


[vlc-commits] videotoolbox: compilation fix

2015-12-05 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Sat Dec  5 
12:08:20 2015 +0100| [c676780c621ac28a5d71e5ee148b8ec9744b4c01] | committer: 
Felix Paul Kühne

videotoolbox: compilation fix

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

 modules/codec/videotoolbox.m |1 +
 1 file changed, 1 insertion(+)

diff --git a/modules/codec/videotoolbox.m b/modules/codec/videotoolbox.m
index 3725623..a498c7e 100644
--- a/modules/codec/videotoolbox.m
+++ b/modules/codec/videotoolbox.m
@@ -32,6 +32,7 @@
 #import "../packetizer/h264_nal.h"
 #import "../video_chroma/copy.h"
 #import 
+#import 
 
 #import 
 

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


[vlc-commits] decoder: remove legacy flush call

2015-12-05 Thread Thomas Guillem
vlc | branch: master | Thomas Guillem  | Thu Dec  3 18:14:04 
2015 +0100| [8c4fff2f85e7916f2e18abf00605e7302bfba5f6] | committer: Thomas 
Guillem

decoder: remove legacy flush call

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

 src/input/decoder.c |   24 
 1 file changed, 24 deletions(-)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index c4fb6a1..55d7abb 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -210,19 +210,6 @@ static void DecoderUpdateFormatLocked( decoder_t *p_dec )
 p_owner->b_fmt_description = true;
 }
 
-static block_t *DecoderBlockFlushNew()
-{
-block_t *p_null = block_Alloc( 128 );
-if( !p_null )
-return NULL;
-
-p_null->i_flags |= BLOCK_FLAG_DISCONTINUITY |
-   BLOCK_FLAG_CORRUPTED;
-memset( p_null->p_buffer, 0, p_null->i_buffer );
-
-return p_null;
-}
-
 /*
  * Buffers allocation callbacks for the decoders
  */
@@ -1280,17 +1267,6 @@ static void DecoderProcessFlush( decoder_t *p_dec )
 
 if ( p_dec->pf_flush != NULL )
 p_dec->pf_flush( p_dec );
-else
-{
-/* legacy call, pass a CORRUPTED + DISCONTINUITY block */
-block_t *p_flush = DecoderBlockFlushNew();
-if( unlikely( p_flush == NULL ) )
-{
-msg_Err( p_dec, "cannot flush" );
-return;
-}
-DecoderProcess( p_dec, p_flush );
-}
 
 if( p_dec->fmt_out.i_cat == AUDIO_ES )
 {

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


[vlc-commits] decoder: implement pf_flush for all decoders/packetizers

2015-12-05 Thread Thomas Guillem
vlc | branch: master | Thomas Guillem  | Fri Dec  4 20:16:15 
2015 +0100| [c94f68febd2be06188fee9753a128886a5c0ffd5] | committer: Thomas 
Guillem

decoder: implement pf_flush for all decoders/packetizers

For now, a lot of decoder/packetizer are also flushing on
BLOCK_FLAG_DISCONTINUITY flag. Some others are also flushing on
BLOCK_FLAG_CORRUPTED flag (omxil, videotoolbox, avcodec audio).

This patch doesn't change the current behavior.
But maybe we shouldn't flush anymore on DISCONTINUOUS/CORRUPTED.

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

 modules/codec/a52.c  |   21 ---
 modules/codec/adpcm.c|   14 -
 modules/codec/aes3.c |   13 +++-
 modules/codec/araw.c |   14 -
 modules/codec/avcodec/audio.c|   26 +---
 modules/codec/avcodec/subtitle.c |   14 -
 modules/codec/avcodec/video.c|   25 ---
 modules/codec/cc.c   |   16 +--
 modules/codec/cdg.c  |   14 -
 modules/codec/dts.c  |   20 ---
 modules/codec/dvbsub.c   |   14 -
 modules/codec/faad.c |   14 -
 modules/codec/flac.c |   14 -
 modules/codec/fluidsynth.c   |   21 ---
 modules/codec/g711.c |   11 +-
 modules/codec/gstdecode.c|   41 +++---
 modules/codec/kate.c |   18 +
 modules/codec/libass.c   |   14 -
 modules/codec/libmpeg2.c |1 +
 modules/codec/lpcm.c |   14 -
 modules/codec/mpeg_audio.c   |   21 ---
 modules/codec/mpg123.c   |   14 -
 modules/codec/omxil/mediacodec.c |   17 +++-
 modules/codec/omxil/omxil.c  |   25 ---
 modules/codec/opus.c |   14 -
 modules/codec/rawvideo.c |   13 
 modules/codec/schroedinger.c |   16 +--
 modules/codec/speex.c|   14 -
 modules/codec/theora.c   |   12 +++
 modules/codec/uleaddvaudio.c |   10 +-
 modules/codec/videotoolbox.m |   25 +++
 modules/codec/vorbis.c   |   14 -
 modules/codec/wmafixed/wma.c |   14 -
 modules/hw/mmal/codec.c  |7 +++
 modules/packetizer/dirac.c   |   32 -
 modules/packetizer/flac.c|   12 +--
 modules/packetizer/mlp.c |   20 +++
 modules/packetizer/mpeg4audio.c  |   32 +
 38 files changed, 545 insertions(+), 106 deletions(-)

Diff:   
http://git.videolan.org/gitweb.cgi/vlc.git/?a=commitdiff;h=c94f68febd2be06188fee9753a128886a5c0ffd5
___
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits


[vlc-commits] block: add vlc_fifo_TimedWaitCond

2015-12-05 Thread Thomas Guillem
vlc | branch: master | Thomas Guillem  | Sat Dec  5 13:08:20 
2015 +0100| [2a8b955ae1fe123c263a438490ca4e2d4c79501b] | committer: Thomas 
Guillem

block: add vlc_fifo_TimedWaitCond

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

 include/vlc_block.h |1 +
 src/misc/fifo.c |9 +
 2 files changed, 10 insertions(+)

diff --git a/include/vlc_block.h b/include/vlc_block.h
index 59d7556..908d2c4 100644
--- a/include/vlc_block.h
+++ b/include/vlc_block.h
@@ -326,6 +326,7 @@ VLC_API void vlc_fifo_Unlock(vlc_fifo_t *);
 VLC_API void vlc_fifo_Signal(vlc_fifo_t *);
 VLC_API void vlc_fifo_Wait(vlc_fifo_t *);
 VLC_API void vlc_fifo_WaitCond(vlc_fifo_t *, vlc_cond_t *);
+int vlc_fifo_TimedWaitCond(vlc_fifo_t *, vlc_cond_t *, mtime_t);
 VLC_API void vlc_fifo_QueueUnlocked(vlc_fifo_t *, block_t *);
 VLC_API block_t *vlc_fifo_DequeueUnlocked(vlc_fifo_t *) VLC_USED;
 VLC_API block_t *vlc_fifo_DequeueAllUnlocked(vlc_fifo_t *) VLC_USED;
diff --git a/src/misc/fifo.c b/src/misc/fifo.c
index 789690e..efcc0f0 100644
--- a/src/misc/fifo.c
+++ b/src/misc/fifo.c
@@ -111,6 +111,15 @@ void vlc_fifo_WaitCond(vlc_fifo_t *fifo, vlc_cond_t 
*condvar)
 }
 
 /**
+ * Atomically unlocks the FIFO and waits until one thread signals the FIFO up
+ * to a certain date, then locks the FIFO again. See vlc_fifo_Wait().
+ */
+int vlc_fifo_TimedWaitCond(vlc_fifo_t *fifo, vlc_cond_t *condvar, mtime_t 
deadline)
+{
+return vlc_cond_timedwait(condvar, >lock, deadline);
+}
+
+/**
  * Checks how many blocks are queued in a locked FIFO.
  *
  * @note This function is not cancellation point.

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


[vlc-commits] decoder: interruptible mwait

2015-12-05 Thread Thomas Guillem
vlc | branch: master | Thomas Guillem  | Tue Dec  1 11:38:23 
2015 +0100| [41de2a23910e5f9b5e437b50186245b89b32c56d] | committer: Thomas 
Guillem

decoder: interruptible mwait

mwait (called from Audio and SPU DecoderThread) can now be interrupted when
flushing or closing.

This fixes a too long closing/flushing time when the next spu or audio block is
too distant.

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

 src/input/decoder.c |   37 -
 1 file changed, 32 insertions(+), 5 deletions(-)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index 55d7abb..7b90ee4 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -91,6 +91,7 @@ struct decoder_owner_sys_t
 vlc_cond_t  wait_request;
 vlc_cond_t  wait_acknowledge;
 vlc_cond_t  wait_fifo; /* TODO: merge with wait_acknowledge */
+vlc_cond_t  wait_timed;
 
 /* -- These variables need locking on write(only) -- */
 audio_output_t *p_aout;
@@ -606,6 +607,24 @@ static void DecoderWaitUnblock( decoder_t *p_dec )
 }
 }
 
+/* DecoderTimedWait: Interruptible wait
+ * Returns VLC_SUCCESS if wait was not interrupted, and VLC_EGENERIC otherwise 
*/
+static int DecoderTimedWait( decoder_t *p_dec, mtime_t deadline )
+{
+decoder_owner_sys_t *p_owner = p_dec->p_owner;
+
+if (deadline - mdate() <= 0)
+return VLC_SUCCESS;
+
+vlc_fifo_Lock( p_owner->p_fifo );
+while( !p_owner->flushing
+&& vlc_fifo_TimedWaitCond( p_owner->p_fifo, _owner->wait_timed,
+   deadline ) == 0 );
+int ret = p_owner->flushing ? VLC_EGENERIC : VLC_SUCCESS;
+vlc_fifo_Unlock( p_owner->p_fifo );
+return ret;
+}
+
 static inline void DecoderUpdatePreroll( int64_t *pi_preroll, const block_t *p 
)
 {
 if( p->i_flags & (BLOCK_FLAG_PREROLL|BLOCK_FLAG_DISCONTINUITY) )
@@ -1009,7 +1028,8 @@ static void DecoderPlayAudio( decoder_t *p_dec, block_t 
*p_audio,
 
 if( p_aout == NULL || p_audio->i_pts <= VLC_TS_INVALID
  || i_rate < INPUT_RATE_DEFAULT/AOUT_MAX_INPUT_RATE
- || i_rate > INPUT_RATE_DEFAULT*AOUT_MAX_INPUT_RATE )
+ || i_rate > INPUT_RATE_DEFAULT*AOUT_MAX_INPUT_RATE
+ || DecoderTimedWait( p_dec, p_audio->i_pts - AOUT_MAX_PREPARE_TIME ) )
 {
 msg_Dbg( p_dec, "discarded audio buffer" );
 *pi_lost_sum += 1;
@@ -1017,8 +1037,6 @@ static void DecoderPlayAudio( decoder_t *p_dec, block_t 
*p_audio,
 return;
 }
 
-mwait( p_audio->i_pts - AOUT_MAX_PREPARE_TIME );
-
 if( aout_DecPlay( p_aout, p_audio, i_rate ) == 0 )
 *pi_played_sum += 1;
 
@@ -1143,13 +1161,13 @@ static void DecoderPlaySpu( decoder_t *p_dec, 
subpicture_t *p_subpic )
   NULL, INT64_MAX );
 vlc_mutex_unlock( _owner->lock );
 
-if( p_subpic->i_start <= VLC_TS_INVALID )
+if( p_subpic->i_start <= VLC_TS_INVALID
+ || DecoderTimedWait( p_dec, p_subpic->i_start - SPU_MAX_PREPARE_TIME ) )
 {
 subpicture_Delete( p_subpic );
 return;
 }
 
-mwait( p_subpic->i_start - SPU_MAX_PREPARE_TIME );
 vout_PutSubpicture( p_vout, p_subpic );
 }
 
@@ -1475,6 +1493,7 @@ static decoder_t * CreateDecoder( vlc_object_t *p_parent,
 vlc_cond_init( _owner->wait_request );
 vlc_cond_init( _owner->wait_acknowledge );
 vlc_cond_init( _owner->wait_fifo );
+vlc_cond_init( _owner->wait_timed );
 
 /* Set buffers allocation callbacks for the decoders */
 p_dec->pf_aout_format_update = aout_update_format;
@@ -1618,6 +1637,7 @@ static void DeleteDecoder( decoder_t * p_dec )
 vlc_object_release( p_owner->p_packetizer );
 }
 
+vlc_cond_destroy( _owner->wait_timed );
 vlc_cond_destroy( _owner->wait_fifo );
 vlc_cond_destroy( _owner->wait_acknowledge );
 vlc_cond_destroy( _owner->wait_request );
@@ -1733,6 +1753,12 @@ void input_DecoderDelete( decoder_t *p_dec )
 
 vlc_cancel( p_owner->thread );
 
+vlc_fifo_Lock( p_owner->p_fifo );
+/* Signal DecoderTimedWait */
+p_owner->flushing = true;
+vlc_cond_signal( _owner->wait_timed );
+vlc_fifo_Unlock( p_owner->p_fifo );
+
 /* Make sure we aren't waiting/decoding anymore */
 vlc_mutex_lock( _owner->lock );
 p_owner->b_waiting = false;
@@ -1867,6 +1893,7 @@ void input_DecoderFlush( decoder_t *p_dec )
 p_owner->frames_countdown++;
 
 vlc_fifo_Signal( p_owner->p_fifo );
+vlc_cond_signal( _owner->wait_timed );
 
 vlc_fifo_Unlock( p_owner->p_fifo );
 }

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