[vlc-commits] decoder: remove b_need_packetized

2015-09-09 Thread Thomas Guillem
vlc | branch: master | Thomas Guillem  | Mon Sep  7 16:34:51 
2015 +0200| [080f21c3be96265da1dae5c0c9ec959add956b30] | committer: Thomas 
Guillem

decoder: remove b_need_packetized

When needed (fmt->b_packetized == false), create a packetizer before creating a
decoder. The fmt_in of the decoder is copied either from the fmt_out of the
packetizer, or from the fmt of CreateDecoder.

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

 include/vlc_codec.h  |3 ---
 modules/codec/avcodec/avcodec.c  |2 --
 modules/codec/avcodec/video.c|3 ---
 modules/codec/crystalhd.c|1 -
 modules/codec/faad.c |3 ---
 modules/codec/flac.c |3 ---
 modules/codec/gstdecode.c|2 --
 modules/codec/mft.c  |1 -
 modules/codec/omxil/mediacodec.c |1 -
 modules/codec/omxil/omxil.c  |2 --
 modules/codec/videotoolbox.m |2 --
 modules/codec/vpx.c  |1 -
 modules/hw/mmal/codec.c  |1 -
 src/input/decoder.c  |   18 +-
 14 files changed, 9 insertions(+), 34 deletions(-)

diff --git a/include/vlc_codec.h b/include/vlc_codec.h
index 0c43978..0028eff 100644
--- a/include/vlc_codec.h
+++ b/include/vlc_codec.h
@@ -62,9 +62,6 @@ struct decoder_t
 /* Output format of decoder/packetizer */
 es_format_t fmt_out;
 
-/* Some decoders only accept packetized data (ie. not truncated) */
-boolb_need_packetized;
-
 /* Tell the decoder if it is allowed to drop frames */
 boolb_frame_drop_allowed;
 
diff --git a/modules/codec/avcodec/avcodec.c b/modules/codec/avcodec/avcodec.c
index 2251cda..5402f69 100644
--- a/modules/codec/avcodec/avcodec.c
+++ b/modules/codec/avcodec/avcodec.c
@@ -326,8 +326,6 @@ static int OpenDecoder( vlc_object_t *p_this )
 if( avctx->level != FF_LEVEL_UNKNOWN)
 p_dec->fmt_in.i_level = avctx->level;
 
-p_dec->b_need_packetized = true;
-
 return VLC_SUCCESS;
 }
 
diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index 7e05a5f..89b39ab 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -495,9 +495,6 @@ int InitVideoDec( decoder_t *p_dec, AVCodecContext 
*p_context,
 
 p_dec->pf_decode_video = DecodeVideo;
 
-if ( p_dec->fmt_in.i_codec == VLC_CODEC_VP9 )
-p_dec->b_need_packetized = true;
-
 return VLC_SUCCESS;
 }
 
diff --git a/modules/codec/crystalhd.c b/modules/codec/crystalhd.c
index d3b99ba..87c2134 100644
--- a/modules/codec/crystalhd.c
+++ b/modules/codec/crystalhd.c
@@ -348,7 +348,6 @@ static int OpenDecoder( vlc_object_t *p_this )
 p_dec->fmt_out.i_codec= VLC_CODEC_YUYV;
 p_dec->fmt_out.video.i_width  = p_dec->fmt_in.video.i_width;
 p_dec->fmt_out.video.i_height = p_dec->fmt_in.video.i_height;
-p_dec->b_need_packetized  = true;
 
 /* Set callbacks */
 p_dec->pf_decode_video = DecodeBlock;
diff --git a/modules/codec/faad.c b/modules/codec/faad.c
index 6185af9..ae8fed8 100644
--- a/modules/codec/faad.c
+++ b/modules/codec/faad.c
@@ -192,9 +192,6 @@ static int Open( vlc_object_t *p_this )
 p_sys->i_buffer = p_sys->i_buffer_size = 0;
 p_sys->p_buffer = NULL;
 
-/* Faad2 can't deal with truncated data (eg. from MPEG TS) */
-p_dec->b_need_packetized = true;
-
 p_sys->b_sbr = p_sys->b_ps = false;
 
 p_dec->pf_decode_audio = DecodeBlock;
diff --git a/modules/codec/flac.c b/modules/codec/flac.c
index eaf8175..9fc69f8 100644
--- a/modules/codec/flac.c
+++ b/modules/codec/flac.c
@@ -359,9 +359,6 @@ static int OpenDecoder( vlc_object_t *p_this )
 /* Set callbacks */
 p_dec->pf_decode_audio = DecodeBlock;
 
-/* */
-p_dec->b_need_packetized = true;
-
 return VLC_SUCCESS;
 }
 
diff --git a/modules/codec/gstdecode.c b/modules/codec/gstdecode.c
index f623b9c..a2acf69 100644
--- a/modules/codec/gstdecode.c
+++ b/modules/codec/gstdecode.c
@@ -624,8 +624,6 @@ static int OpenDecoder( vlc_object_t *p_this )
 "set state failure", VLC_EGENERIC );
 p_sys->b_running = true;
 
-/* Force packetized for now */
-p_dec->b_need_packetized = true;
 /* Set callbacks */
 p_dec->pf_decode_video = DecodeBlock;
 
diff --git a/modules/codec/mft.c b/modules/codec/mft.c
index a61fa00..696319a 100644
--- a/modules/codec/mft.c
+++ b/modules/codec/mft.c
@@ -1155,7 +1155,6 @@ int Open(vlc_object_t *p_this)
 }
 
 p_dec->fmt_out.i_cat = p_dec->fmt_in.i_cat;
-p_dec->b_need_packetized = true;
 
 return VLC_SUCCESS;
 
diff --git a/modules/codec/omxil/mediacodec.c b/modules/codec/omxil/mediacodec.c
index c37924d..a09853f 100644
--- a/modules/codec/omxil/mediacodec.c
+++ b/modules/codec/omxil/mediacodec.c
@@ -560,7 +560,6 @@ static int OpenDecoder(vlc_object_t *p_this, 
pf_MediaCodecApi_init pf_init)
 p_dec->fmt_out.i_cat = p_dec->fmt_in.i_cat;
 

[vlc-commits] decoder: change DecoderUnsupportedCodec arguments

2015-09-09 Thread Thomas Guillem
vlc | branch: master | Thomas Guillem  | Mon Sep  7 18:29:59 
2015 +0200| [ceb51f4e4aa46d028962b9ee77d24eb1d11e1e98] | committer: Thomas 
Guillem

decoder: change DecoderUnsupportedCodec arguments

Use an es_format_t.

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

 src/input/decoder.c |   14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index 0fad3f9..2eda188 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -1717,16 +1717,16 @@ static void DeleteDecoder( decoder_t * p_dec )
 }
 
 /* */
-static void DecoderUnsupportedCodec( decoder_t *p_dec, vlc_fourcc_t codec )
+static void DecoderUnsupportedCodec( decoder_t *p_dec, const es_format_t *fmt )
 {
-if (codec != VLC_FOURCC('u','n','d','f')) {
-const char *desc = vlc_fourcc_GetDescription(p_dec->fmt_in.i_cat, 
codec);
+if (fmt->i_codec != VLC_FOURCC('u','n','d','f')) {
+const char *desc = vlc_fourcc_GetDescription(fmt->i_cat, fmt->i_codec);
 if (!desc || !*desc)
 desc = N_("No description for this codec");
-msg_Err( p_dec, "Codec `%4.4s' (%s) is not supported.", (char*), 
desc );
+msg_Err( p_dec, "Codec `%4.4s' (%s) is not supported.", 
(char*)>i_codec, desc );
 dialog_Fatal( p_dec, _("Codec not supported"),
 _("VLC could not decode the format \"%4.4s\" (%s)"),
-(char*), desc );
+(char*)>i_codec, desc );
 } else {
 msg_Err( p_dec, "could not identify codec" );
 dialog_Fatal( p_dec, _("Unidentified codec"),
@@ -1758,7 +1758,7 @@ static decoder_t *decoder_New( vlc_object_t *p_parent, 
input_thread_t *p_input,
 
 if( !p_dec->p_module )
 {
-DecoderUnsupportedCodec( p_dec, fmt->i_codec );
+DecoderUnsupportedCodec( p_dec, fmt );
 
 DeleteDecoder( p_dec );
 return NULL;
@@ -2008,7 +2008,7 @@ int input_DecoderSetCcState( decoder_t *p_dec, bool 
b_decode, int i_channel )
 }
 else if( !p_cc->p_module )
 {
-DecoderUnsupportedCodec( p_dec, fcc[i_channel] );
+DecoderUnsupportedCodec( p_dec,  );
 input_DecoderDelete(p_cc);
 return VLC_EGENERIC;
 }

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


[vlc-commits] decoder: set packetizer's fmt_out.b_packetized to true

2015-09-09 Thread Thomas Guillem
vlc | branch: master | Thomas Guillem  | Mon Sep  7 16:37:00 
2015 +0200| [2a278dfb0f4f5e422ba30a3d3789c00f0d38409a] | committer: Thomas 
Guillem

decoder: set packetizer's fmt_out.b_packetized to true

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

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

diff --git a/src/input/decoder.c b/src/input/decoder.c
index ec74015..b797f92 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -1609,7 +1609,10 @@ static decoder_t * CreateDecoder( vlc_object_t *p_parent,
 p_owner->p_packetizer = NULL;
 }
 else
+{
+p_owner->p_packetizer->fmt_out.b_packetized = true;
 fmt = _owner->p_packetizer->fmt_out;
+}
 }
 }
 

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


[vlc-commits] decoder: restart module if fmt_in is changed by the packetizer

2015-09-09 Thread Thomas Guillem
vlc | branch: master | Thomas Guillem  | Mon Sep  7 16:46:49 
2015 +0200| [6e89372e4bfb3e2b0d5c55c3f31caddf42da1043] | committer: Thomas 
Guillem

decoder: restart module if fmt_in is changed by the packetizer

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

 src/input/decoder.c |   46 ++
 1 file changed, 26 insertions(+), 20 deletions(-)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index b797f92..c64a515 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -1052,24 +1052,20 @@ static void DecoderProcessVideo( decoder_t *p_dec, 
block_t *p_block, bool b_flus
 while( (p_packetized_block =
 p_packetizer->pf_packetize( p_packetizer, p_block ? _block : 
NULL )) )
 {
-if( p_packetizer->fmt_out.i_extra && !p_dec->fmt_in.i_extra )
+if( !es_format_IsSimilar( _dec->fmt_in, _packetizer->fmt_out ) 
)
 {
-es_format_Clean( _dec->fmt_in );
-es_format_Copy( _dec->fmt_in, _packetizer->fmt_out );
-}
-
-/* If the packetizer provides aspect ratio information, pass it
- * to the decoder as a hint if the decoder itself can't provide
- * it. Copy it regardless of the current value of the decoder input
- * format aspect ratio, to properly propagate changes in aspect
- * ratio. */
-if( p_packetizer->fmt_out.video.i_sar_num > 0 &&
-p_packetizer->fmt_out.video.i_sar_den > 0)
-{
-p_dec->fmt_in.video.i_sar_num =
-p_packetizer->fmt_out.video.i_sar_num;
-p_dec->fmt_in.video.i_sar_den=
-p_packetizer->fmt_out.video.i_sar_den;
+msg_Dbg( p_dec, "restarting module due to input format 
change");
+
+/* Drain the decoder module */
+DecoderDecodeVideo( p_dec, NULL );
+/* Restart the decoder module */
+UnloadDecoder( p_dec );
+if( LoadDecoder( p_dec, false, _packetizer->fmt_out ) )
+{
+p_dec->b_error = true;
+block_ChainRelease( p_packetized_block );
+return;
+}
 }
 
 if( p_packetizer->pf_get_cc )
@@ -1232,10 +1228,20 @@ static void DecoderProcessAudio( decoder_t *p_dec, 
block_t *p_block, bool b_flus
 while( (p_packetized_block =
 p_packetizer->pf_packetize( p_packetizer, p_block ? _block : 
NULL )) )
 {
-if( p_packetizer->fmt_out.i_extra && !p_dec->fmt_in.i_extra )
+if( !es_format_IsSimilar( _dec->fmt_in, _packetizer->fmt_out ) 
)
 {
-es_format_Clean( _dec->fmt_in );
-es_format_Copy( _dec->fmt_in, _packetizer->fmt_out );
+msg_Dbg( p_dec, "restarting module due to input format 
change");
+
+/* Drain the decoder module */
+DecoderDecodeAudio( p_dec, NULL );
+/* Restart the decoder module */
+UnloadDecoder( p_dec );
+if( LoadDecoder( p_dec, false, _packetizer->fmt_out ) )
+{
+p_dec->b_error = true;
+block_ChainRelease( p_packetized_block );
+return;
+}
 }
 
 while( p_packetized_block )

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


[vlc-commits] decoder: rearrange module load/unload

2015-09-09 Thread Thomas Guillem
vlc | branch: master | Thomas Guillem  | Mon Sep  7 17:13:40 
2015 +0200| [27da2574a7a5b5fde71e7509a376e1ebcd4c201d] | committer: Thomas 
Guillem

decoder: rearrange module load/unload

This will allow a decoder module to be loaded/unloaded more than one time.

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

 src/input/decoder.c |  110 +--
 1 file changed, 63 insertions(+), 47 deletions(-)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index 2eda188..ff5e3d1 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -135,6 +135,61 @@ struct decoder_owner_sys_t
 /* */
 #define DECODER_SPU_VOUT_WAIT_DURATION ((int)(0.200*CLOCK_FREQ))
 
+/**
+ * Load a decoder module
+ */
+static int LoadDecoder( decoder_t *p_dec, bool b_packetizer,
+const es_format_t *restrict p_fmt )
+{
+p_dec->b_frame_drop_allowed = true;
+p_dec->b_need_packetized = false;
+p_dec->i_extra_picture_buffers = 0;
+
+p_dec->pf_decode_audio = NULL;
+p_dec->pf_decode_video = NULL;
+p_dec->pf_decode_sub = NULL;
+p_dec->pf_get_cc = NULL;
+p_dec->pf_packetize = NULL;
+
+es_format_Copy( _dec->fmt_in, p_fmt );
+es_format_Init( _dec->fmt_out, UNKNOWN_ES, 0 );
+
+/* Find a suitable decoder/packetizer module */
+if( !b_packetizer )
+p_dec->p_module = module_need( p_dec, "decoder", "$codec", false );
+else
+p_dec->p_module = module_need( p_dec, "packetizer", "$packetizer", 
false );
+
+if( !p_dec->p_module )
+{
+es_format_Clean( _dec->fmt_in );
+return -1;
+}
+else
+return 0;
+}
+
+/**
+ * Unload a decoder module
+ */
+static void UnloadDecoder( decoder_t *p_dec )
+{
+if( p_dec->p_module )
+{
+module_unneed( p_dec, p_dec->p_module );
+p_dec->p_module = NULL;
+}
+
+if( p_dec->p_description )
+{
+vlc_meta_Delete( p_dec->p_description );
+p_dec->p_description = NULL;
+}
+
+es_format_Clean( _dec->fmt_in );
+es_format_Clean( _dec->fmt_out );
+}
+
 static void DecoderUpdateFormatLocked( decoder_t *p_dec )
 {
 decoder_owner_sys_t *p_owner = p_dec->p_owner;
@@ -1474,28 +1529,11 @@ static decoder_t * CreateDecoder( vlc_object_t 
*p_parent,
 {
 decoder_t *p_dec;
 decoder_owner_sys_t *p_owner;
-es_format_t null_es_format;
 
 p_dec = vlc_custom_create( p_parent, sizeof( *p_dec ), "decoder" );
 if( p_dec == NULL )
 return NULL;
 
-p_dec->b_frame_drop_allowed = true;
-p_dec->pf_decode_audio = NULL;
-p_dec->pf_decode_video = NULL;
-p_dec->pf_decode_sub = NULL;
-p_dec->pf_get_cc = NULL;
-p_dec->pf_packetize = NULL;
-
-/* Initialize the decoder */
-p_dec->p_module = NULL;
-
-memset( _es_format, 0, sizeof(es_format_t) );
-es_format_Copy( _dec->fmt_in, fmt );
-es_format_Copy( _dec->fmt_out, _es_format );
-
-p_dec->p_description = NULL;
-
 /* Allocate our private structure for the decoder */
 p_dec->p_owner = p_owner = malloc( sizeof( decoder_owner_sys_t ) );
 if( unlikely(p_owner == NULL) )
@@ -1560,10 +1598,8 @@ static decoder_t * CreateDecoder( vlc_object_t *p_parent,
 p_dec->pf_get_display_rate = DecoderGetDisplayRate;
 
 /* Find a suitable decoder/packetizer module */
-if( !b_packetizer )
-p_dec->p_module = module_need( p_dec, "decoder", "$codec", false );
-else
-p_dec->p_module = module_need( p_dec, "packetizer", "$packetizer", 
false );
+if( LoadDecoder( p_dec, b_packetizer, fmt ) )
+return p_dec;
 
 /* Check if decoder requires already packetized data */
 if( !b_packetizer &&
@@ -1573,19 +1609,8 @@ static decoder_t * CreateDecoder( vlc_object_t *p_parent,
 vlc_custom_create( p_parent, sizeof( decoder_t ), "packetizer" );
 if( p_owner->p_packetizer )
 {
-es_format_Copy( _owner->p_packetizer->fmt_in,
-_dec->fmt_in );
-
-es_format_Copy( _owner->p_packetizer->fmt_out,
-_es_format );
-
-p_owner->p_packetizer->p_module =
-module_need( p_owner->p_packetizer,
- "packetizer", "$packetizer", false );
-
-if( !p_owner->p_packetizer->p_module )
+if( LoadDecoder( p_owner->p_packetizer, true, _dec->fmt_in ) )
 {
-es_format_Clean( _owner->p_packetizer->fmt_in );
 vlc_object_release( p_owner->p_packetizer );
 p_owner->p_packetizer = NULL;
 }
@@ -1643,6 +1668,9 @@ static void DeleteDecoder( decoder_t * p_dec )
  (char*)_dec->fmt_in.i_codec,
  (unsigned)block_FifoCount( p_owner->p_fifo ) );
 
+const bool b_flush_spu = p_dec->fmt_out.i_cat == SPU_ES;
+UnloadDecoder( p_dec );
+
 /* Free all packets still in the decoder fifo. */
 

[vlc-commits] contrib: fix eof not detected when looking for an ID size

2015-09-09 Thread Steve Lhomme
vlc | branch: master | Steve Lhomme  | Fri Aug 21 13:49:29 
2015 +0200| [6e0f74e7df42337617a3b08ae97e86ffc7608d3f] | committer: 
Jean-Baptiste Kempf

contrib: fix eof not detected when looking for an ID size

do use the data in memory that wasn't actually read

Close #14783

Signed-off-by: Jean-Baptiste Kempf 

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

 contrib/src/ebml/eof.patch |   15 +++
 contrib/src/ebml/rules.mak |1 +
 2 files changed, 16 insertions(+)

diff --git a/contrib/src/ebml/eof.patch b/contrib/src/ebml/eof.patch
new file mode 100644
index 000..72026b0
--- /dev/null
+++ b/contrib/src/ebml/eof.patch
@@ -0,0 +1,15 @@
+--- libebml/src/EbmlElement.cpp 2015-08-21 12:58:03.738589700 +0200
 libebml/src/EbmlElement.cpp.eof 2015-08-21 12:55:18.972736500 +0200
+@@ -417,7 +417,10 @@
+ bFound = false;
+ break;
+   }
+-  ReadSize += DataStream.read([SizeIdx++], 1);
++  if( DataStream.read( [SizeIdx++], 1 ) == 0 ) {
++  return NULL; // no more data ?
++  }
++  ReadSize++;
+   PossibleSizeLength++;
+ }
+
+
diff --git a/contrib/src/ebml/rules.mak b/contrib/src/ebml/rules.mak
index 4a5ac16..3a9dd56 100644
--- a/contrib/src/ebml/rules.mak
+++ b/contrib/src/ebml/rules.mak
@@ -11,6 +11,7 @@ $(TARBALLS)/libebml-$(EBML_VERSION).tar.bz2:
 
 libebml: libebml-$(EBML_VERSION).tar.bz2 .sum-ebml
$(UNPACK)
+   $(APPLY) $(SRC)/ebml/eof.patch
$(MOVE)
 
 # libebml requires exceptions

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


[vlc-commits] demux: mp4: remove unused param in MP4_Free

2015-09-09 Thread Francois Cartegnie
vlc | branch: master | Francois Cartegnie  | Tue Sep  8 
19:17:41 2015 +0200| [6ad32e53faa06c001b3e0ea5b80bba67c07d11c8] | committer: 
Francois Cartegnie

demux: mp4: remove unused param in MP4_Free

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

 modules/demux/dash/mp4/AtomsReader.cpp|2 +-
 modules/demux/mp4/libmp4.c|   10 +-
 modules/demux/mp4/libmp4.h|2 +-
 modules/demux/mp4/mp4.c   |   16 
 modules/stream_filter/smooth/downloader.c |2 +-
 5 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/modules/demux/dash/mp4/AtomsReader.cpp 
b/modules/demux/dash/mp4/AtomsReader.cpp
index ce2fa53..044962d 100644
--- a/modules/demux/dash/mp4/AtomsReader.cpp
+++ b/modules/demux/dash/mp4/AtomsReader.cpp
@@ -35,7 +35,7 @@ AtomsReader::~AtomsReader()
 while(rootbox && rootbox->p_first)
 {
 MP4_Box_t *p_next = rootbox->p_first->p_next;
-MP4_BoxFree( (stream_t *)object, rootbox->p_first );
+MP4_BoxFree( rootbox->p_first );
 rootbox->p_first = p_next;
 }
 delete rootbox;
diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index 1063110..314bd26 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -234,7 +234,7 @@ static MP4_Box_t *MP4_ReadBoxRestricted( stream_t 
*p_stream, MP4_Box_t *p_father
 if( MP4_Box_Read_Specific( p_stream, p_box, p_father ) != VLC_SUCCESS )
 {
 msg_Warn( p_stream, "Failed reading box %4.4s", (char*) 
_type );
-MP4_BoxFree( p_stream, p_box );
+MP4_BoxFree( p_box );
 return NULL;
 }
 
@@ -4046,7 +4046,7 @@ static MP4_Box_t *MP4_ReadBox( stream_t *p_stream, 
MP4_Box_t *p_father )
 if( MP4_Box_Read_Specific( p_stream, p_box, p_father ) != VLC_SUCCESS )
 {
 uint64_t i_end = p_box->i_pos + p_box->i_size;
-MP4_BoxFree( p_stream, p_box );
+MP4_BoxFree( p_box );
 MP4_Seek( p_stream, i_end ); /* Skip the failed box */
 return NULL;
 }
@@ -4058,7 +4058,7 @@ static MP4_Box_t *MP4_ReadBox( stream_t *p_stream, 
MP4_Box_t *p_father )
  * MP4_FreeBox : free memory after read with MP4_ReadBox and all
  * the children
  */
-void MP4_BoxFree( stream_t *s, MP4_Box_t *p_box )
+void MP4_BoxFree( MP4_Box_t *p_box )
 {
 MP4_Box_t*p_child;
 
@@ -4070,7 +4070,7 @@ void MP4_BoxFree( stream_t *s, MP4_Box_t *p_box )
 MP4_Box_t *p_next;
 
 p_next = p_child->p_next;
-MP4_BoxFree( s, p_child );
+MP4_BoxFree( p_child );
 p_child = p_next;
 }
 
@@ -4247,7 +4247,7 @@ MP4_Box_t *MP4_BoxGetRoot( stream_t *p_stream )
 return p_root;
 
 error:
-free( p_root );
+free( p_vroot );
 MP4_Seek( p_stream, 0 );
 return NULL;
 }
diff --git a/modules/demux/mp4/libmp4.h b/modules/demux/mp4/libmp4.h
index aa1b634..bcaacff 100644
--- a/modules/demux/mp4/libmp4.h
+++ b/modules/demux/mp4/libmp4.h
@@ -1675,7 +1675,7 @@ MP4_Box_t *MP4_BoxGetRoot( stream_t * );
  * XXX : all children have to be allocated by a malloc !! and
  * p_box is freed
  */
-void MP4_BoxFree( stream_t *, MP4_Box_t *p_box );
+void MP4_BoxFree( MP4_Box_t *p_box );
 
 /*
  * MP4_DumpBoxStructure: print the structure of the p_box
diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index b744409..215a585 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -978,7 +978,7 @@ error:
 
 if( p_sys->p_root )
 {
-MP4_BoxFree( p_demux->s, p_sys->p_root );
+MP4_BoxFree( p_sys->p_root );
 }
 free( p_sys );
 return VLC_EGENERIC;
@@ -1730,7 +1730,7 @@ static void Close ( vlc_object_t * p_this )
 
 msg_Dbg( p_demux, "freeing all memory" );
 
-MP4_BoxFree( p_demux->s, p_sys->p_root );
+MP4_BoxFree( p_sys->p_root );
 for( i_track = 0; i_track < p_sys->i_tracks; i_track++ )
 {
 MP4_TrackDestroy( p_demux, _sys->track[i_track] );
@@ -3918,7 +3918,7 @@ static int MP4_frg_GetChunks( demux_t *p_demux, const 
unsigned i_tk_id )
 uint32_t tid = 0;
 if( i_type == ATOM_uuid || i_type == ATOM_ftyp )
 {
-MP4_BoxFree( p_demux->s, p_sys->p_root );
+MP4_BoxFree( p_sys->p_root );
 p_sys->p_root = p_chunk;
 
 if( i_type == ATOM_ftyp ) /* DASH */
@@ -3954,7 +3954,7 @@ static int MP4_frg_GetChunks( demux_t *p_demux, const 
unsigned i_tk_id )
 if( MP4_frg_GetChunk( p_demux, p_chunk,  ) != VLC_SUCCESS )
 goto MP4_frg_GetChunks_Error;
 
-MP4_BoxFree( p_demux->s, p_chunk );
+MP4_BoxFree( p_chunk );
 
 if( tid == i_tk_id )
 break;
@@ -3962,7 +3962,7 @@ 

[vlc-commits] demux: libmp4: split read function lookup

2015-09-09 Thread Francois Cartegnie
vlc | branch: master | Francois Cartegnie  | Tue Sep  8 
11:21:13 2015 +0200| [9c116cbc8398dcfc6f0fa497c8182dc92e7c1560] | committer: 
Francois Cartegnie

demux: libmp4: split read function lookup

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

 modules/demux/mp4/libmp4.c |   54 
 1 file changed, 34 insertions(+), 20 deletions(-)

diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index 92a08d9..d4ed047 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -71,6 +71,8 @@ static void MP4_ConvertDate2Str( char *psz, uint64_t i_date, 
bool b_relative )
  * Some prototypes.
  */
 static MP4_Box_t *MP4_ReadBox( stream_t *p_stream, MP4_Box_t *p_father );
+static int MP4_Box_Read_Specific( stream_t *p_stream, MP4_Box_t *p_box, 
MP4_Box_t *p_father );
+static void MP4_Box_Clean_Specific( MP4_Box_t *p_box );
 
 static int MP4_Seek( stream_t *p_stream, uint64_t i_pos )
 {
@@ -3930,6 +3932,36 @@ static const struct
 { 0,  MP4_ReadBox_default,   0 }
 };
 
+static int MP4_Box_Read_Specific( stream_t *p_stream, MP4_Box_t *p_box, 
MP4_Box_t *p_father )
+{
+int i_index;
+
+for( i_index = 0; ; i_index++ )
+{
+if ( MP4_Box_Function[i_index].i_parent &&
+ p_father && p_father->i_type != 
MP4_Box_Function[i_index].i_parent )
+continue;
+
+if( ( MP4_Box_Function[i_index].i_type == p_box->i_type )||
+( MP4_Box_Function[i_index].i_type == 0 ) )
+{
+break;
+}
+}
+
+if( !(MP4_Box_Function[i_index].MP4_ReadBox_function)( p_stream, p_box ) )
+{
+return VLC_EGENERIC;
+}
+
+return VLC_SUCCESS;
+}
+
+static void MP4_Box_Clean_Specific( MP4_Box_t *p_box )
+{
+if( p_box->pf_free )
+p_box->pf_free( p_box );
+}
 
 /*
  * MP4_ReadBox : parse the actual box and the children
@@ -3938,8 +3970,6 @@ static const struct
 static MP4_Box_t *MP4_ReadBox( stream_t *p_stream, MP4_Box_t *p_father )
 {
 MP4_Box_t *p_box = calloc( 1, sizeof( MP4_Box_t ) ); /* Needed to ensure 
simple on error handler */
-unsigned int i_index;
-
 if( p_box == NULL )
 return NULL;
 
@@ -3966,22 +3996,7 @@ static MP4_Box_t *MP4_ReadBox( stream_t *p_stream, 
MP4_Box_t *p_father )
 }
 p_box->p_father = p_father;
 
-/* Now search function to call */
-for( i_index = 0; ; i_index++ )
-{
-if ( MP4_Box_Function[i_index].i_parent &&
- p_box->p_father &&
- p_box->p_father->i_type != MP4_Box_Function[i_index].i_parent )
-continue;
-
-if( ( MP4_Box_Function[i_index].i_type == p_box->i_type )||
-( MP4_Box_Function[i_index].i_type == 0 ) )
-{
-break;
-}
-}
-
-if( !(MP4_Box_Function[i_index].MP4_ReadBox_function)( p_stream, p_box ) )
+if( MP4_Box_Read_Specific( p_stream, p_box, p_father ) != VLC_SUCCESS )
 {
 uint64_t i_end = p_box->i_pos + p_box->i_size;
 MP4_BoxFree( p_stream, p_box );
@@ -4012,8 +4027,7 @@ void MP4_BoxFree( stream_t *s, MP4_Box_t *p_box )
 p_child = p_next;
 }
 
-if( p_box->pf_free )
-p_box->pf_free( p_box );
+MP4_Box_Clean_Specific( p_box );
 
 if( p_box->data.p_payload )
 free( p_box->data.p_payload );

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


[vlc-commits] demux: libmp4: rewrite nextbox/container reading

2015-09-09 Thread Francois Cartegnie
vlc | branch: master | Francois Cartegnie  | Tue Sep  8 
16:42:57 2015 +0200| [27e7fb5d39c3cd25f502720a017090a4cb3ac16b] | committer: 
Francois Cartegnie

demux: libmp4: rewrite nextbox/container reading

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

 modules/demux/dash/mp4/AtomsReader.cpp|2 +-
 modules/demux/mp4/libmp4.c|  181 ++---
 modules/demux/mp4/libmp4.h|2 +-
 modules/demux/mp4/mp4.c   |8 +-
 modules/stream_filter/smooth/downloader.c |2 +-
 5 files changed, 123 insertions(+), 72 deletions(-)

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


[vlc-commits] direct3d9: the surface allocated from the pool needs to have the decoder size

2015-09-09 Thread Steve Lhomme
vlc | branch: master | Steve Lhomme  | Mon Sep  7 14:40:47 
2015 +0200| [d3bc255c2ea884d2696081603409b8d2f590ee96] | committer: 
Jean-Baptiste Kempf

direct3d9: the surface allocated from the pool needs to have the decoder size

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/video_output/msw/direct3d9.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/video_output/msw/direct3d9.c 
b/modules/video_output/msw/direct3d9.c
index 95ba1ce..2f5d2a9 100644
--- a/modules/video_output/msw/direct3d9.c
+++ b/modules/video_output/msw/direct3d9.c
@@ -298,8 +298,8 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned 
count)
 goto error;
 
 HRESULT hr = 
IDirect3DDevice9_CreateOffscreenPlainSurface(vd->sys->d3ddev,
-  
vd->fmt.i_visible_width,
-  
vd->fmt.i_visible_height,
+  vd->fmt.i_width,
+  vd->fmt.i_height,
   
MAKEFOURCC('N','V','1','2'),
   D3DPOOL_DEFAULT,
   >surface,

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


[vlc-commits] direct3d11: fix the subpictures position on Winstore apps

2015-09-09 Thread Steve Lhomme
vlc | branch: master | Steve Lhomme  | Fri Aug 28 09:17:28 
2015 +0200| [fbcd354f0a50df6018e0965d3ef7e51b5fb2187c] | committer: 
Jean-Baptiste Kempf

direct3d11: fix the subpictures position on Winstore apps

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/video_output/msw/direct3d11.c |   13 +
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/modules/video_output/msw/direct3d11.c 
b/modules/video_output/msw/direct3d11.c
index a995c67..8185ab0 100644
--- a/modules/video_output/msw/direct3d11.c
+++ b/modules/video_output/msw/direct3d11.c
@@ -142,8 +142,8 @@ typedef struct d3d_vertex_t {
 FLOAT   opacity;
 } d3d_vertex_t;
 
-#define RECTWidth(r)   (int)(r.right - r.left)
-#define RECTHeight(r)  (int)(r.bottom - r.top)
+#define RECTWidth(r)   (int)((r).right - (r).left)
+#define RECTHeight(r)  (int)((r).bottom - (r).top)
 
 static int  Open(vlc_object_t *);
 static void Close(vlc_object_t *object);
@@ -1758,9 +1758,14 @@ static int Direct3D11MapSubpicture(vout_display_t *vd, 
int *subpicture_region_co
 dst.bottom = dst.top  + scale_h * r->fmt.i_visible_height;
 
 float opacity = (float)r->i_alpha / 255.0f;
-
+const RECT *p_viewport;
+#if VLC_WINSTORE_APP
+p_viewport = >rect_display;
+#else
+p_viewport = 
+#endif
 UpdateQuadPosition(vd, (d3d_quad_t *)quad_picture->p_sys, ,
-   i_original_width, i_original_height, opacity);
+RECTWidth( *p_viewport ), RECTHeight( *p_viewport ), opacity );
 }
 return VLC_SUCCESS;
 }

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


[vlc-commits] aout: fix use after free

2015-09-09 Thread Hannes Domani
vlc | branch: master | Hannes Domani  | Thu Aug 27 16:18:26 
2015 +0200| [e0457843005da71bfa119f9c1e4bd023a4761fce] | committer: 
Jean-Baptiste Kempf

aout: fix use after free

Signed-off-by: Jean-Baptiste Kempf 

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

 src/audio_output/dec.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/audio_output/dec.c b/src/audio_output/dec.c
index cafaba6..9e356aa 100644
--- a/src/audio_output/dec.c
+++ b/src/audio_output/dec.c
@@ -96,6 +96,7 @@ int aout_DecNew( audio_output_t *p_aout,
 aout_OutputDelete (p_aout);
 error:
 aout_volume_Delete (owner->volume);
+owner->volume = NULL;
 aout_OutputUnlock (p_aout);
 var_Destroy (p_aout, "stereo-mode");
 return -1;
@@ -124,6 +125,7 @@ void aout_DecDelete (audio_output_t *aout)
 aout_OutputDelete (aout);
 }
 aout_volume_Delete (owner->volume);
+owner->volume = NULL;
 aout_OutputUnlock (aout);
 var_Destroy (aout, "stereo-mode");
 }

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


[vlc-commits] demux: mp4: ensure to load fragmented index

2015-09-09 Thread Francois Cartegnie
vlc | branch: master | Francois Cartegnie  | Wed Sep  9 
11:10:16 2015 +0200| [6879a4fc44cbef8151ea94094d0aa79bb1e38581] | committer: 
Francois Cartegnie

demux: mp4: ensure to load fragmented index

Could be skipped as we stop parsing on moov
and index can live between moov and moof

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

 modules/demux/mp4/libmp4.c |   57 
 1 file changed, 31 insertions(+), 26 deletions(-)

diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index ce8daea..35b774d 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -264,7 +264,8 @@ static inline MP4_Box_t *MP4_ReadNextBox( stream_t 
*p_stream, MP4_Box_t *p_fathe
  * without container size, file position on exit is unknown
  */
 static int MP4_ReadBoxContainerChildrenIndexed( stream_t *p_stream,
-   MP4_Box_t *p_container, const uint32_t stoplist[], bool 
b_indexed )
+   MP4_Box_t *p_container, const uint32_t stoplist[],
+   const uint32_t excludelist[], bool b_indexed )
 {
 /* Size of root container is set to 0 when unknown, for exemple
  * with a DASH stream. In that case, we skip the following check */
@@ -296,8 +297,7 @@ static int MP4_ReadBoxContainerChildrenIndexed( stream_t 
*p_stream,
 break;
 i_index = GetDWBE([4]);
 }
-
-if( (p_box = MP4_ReadNextBox( p_stream, p_container )) )
+if( (p_box = MP4_ReadBoxRestricted( p_stream, p_container, NULL, 
excludelist )) )
 {
 p_box->i_index = i_index;
 for(size_t i=0; stoplist && stoplist[i]; i++)
@@ -334,7 +334,7 @@ int MP4_ReadBoxContainerChildren( stream_t *p_stream, 
MP4_Box_t *p_container,
   const uint32_t stoplist[] )
 {
 return MP4_ReadBoxContainerChildrenIndexed( p_stream, p_container,
-stoplist, false );
+stoplist, NULL, false );
 }
 
 static void MP4_BoxOffsetUp( MP4_Box_t *p_box, uint64_t i_offset )
@@ -451,7 +451,7 @@ static int MP4_ReadBox_ilst( stream_t *p_stream, MP4_Box_t 
*p_box )
 msg_Warn( p_stream, "no handler for ilst atom" );
 return 0;
 case HANDLER_mdta:
-return MP4_ReadBoxContainerChildrenIndexed( p_stream, p_box, NULL, 
true );
+return MP4_ReadBoxContainerChildrenIndexed( p_stream, p_box, NULL, 
NULL, true );
 case HANDLER_mdir:
 return MP4_ReadBoxContainerChildren( p_stream, p_box, NULL );
 default:
@@ -4168,28 +4168,27 @@ MP4_Box_t *MP4_BoxGetNextChunk( stream_t *s )
  */
 MP4_Box_t *MP4_BoxGetRoot( stream_t *p_stream )
 {
-MP4_Box_t *p_root;
 int i_result;
 
-p_root = calloc( 1, sizeof( MP4_Box_t ) );
-if( p_root == NULL )
+MP4_Box_t *p_vroot = calloc( 1, sizeof( MP4_Box_t ) );
+if( p_vroot == NULL )
 return NULL;
 
-p_root->i_type = ATOM_root;
-p_root->i_shortsize = 1;
+p_vroot->i_type = ATOM_root;
+p_vroot->i_shortsize = 1;
 int64_t i_size = stream_Size( p_stream );
 if( i_size > 0 )
-p_root->i_size = i_size;
+p_vroot->i_size = i_size;
 
 /* could be a DASH stream for exemple, 0 means unknown or infinite size */
-CreateUUID( _root->i_uuid, p_root->i_type );
+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_root, stoplist );
+i_result = MP4_ReadBoxContainerChildren( p_stream, p_vroot, stoplist );
 
 /* mdat appeared first */
-if( i_result && !MP4_BoxGet( p_root, "moov" ) )
+if( i_result && !MP4_BoxGet( p_vroot, "moov" ) )
 {
 bool b_seekable;
 if( stream_Control( p_stream, STREAM_CAN_SEEK, _seekable ) != 
VLC_SUCCESS || !b_seekable )
@@ -4200,20 +4199,26 @@ MP4_Box_t *MP4_BoxGetRoot( stream_t *p_stream )
 
 /* continue loading up to moov */
 const uint32_t stoplist[] = { ATOM_moov, 0 };
-i_result = MP4_ReadBoxContainerChildren( p_stream, p_root, stoplist );
+i_result = MP4_ReadBoxContainerChildren( p_stream, p_vroot, stoplist );
 }
 
 if( !i_result )
 goto error;
 
 /* If there is a mvex box, it means fragmented MP4, and we're done */
-if( MP4_BoxCount( p_root, "moov/mvex" ) > 0 )
-return p_root;
+if( MP4_BoxCount( p_vroot, "moov/mvex" ) > 0 )
+{
+/* Read a bit more atoms as we might have an index between moov and 
moof */
+const uint32_t stoplist[] = { ATOM_sidx, 0 };
+const uint32_t excludelist[] = { ATOM_moof, ATOM_mdat, 0 };
+MP4_ReadBoxContainerChildrenIndexed( 

[vlc-commits] demux: libmp4: fix warning

2015-09-09 Thread Francois Cartegnie
vlc | branch: master | Francois Cartegnie  | Tue Sep  8 
11:23:18 2015 +0200| [f8809911cb4f245681e523248e559c66196f8eac] | committer: 
Francois Cartegnie

demux: libmp4: fix warning

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

 modules/demux/mp4/libmp4.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index d4ed047..56dab62 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -239,7 +239,7 @@ static int MP4_ReadBoxContainerChildrenIndexed( stream_t 
*p_stream,
  * with a DASH stream. In that case, we skip the following check */
 if( (p_container->i_size || p_container->p_father)
 && ( stream_Tell( p_stream ) + ((b_indexed)?16:8) >
-(off_t)(p_container->i_pos + p_container->i_size) )
+(uint64_t)(p_container->i_pos + p_container->i_size) )
   )
 {
 /* there is no box to load */

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


[vlc-commits] demux: libmp4: fix oob access

2015-09-09 Thread Francois Cartegnie
vlc | branch: master | Francois Cartegnie  | Mon Sep  7 
23:15:36 2015 +0200| [482a404fc64ae81256836f1a058c4c4eb5be236a] | committer: 
Francois Cartegnie

demux: libmp4: fix oob access

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

 modules/demux/mp4/libmp4.c |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index 97f4290..956cda0 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -150,11 +150,10 @@ int MP4_PeekBoxHeader( stream_t *p_stream, MP4_Box_t 
*p_box )
 /* XXX size of 0 means that the box extends to end of file */
 }
 
-if( p_box->i_type == ATOM_uuid )
+if( p_box->i_type == ATOM_uuid && i_read >= 16 )
 {
 /* get extented type on 16 bytes */
 GetUUID( _box->i_uuid, p_peek );
-p_peek += 16; i_read -= 16;
 }
 else
 {

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


[vlc-commits] demux: mp4: add check for reversed moov/mdat order with non seekable files

2015-09-09 Thread Francois Cartegnie
vlc | branch: master | Francois Cartegnie  | Tue Sep  8 
16:53:33 2015 +0200| [89c26f3581721572ee86b62dfdbb3e2a672a5568] | committer: 
Francois Cartegnie

demux: mp4: add check for reversed moov/mdat order with non seekable files

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

 modules/demux/mp4/libmp4.c |   20 ++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index 6e59ba7..1063110 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -4185,13 +4185,29 @@ MP4_Box_t *MP4_BoxGetRoot( stream_t *p_stream )
 CreateUUID( _root->i_uuid, p_root->i_type );
 
 /* First get the moov */
-const uint32_t stoplist[] = { ATOM_moov, 0 };
+const uint32_t stoplist[] = { ATOM_moov, ATOM_mdat, 0 };
 i_result = MP4_ReadBoxContainerChildren( p_stream, p_root, stoplist );
 
+/* mdat appeared first */
+if( i_result && !MP4_BoxGet( p_root, "moov" ) )
+{
+bool b_seekable;
+if( stream_Control( p_stream, STREAM_CAN_SEEK, _seekable ) != 
VLC_SUCCESS || !b_seekable )
+{
+msg_Err( p_stream, "no moov before mdat and the stream is not 
seekable" );
+goto error;
+}
+
+/* continue loading up to moov */
+const uint32_t stoplist[] = { ATOM_moov, 0 };
+i_result = MP4_ReadBoxContainerChildren( p_stream, p_root, stoplist );
+}
+
 if( !i_result )
 goto error;
+
 /* If there is a mvex box, it means fragmented MP4, and we're done */
-else if( MP4_BoxCount( p_root, "moov/mvex" ) > 0 )
+if( MP4_BoxCount( p_root, "moov/mvex" ) > 0 )
 return p_root;
 
 if( stream_Tell( p_stream ) + 8 < (uint64_t) stream_Size( p_stream ) )

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


[vlc-commits] demux: libmp4: set root container size before probing

2015-09-09 Thread Francois Cartegnie
vlc | branch: master | Francois Cartegnie  | Tue Sep  8 
14:08:44 2015 +0200| [6bff31b4c3d180174d3f672526369884dc2bfdfc] | committer: 
Francois Cartegnie

demux: libmp4: set root container size before probing

avoids late failures

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

 modules/demux/mp4/libmp4.c |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index 56dab62..4bd76e0 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -4118,10 +4118,9 @@ MP4_Box_t *MP4_BoxGetNextChunk( stream_t *s )
  *  The first box is a virtual box "root" and is the father for all first
  *  level boxes for the file, a sort of virtual contener
  */
-MP4_Box_t *MP4_BoxGetRoot( stream_t *s )
+MP4_Box_t *MP4_BoxGetRoot( stream_t *p_stream )
 {
 MP4_Box_t *p_root;
-stream_t *p_stream;
 int i_result;
 
 p_root = calloc( 1, sizeof( MP4_Box_t ) );
@@ -4130,11 +4129,13 @@ MP4_Box_t *MP4_BoxGetRoot( stream_t *s )
 
 p_root->i_type = ATOM_root;
 p_root->i_shortsize = 1;
+int64_t i_size = stream_Size( p_stream );
+if( i_size > 0 )
+p_root->i_size = i_size;
+
 /* could be a DASH stream for exemple, 0 means unknown or infinite size */
 CreateUUID( _root->i_uuid, p_root->i_type );
 
-p_stream = s;
-
 /* First get the moov */
 i_result = MP4_ReadBoxContainerChildren( p_stream, p_root, ATOM_moov );
 
@@ -4144,8 +4145,7 @@ MP4_Box_t *MP4_BoxGetRoot( stream_t *s )
 else if( MP4_BoxCount( p_root, "moov/mvex" ) > 0 )
 return p_root;
 
-p_root->i_size = stream_Size( s );
-if( stream_Tell( s ) + 8 < stream_Size( s ) )
+if( stream_Tell( p_stream ) + 8 < (uint64_t) stream_Size( p_stream ) )
 {
 /* Get the rest of the file */
 i_result = MP4_ReadBoxContainerChildren( p_stream, p_root, 0 );

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


[vlc-commits] demux: libmp4: add missing parenting in BoxAddChild

2015-09-09 Thread Francois Cartegnie
vlc | branch: master | Francois Cartegnie  | Mon Sep  7 
23:29:01 2015 +0200| [21426e83fde3263dfb3aa6290069b5d56765efc3] | committer: 
Francois Cartegnie

demux: libmp4: add missing parenting in BoxAddChild

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

 modules/demux/mp4/libmp4.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index 956cda0..92a08d9 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -103,6 +103,7 @@ static void MP4_BoxAddChild( MP4_Box_t *p_parent, MP4_Box_t 
*p_childbox )
 else
 p_parent->p_last->p_next = p_childbox;
 p_parent->p_last = p_childbox;
+p_childbox->p_father = p_parent;
 }
 
 /* Don't use stream_Seek directly */

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


[vlc-commits] demux: adaptative: fix chained initializations bug

2015-09-09 Thread Francois Cartegnie
vlc | branch: master | Francois Cartegnie  | Wed Sep  9 
11:41:25 2015 +0200| [c1591aa1246bcc1c0dd292d64c2757443d2a354d] | committer: 
Francois Cartegnie

demux: adaptative: fix chained initializations bug

Since the bw adaptation can go really fast now,
we need to be sure to send at least 1 data segment
before switching to another.
Otherwise we'll have multiple moov bug and can
also never get any data outside of init segments.

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

 modules/demux/adaptative/SegmentTracker.cpp |   22 +-
 modules/demux/adaptative/SegmentTracker.hpp |3 ++-
 2 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/modules/demux/adaptative/SegmentTracker.cpp 
b/modules/demux/adaptative/SegmentTracker.cpp
index e64ee11..dd23890 100644
--- a/modules/demux/adaptative/SegmentTracker.cpp
+++ b/modules/demux/adaptative/SegmentTracker.cpp
@@ -32,7 +32,8 @@ SegmentTracker::SegmentTracker(AbstractAdaptationLogic 
*logic_, BaseAdaptationSe
 {
 count = 0;
 initializing = true;
-indexed = false;
+index_sent = false;
+init_sent = false;
 prevRepresentation = NULL;
 setAdaptationLogic(logic_);
 adaptationSet = adaptSet;
@@ -62,6 +63,10 @@ SegmentChunk * SegmentTracker::getNextChunk(bool 
switch_allowed)
 if(!adaptationSet)
 return NULL;
 
+/* Ensure we don't keep chaining init/index without data */
+if( initializing && prevRepresentation )
+switch_allowed = false;
+
 if( !switch_allowed ||
(prevRepresentation && prevRepresentation->getSwitchPolicy() == 
SegmentInformation::SWITCH_UNAVAILABLE) )
 rep = prevRepresentation;
@@ -74,20 +79,21 @@ SegmentChunk * SegmentTracker::getNextChunk(bool 
switch_allowed)
 if(rep != prevRepresentation)
 {
 prevRepresentation = rep;
+init_sent = false;
 initializing = true;
 }
 
-if(initializing)
+if(!init_sent)
 {
-initializing = false;
+init_sent = true;
 segment = rep->getSegment(BaseRepresentation::INFOTYPE_INIT);
 if(segment)
 return segment->toChunk(count, rep);
 }
 
-if(!indexed)
+if(!index_sent)
 {
-indexed = true;
+index_sent = true;
 segment = rep->getSegment(BaseRepresentation::INFOTYPE_INDEX);
 if(segment)
 return segment->toChunk(count, rep);
@@ -99,6 +105,8 @@ SegmentChunk * SegmentTracker::getNextChunk(bool 
switch_allowed)
 resetCounter();
 return NULL;
 }
+/* stop initializing after 1st chunk */
+initializing = false;
 
 SegmentChunk *chunk = segment->toChunk(count, rep);
 if(chunk)
@@ -116,7 +124,11 @@ bool SegmentTracker::setPosition(mtime_t time, bool 
restarted, bool tryonly)
 if(!tryonly)
 {
 if(restarted)
+{
 initializing = true;
+index_sent = false;
+init_sent = false;
+}
 count = segcount;
 }
 return true;
diff --git a/modules/demux/adaptative/SegmentTracker.hpp 
b/modules/demux/adaptative/SegmentTracker.hpp
index 1f04100..023cf12 100644
--- a/modules/demux/adaptative/SegmentTracker.hpp
+++ b/modules/demux/adaptative/SegmentTracker.hpp
@@ -59,7 +59,8 @@ namespace adaptative
 
 private:
 bool initializing;
-bool indexed;
+bool index_sent;
+bool init_sent;
 uint64_t count;
 AbstractAdaptationLogic *logic;
 BaseAdaptationSet *adaptationSet;

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


[vlc-commits] demux: mp4: fix leak

2015-09-09 Thread Francois Cartegnie
vlc | branch: master | Francois Cartegnie  | Tue Sep  8 
19:22:39 2015 +0200| [897e35aa6bd6b0c3030d14fb7cacb1511a60b74d] | committer: 
Francois Cartegnie

demux: mp4: fix leak

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

 modules/demux/mp4/libmp4.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index 314bd26..ce8daea 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -4247,7 +4247,7 @@ MP4_Box_t *MP4_BoxGetRoot( stream_t *p_stream )
 return p_root;
 
 error:
-free( p_vroot );
+MP4_BoxFree( p_vroot );
 MP4_Seek( p_stream, 0 );
 return NULL;
 }

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


[vlc-commits] direct3d/directx: the surface allocated for the pool needs to have the decoder size

2015-09-09 Thread Steve Lhomme
vlc/vlc-2.2 | branch: master | Steve Lhomme  | Tue Sep  8 
16:39:43 2015 +0200| [0d2f10a01441fba8f835686581aa5284f0bac253] | committer: 
Jean-Baptiste Kempf

direct3d/directx: the surface allocated for the pool needs to have the decoder 
size

in the case of direct rendering picture_CopyPixels is used to transfer from
the decoder to the display and requires the same surface properties

the planes now have the same lines/pixels as the decoder, not just the visible 
ones

fixes #14531

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/video_output/msw/common.c   |4 ++--
 modules/video_output/msw/direct3d.c |   17 +++--
 modules/video_output/msw/directx.c  |4 ++--
 3 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/modules/video_output/msw/common.c 
b/modules/video_output/msw/common.c
index fbf790c..0441957 100644
--- a/modules/video_output/msw/common.c
+++ b/modules/video_output/msw/common.c
@@ -213,7 +213,7 @@ int CommonUpdatePicture(picture_t *picture, picture_t 
**fallback,
 /* fill in buffer info in first plane */
 picture->p->p_pixels = data;
 picture->p->i_pitch  = pitch;
-picture->p->i_lines  = picture->format.i_visible_height;
+picture->p->i_lines  = picture->format.i_height;
 
 /*  Fill chroma planes for planar YUV */
 if (picture->format.i_chroma == VLC_CODEC_I420 ||
@@ -226,7 +226,7 @@ int CommonUpdatePicture(picture_t *picture, picture_t 
**fallback,
 
 p->p_pixels = o->p_pixels + o->i_lines * o->i_pitch;
 p->i_pitch  = pitch / 2;
-p->i_lines  = picture->format.i_visible_height / 2;
+p->i_lines  = picture->format.i_height / 2;
 }
 /* The dx/d3d buffer is always allocated as YV12 */
 if (vlc_fourcc_AreUVPlanesSwapped(picture->format.i_chroma, 
VLC_CODEC_YV12)) {
diff --git a/modules/video_output/msw/direct3d.c 
b/modules/video_output/msw/direct3d.c
index 7fa4585..804560f 100644
--- a/modules/video_output/msw/direct3d.c
+++ b/modules/video_output/msw/direct3d.c
@@ -971,8 +971,8 @@ static int Direct3DCreatePool(vout_display_t *vd, 
video_format_t *fmt)
 /* Create a surface */
 LPDIRECT3DSURFACE9 surface;
 HRESULT hr = IDirect3DDevice9_CreateOffscreenPlainSurface(d3ddev,
-  
fmt->i_visible_width,
-  
fmt->i_visible_height,
+  fmt->i_width,
+  fmt->i_height,
   d3dfmt->format,
   D3DPOOL_DEFAULT,
   ,
@@ -995,7 +995,7 @@ static int Direct3DCreatePool(vout_display_t *vd, 
video_format_t *fmt)
 
 picture_resource_t resource = { .p_sys = picsys };
 for (int i = 0; i < PICTURE_PLANE_MAX; i++)
-resource.p[i].i_lines = fmt->i_visible_height / (i > 0 ? 2 : 1);
+resource.p[i].i_lines = fmt->i_height / (i > 0 ? 2 : 1);
 
 picture_t *picture = picture_NewFromResource(fmt, );
 if (!picture) {
@@ -1054,8 +1054,8 @@ static int Direct3DCreateScene(vout_display_t *vd, const 
video_format_t *fmt)
  */
 LPDIRECT3DTEXTURE9 d3dtex;
 hr = IDirect3DDevice9_CreateTexture(d3ddev,
-fmt->i_visible_width,
-fmt->i_visible_height,
+fmt->i_width,
+fmt->i_height,
 1,
 D3DUSAGE_RENDERTARGET,
 sys->d3dpp.BackBufferFormat,
@@ -1461,7 +1461,12 @@ static int Direct3DImportPicture(vout_display_t *vd,
 
 /* Copy picture surface into texture surface
  * color space conversion happen here */
-hr = IDirect3DDevice9_StretchRect(sys->d3ddev, source, NULL, destination, 
NULL, D3DTEXF_LINEAR);
+RECT cropSource;
+cropSource.left = 0;
+cropSource.top = 0;
+cropSource.right = vd->fmt.i_visible_width;
+cropSource.bottom = vd->fmt.i_visible_height;
+hr = IDirect3DDevice9_StretchRect(sys->d3ddev, source, , 
destination, NULL, D3DTEXF_LINEAR);
 IDirect3DSurface9_Release(destination);
 if (FAILED(hr)) {
 msg_Dbg(vd, "%s:%d (hr=0x%0lX)", __FUNCTION__, __LINE__, hr);
diff --git a/modules/video_output/msw/directx.c 
b/modules/video_output/msw/directx.c
index afaa8f8..6ce1eab 100644
--- a/modules/video_output/msw/directx.c
+++ b/modules/video_output/msw/directx.c
@@ -851,8 +851,8 @@ static int DirectXCreateSurface(vout_display_t *vd,
 ddsd.dwSize   = sizeof(ddsd);
 

[vlc-commits] macosx: enable UI update timer on Safari 9

2015-09-09 Thread Felix Paul Kühne
npapi-vlc | branch: master | Felix Paul Kühne  | Wed Sep  
9 15:08:52 2015 +0200| [9e9ca0e5d9687de3351aa74c2bae1a7e4c3f1705] | committer: 
Felix Paul Kühne

macosx: enable UI update timer on Safari 9

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

 npapi/vlcplugin_mac.mm |3 +++
 1 file changed, 3 insertions(+)

diff --git a/npapi/vlcplugin_mac.mm b/npapi/vlcplugin_mac.mm
index 571cb67..fd682e6 100644
--- a/npapi/vlcplugin_mac.mm
+++ b/npapi/vlcplugin_mac.mm
@@ -319,6 +319,9 @@ NPError VlcPluginMac::get_root_layer(void *value)
 if (strstr(userAgent, "Safari") && strstr(userAgent, "Version/5")) {
 NSLog(@"Safari 5 detected, deploying UI update timer");
 [[(VLCPerInstanceStorage *)this->_perInstanceStorage 
browserRootLayer] performSelector:@selector(startUIUpdateTimer) withObject:nil 
afterDelay:1.];
+} else if (strstr(userAgent, "Safari") && strstr(userAgent, 
"Version/9")) {
+NSLog(@"Safari 9 detected, deploying UI update timer");
+[[(VLCPerInstanceStorage *)this->_perInstanceStorage 
browserRootLayer] performSelector:@selector(startUIUpdateTimer) withObject:nil 
afterDelay:1.];
 } else if (strstr(userAgent, "Firefox")) {
 NSLog(@"Firefox detected, deploying UI update timer");
 this->runningWithinFirefox = true;

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


[vlc-commits] D3D: the surface allocated for the pool needs to have the decoder size

2015-09-09 Thread Steve Lhomme
vlc | branch: master | Steve Lhomme  | Wed Sep  9 14:32:04 
2015 +0200| [2c4f2e2308cac08fe4eb4d4877e69556de5b533e] | committer: 
Jean-Baptiste Kempf

D3D: the surface allocated for the pool needs to have the decoder size

in the case of direct rendering picture_CopyPixels is used to transfer from
the decoder to the display and requires the same surface properties

the planes now have the same lines/pixels as the decoder, not just the visible 
ones

fixes #14531

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/video_output/msw/common.c |6 +++---
 modules/video_output/msw/direct3d11.c |4 ++--
 modules/video_output/msw/direct3d9.c  |   14 +++---
 modules/video_output/msw/directdraw.c |4 ++--
 4 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/modules/video_output/msw/common.c 
b/modules/video_output/msw/common.c
index 1f9ee0b..e60a639 100644
--- a/modules/video_output/msw/common.c
+++ b/modules/video_output/msw/common.c
@@ -452,7 +452,7 @@ int CommonUpdatePicture(picture_t *picture, picture_t 
**fallback,
 /* fill in buffer info in first plane */
 picture->p->p_pixels = data;
 picture->p->i_pitch  = pitch;
-picture->p->i_lines  = picture->format.i_visible_height;
+picture->p->i_lines  = picture->format.i_height;
 
 /*  Fill chroma planes for biplanar YUV */
 if (picture->format.i_chroma == VLC_CODEC_NV12 ||
@@ -464,7 +464,7 @@ int CommonUpdatePicture(picture_t *picture, picture_t 
**fallback,
 
 p->p_pixels = o->p_pixels + o->i_lines * o->i_pitch;
 p->i_pitch  = pitch;
-p->i_lines  = picture->format.i_visible_height;
+p->i_lines  = picture->format.i_height;
 }
 /* The dx/d3d buffer is always allocated as NV12 */
 if (vlc_fourcc_AreUVPlanesSwapped(picture->format.i_chroma, 
VLC_CODEC_NV12)) {
@@ -484,7 +484,7 @@ int CommonUpdatePicture(picture_t *picture, picture_t 
**fallback,
 
 p->p_pixels = o->p_pixels + o->i_lines * o->i_pitch;
 p->i_pitch  = pitch / 2;
-p->i_lines  = picture->format.i_visible_height / 2;
+p->i_lines  = picture->format.i_height / 2;
 }
 /* The dx/d3d buffer is always allocated as YV12 */
 if (vlc_fourcc_AreUVPlanesSwapped(picture->format.i_chroma, 
VLC_CODEC_YV12)) {
diff --git a/modules/video_output/msw/direct3d11.c 
b/modules/video_output/msw/direct3d11.c
index 8185ab0..f69aec5 100644
--- a/modules/video_output/msw/direct3d11.c
+++ b/modules/video_output/msw/direct3d11.c
@@ -1488,8 +1488,8 @@ static int AllocQuad(vout_display_t *vd, const 
video_format_t *fmt, d3d_quad_t *
 
 D3D11_TEXTURE2D_DESC texDesc;
 memset(, 0, sizeof(texDesc));
-texDesc.Width = fmt->i_visible_width;
-texDesc.Height = fmt->i_visible_height;
+texDesc.Width = fmt->i_width;
+texDesc.Height = fmt->i_height;
 texDesc.MipLevels = texDesc.ArraySize = 1;
 texDesc.Format = cfg->textureFormat;
 texDesc.SampleDesc.Count = 1;
diff --git a/modules/video_output/msw/direct3d9.c 
b/modules/video_output/msw/direct3d9.c
index 2f5d2a9..d9fb2f7 100644
--- a/modules/video_output/msw/direct3d9.c
+++ b/modules/video_output/msw/direct3d9.c
@@ -1032,8 +1032,8 @@ static int Direct3D9CreatePool(vout_display_t *vd, 
video_format_t *fmt)
 /* Create a surface */
 LPDIRECT3DSURFACE9 surface;
 HRESULT hr = IDirect3DDevice9_CreateOffscreenPlainSurface(d3ddev,
-  
fmt->i_visible_width,
-  
fmt->i_visible_height,
+  fmt->i_width,
+  fmt->i_height,
   d3dfmt->format,
   D3DPOOL_DEFAULT,
   ,
@@ -1045,7 +1045,7 @@ static int Direct3D9CreatePool(vout_display_t *vd, 
video_format_t *fmt)
 
 #ifndef NDEBUG
 msg_Dbg(vd, "Direct3D created offscreen surface: %ix%i",
-fmt->i_visible_width, fmt->i_visible_height);
+fmt->i_width, fmt->i_height);
 #endif
 
 /* fill surface with black color */
@@ -1062,7 +1062,7 @@ static int Direct3D9CreatePool(vout_display_t *vd, 
video_format_t *fmt)
 
 picture_resource_t resource = { .p_sys = picsys };
 for (int i = 0; i < PICTURE_PLANE_MAX; i++)
-resource.p[i].i_lines = fmt->i_visible_height / (i > 0 ? 2 : 1);
+resource.p[i].i_lines = fmt->i_height / (i > 0 ? 2 : 1);
 
 picture_t *picture = picture_NewFromResource(fmt, );
 if (!picture) {
@@ -1124,8 +1124,8 @@ static int Direct3D9CreateScene(vout_display_t *vd, const 
video_format_t *fmt)
  */
   

[vlc-commits] D3D: the surface allocated for the pool needs to have the decoder size

2015-09-09 Thread Steve Lhomme
vlc | branch: master | Steve Lhomme  | Wed Sep  9 14:32:04 
2015 +0200| [b5fe304027868c9930b3b42c77d5ba43e8e13b17] | committer: 
Jean-Baptiste Kempf

D3D: the surface allocated for the pool needs to have the decoder size

in the case of direct rendering picture_CopyPixels is used to transfer from
the decoder to the display and requires the same surface properties

the planes now have the same lines/pixels as the decoder, not just the visible 
ones

fixes #14531

Signed-off-by: Jean-Baptiste Kempf 

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

 modules/video_output/msw/common.c |6 +++---
 modules/video_output/msw/direct3d11.c |4 ++--
 modules/video_output/msw/direct3d9.c  |   14 +++---
 modules/video_output/msw/directdraw.c |4 ++--
 4 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/modules/video_output/msw/common.c 
b/modules/video_output/msw/common.c
index 1f9ee0b..e60a639 100644
--- a/modules/video_output/msw/common.c
+++ b/modules/video_output/msw/common.c
@@ -452,7 +452,7 @@ int CommonUpdatePicture(picture_t *picture, picture_t 
**fallback,
 /* fill in buffer info in first plane */
 picture->p->p_pixels = data;
 picture->p->i_pitch  = pitch;
-picture->p->i_lines  = picture->format.i_visible_height;
+picture->p->i_lines  = picture->format.i_height;
 
 /*  Fill chroma planes for biplanar YUV */
 if (picture->format.i_chroma == VLC_CODEC_NV12 ||
@@ -464,7 +464,7 @@ int CommonUpdatePicture(picture_t *picture, picture_t 
**fallback,
 
 p->p_pixels = o->p_pixels + o->i_lines * o->i_pitch;
 p->i_pitch  = pitch;
-p->i_lines  = picture->format.i_visible_height;
+p->i_lines  = picture->format.i_height;
 }
 /* The dx/d3d buffer is always allocated as NV12 */
 if (vlc_fourcc_AreUVPlanesSwapped(picture->format.i_chroma, 
VLC_CODEC_NV12)) {
@@ -484,7 +484,7 @@ int CommonUpdatePicture(picture_t *picture, picture_t 
**fallback,
 
 p->p_pixels = o->p_pixels + o->i_lines * o->i_pitch;
 p->i_pitch  = pitch / 2;
-p->i_lines  = picture->format.i_visible_height / 2;
+p->i_lines  = picture->format.i_height / 2;
 }
 /* The dx/d3d buffer is always allocated as YV12 */
 if (vlc_fourcc_AreUVPlanesSwapped(picture->format.i_chroma, 
VLC_CODEC_YV12)) {
diff --git a/modules/video_output/msw/direct3d11.c 
b/modules/video_output/msw/direct3d11.c
index 8185ab0..11441b3 100644
--- a/modules/video_output/msw/direct3d11.c
+++ b/modules/video_output/msw/direct3d11.c
@@ -1488,8 +1488,8 @@ static int AllocQuad(vout_display_t *vd, const 
video_format_t *fmt, d3d_quad_t *
 
 D3D11_TEXTURE2D_DESC texDesc;
 memset(, 0, sizeof(texDesc));
-texDesc.Width = fmt->i_visible_width;
-texDesc.Height = fmt->i_visible_height;
+texDesc.Width = i_width;
+texDesc.Height = i_height;
 texDesc.MipLevels = texDesc.ArraySize = 1;
 texDesc.Format = cfg->textureFormat;
 texDesc.SampleDesc.Count = 1;
diff --git a/modules/video_output/msw/direct3d9.c 
b/modules/video_output/msw/direct3d9.c
index 2f5d2a9..d9fb2f7 100644
--- a/modules/video_output/msw/direct3d9.c
+++ b/modules/video_output/msw/direct3d9.c
@@ -1032,8 +1032,8 @@ static int Direct3D9CreatePool(vout_display_t *vd, 
video_format_t *fmt)
 /* Create a surface */
 LPDIRECT3DSURFACE9 surface;
 HRESULT hr = IDirect3DDevice9_CreateOffscreenPlainSurface(d3ddev,
-  
fmt->i_visible_width,
-  
fmt->i_visible_height,
+  fmt->i_width,
+  fmt->i_height,
   d3dfmt->format,
   D3DPOOL_DEFAULT,
   ,
@@ -1045,7 +1045,7 @@ static int Direct3D9CreatePool(vout_display_t *vd, 
video_format_t *fmt)
 
 #ifndef NDEBUG
 msg_Dbg(vd, "Direct3D created offscreen surface: %ix%i",
-fmt->i_visible_width, fmt->i_visible_height);
+fmt->i_width, fmt->i_height);
 #endif
 
 /* fill surface with black color */
@@ -1062,7 +1062,7 @@ static int Direct3D9CreatePool(vout_display_t *vd, 
video_format_t *fmt)
 
 picture_resource_t resource = { .p_sys = picsys };
 for (int i = 0; i < PICTURE_PLANE_MAX; i++)
-resource.p[i].i_lines = fmt->i_visible_height / (i > 0 ? 2 : 1);
+resource.p[i].i_lines = fmt->i_height / (i > 0 ? 2 : 1);
 
 picture_t *picture = picture_NewFromResource(fmt, );
 if (!picture) {
@@ -1124,8 +1124,8 @@ static int Direct3D9CreateScene(vout_display_t *vd, const 
video_format_t *fmt)
  */
 

[vlc-commits] disable debug logging in prod

2015-09-09 Thread Felix Paul Kühne
npapi-vlc | branch: master | Felix Paul Kühne  | Wed Sep  
9 15:10:54 2015 +0200| [be6544ac4d8ffed3927f9e727627b10620fa4aba] | committer: 
Felix Paul Kühne

disable debug logging in prod

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

 npapi/vlcplugin_base.cpp |4 
 1 file changed, 4 insertions(+)

diff --git a/npapi/vlcplugin_base.cpp b/npapi/vlcplugin_base.cpp
index bac8107..cd28998 100644
--- a/npapi/vlcplugin_base.cpp
+++ b/npapi/vlcplugin_base.cpp
@@ -111,7 +111,11 @@ NPError VlcPluginBase::init(int argc, char* const argn[], 
char* const argv[])
 #endif
 
 /* common settings */
+#ifndef NDEBUG
 ppsz_argv[ppsz_argc++] = "-vv";
+#else
+ppsz_argv[ppsz_argc++] = "--quiet";
+#endif
 ppsz_argv[ppsz_argc++] = "--no-stats";
 ppsz_argv[ppsz_argc++] = "--no-media-library";
 ppsz_argv[ppsz_argc++] = "--intf=dummy";

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


[vlc-commits] macosx: update code-signing script for the future

2015-09-09 Thread Felix Paul Kühne
vlc/vlc-2.2 | branch: master | Felix Paul Kühne  | Wed 
Sep  9 17:08:11 2015 +0200| [31f98d138480858800826067788df2aac25be998] | 
committer: Felix Paul Kühne

macosx: update code-signing script for the future

(cherry picked from commit 560eedbab4479ca6e0975762315f95981ba60d42)

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

 extras/package/macosx/codesign.sh |   26 +-
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/extras/package/macosx/codesign.sh 
b/extras/package/macosx/codesign.sh
index 9e623a1..74a9c9d 100755
--- a/extras/package/macosx/codesign.sh
+++ b/extras/package/macosx/codesign.sh
@@ -93,13 +93,13 @@ else
 
 info "Signing frameworks"
 IDENTIFIER="com.binarymethod.BGHUDAppKit"
-codesign --force --verbose -s "$IDENTITY" 
--preserve-metadata=identifier,entitlements,resource-rules --requirements 
"$FIRSTPARTOF_REQUIREMENT$IDENTIFIER$SECONDPARTOF_REQUIREMENT" 
VLC.app/Contents/Frameworks/BGHUDAppKit.framework/Versions/A
+codesign --force --verbose -s "$IDENTITY" 
--preserve-metadata=identifier,entitlements --requirements 
"$FIRSTPARTOF_REQUIREMENT$IDENTIFIER$SECONDPARTOF_REQUIREMENT" --timestamp=none 
VLC.app/Contents/Frameworks/BGHUDAppKit.framework/Versions/A
 IDENTIFIER="com.growl.growlframework"
-codesign --force --verbose -s "$IDENTITY" 
--preserve-metadata=identifier,entitlements,resource-rules --requirements 
"$FIRSTPARTOF_REQUIREMENT$IDENTIFIER$SECONDPARTOF_REQUIREMENT" 
VLC.app/Contents/Frameworks/Growl.framework/Versions/A
+codesign --force --verbose -s "$IDENTITY" 
--preserve-metadata=identifier,entitlements --requirements 
"$FIRSTPARTOF_REQUIREMENT$IDENTIFIER$SECONDPARTOF_REQUIREMENT" --timestamp=none 
VLC.app/Contents/Frameworks/Growl.framework/Versions/A
 IDENTIFIER="org.andymatuschak.sparkle.Autoupdate"
-codesign --force --verbose -s "$IDENTITY" 
--preserve-metadata=identifier,entitlements,resource-rules --requirements 
"$FIRSTPARTOF_REQUIREMENT$IDENTIFIER$SECONDPARTOF_REQUIREMENT" 
VLC.app/Contents/Frameworks/Sparkle.framework/Resources/Autoupdate.app
+codesign --force --verbose -s "$IDENTITY" 
--preserve-metadata=identifier,entitlements --requirements 
"$FIRSTPARTOF_REQUIREMENT$IDENTIFIER$SECONDPARTOF_REQUIREMENT" --timestamp=none 
VLC.app/Contents/Frameworks/Sparkle.framework/Resources/Autoupdate.app
 IDENTIFIER="org.andymatuschak.Sparkle"
-codesign --force --verbose -s "$IDENTITY" 
--preserve-metadata=identifier,entitlements,resource-rules --requirements 
"$FIRSTPARTOF_REQUIREMENT$IDENTIFIER$SECONDPARTOF_REQUIREMENT" 
VLC.app/Contents/Frameworks/Sparkle.framework/Versions/A
+codesign --force --verbose -s "$IDENTITY" 
--preserve-metadata=identifier,entitlements --requirements 
"$FIRSTPARTOF_REQUIREMENT$IDENTIFIER$SECONDPARTOF_REQUIREMENT" --timestamp=none 
VLC.app/Contents/Frameworks/Sparkle.framework/Versions/A
 
 info "Signing the framework headers"
 for i in `find VLC.app/Contents/Frameworks/* -type f -name "*.h" -exec 
echo {} \;`
@@ -107,7 +107,7 @@ else
 fbname=$(basename "$i")
 filename="${fbname%.*}"
 
-codesign --force -s "$IDENTITY" 
--preserve-metadata=identifier,entitlements,resource-rules --requirements 
"$FIRSTPARTOF_REQUIREMENT$filename$SECONDPARTOF_REQUIREMENT" $i
+codesign --force -s "$IDENTITY" 
--preserve-metadata=identifier,entitlements --requirements 
"$FIRSTPARTOF_REQUIREMENT$filename$SECONDPARTOF_REQUIREMENT" --timestamp=none $i
 done
 
 info "Signing the framework strings"
@@ -116,7 +116,7 @@ else
 fbname=$(basename "$i")
 filename="${fbname%.*}"
 
-codesign --force -s "$IDENTITY" 
--preserve-metadata=identifier,entitlements,resource-rules --requirements 
"$FIRSTPARTOF_REQUIREMENT$filename$SECONDPARTOF_REQUIREMENT" $i
+codesign --force -s "$IDENTITY" 
--preserve-metadata=identifier,entitlements --requirements 
"$FIRSTPARTOF_REQUIREMENT$filename$SECONDPARTOF_REQUIREMENT" --timestamp=none $i
 done
 
 info "Signing the framework plist files"
@@ -125,7 +125,7 @@ else
 fbname=$(basename "$i")
 filename="${fbname%.*}"
 
-codesign --force -s "$IDENTITY" 
--preserve-metadata=identifier,entitlements,resource-rules --requirements 
"$FIRSTPARTOF_REQUIREMENT$filename$SECONDPARTOF_REQUIREMENT" $i
+codesign --force -s "$IDENTITY" 
--preserve-metadata=identifier,entitlements --requirements 
"$FIRSTPARTOF_REQUIREMENT$filename$SECONDPARTOF_REQUIREMENT" --timestamp=none $i
 done
 
 info "Signing the framework nib files"
@@ -134,7 +134,7 @@ else
 fbname=$(basename "$i")
 filename="${fbname%.*}"
 
-codesign --force -s "$IDENTITY" 
--preserve-metadata=identifier,entitlements,resource-rules --requirements 
"$FIRSTPARTOF_REQUIREMENT$filename$SECONDPARTOF_REQUIREMENT" $i
+codesign --force -s "$IDENTITY" 
--preserve-metadata=identifier,entitlements 

[vlc-commits] macosx: update code-signing script for the future

2015-09-09 Thread Felix Paul Kühne
vlc | branch: master | Felix Paul Kühne  | Wed Sep  9 
17:08:11 2015 +0200| [560eedbab4479ca6e0975762315f95981ba60d42] | committer: 
Felix Paul Kühne

macosx: update code-signing script for the future

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

 extras/package/macosx/codesign.sh |   26 +-
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/extras/package/macosx/codesign.sh 
b/extras/package/macosx/codesign.sh
index 9e623a1..74a9c9d 100755
--- a/extras/package/macosx/codesign.sh
+++ b/extras/package/macosx/codesign.sh
@@ -93,13 +93,13 @@ else
 
 info "Signing frameworks"
 IDENTIFIER="com.binarymethod.BGHUDAppKit"
-codesign --force --verbose -s "$IDENTITY" 
--preserve-metadata=identifier,entitlements,resource-rules --requirements 
"$FIRSTPARTOF_REQUIREMENT$IDENTIFIER$SECONDPARTOF_REQUIREMENT" 
VLC.app/Contents/Frameworks/BGHUDAppKit.framework/Versions/A
+codesign --force --verbose -s "$IDENTITY" 
--preserve-metadata=identifier,entitlements --requirements 
"$FIRSTPARTOF_REQUIREMENT$IDENTIFIER$SECONDPARTOF_REQUIREMENT" --timestamp=none 
VLC.app/Contents/Frameworks/BGHUDAppKit.framework/Versions/A
 IDENTIFIER="com.growl.growlframework"
-codesign --force --verbose -s "$IDENTITY" 
--preserve-metadata=identifier,entitlements,resource-rules --requirements 
"$FIRSTPARTOF_REQUIREMENT$IDENTIFIER$SECONDPARTOF_REQUIREMENT" 
VLC.app/Contents/Frameworks/Growl.framework/Versions/A
+codesign --force --verbose -s "$IDENTITY" 
--preserve-metadata=identifier,entitlements --requirements 
"$FIRSTPARTOF_REQUIREMENT$IDENTIFIER$SECONDPARTOF_REQUIREMENT" --timestamp=none 
VLC.app/Contents/Frameworks/Growl.framework/Versions/A
 IDENTIFIER="org.andymatuschak.sparkle.Autoupdate"
-codesign --force --verbose -s "$IDENTITY" 
--preserve-metadata=identifier,entitlements,resource-rules --requirements 
"$FIRSTPARTOF_REQUIREMENT$IDENTIFIER$SECONDPARTOF_REQUIREMENT" 
VLC.app/Contents/Frameworks/Sparkle.framework/Resources/Autoupdate.app
+codesign --force --verbose -s "$IDENTITY" 
--preserve-metadata=identifier,entitlements --requirements 
"$FIRSTPARTOF_REQUIREMENT$IDENTIFIER$SECONDPARTOF_REQUIREMENT" --timestamp=none 
VLC.app/Contents/Frameworks/Sparkle.framework/Resources/Autoupdate.app
 IDENTIFIER="org.andymatuschak.Sparkle"
-codesign --force --verbose -s "$IDENTITY" 
--preserve-metadata=identifier,entitlements,resource-rules --requirements 
"$FIRSTPARTOF_REQUIREMENT$IDENTIFIER$SECONDPARTOF_REQUIREMENT" 
VLC.app/Contents/Frameworks/Sparkle.framework/Versions/A
+codesign --force --verbose -s "$IDENTITY" 
--preserve-metadata=identifier,entitlements --requirements 
"$FIRSTPARTOF_REQUIREMENT$IDENTIFIER$SECONDPARTOF_REQUIREMENT" --timestamp=none 
VLC.app/Contents/Frameworks/Sparkle.framework/Versions/A
 
 info "Signing the framework headers"
 for i in `find VLC.app/Contents/Frameworks/* -type f -name "*.h" -exec 
echo {} \;`
@@ -107,7 +107,7 @@ else
 fbname=$(basename "$i")
 filename="${fbname%.*}"
 
-codesign --force -s "$IDENTITY" 
--preserve-metadata=identifier,entitlements,resource-rules --requirements 
"$FIRSTPARTOF_REQUIREMENT$filename$SECONDPARTOF_REQUIREMENT" $i
+codesign --force -s "$IDENTITY" 
--preserve-metadata=identifier,entitlements --requirements 
"$FIRSTPARTOF_REQUIREMENT$filename$SECONDPARTOF_REQUIREMENT" --timestamp=none $i
 done
 
 info "Signing the framework strings"
@@ -116,7 +116,7 @@ else
 fbname=$(basename "$i")
 filename="${fbname%.*}"
 
-codesign --force -s "$IDENTITY" 
--preserve-metadata=identifier,entitlements,resource-rules --requirements 
"$FIRSTPARTOF_REQUIREMENT$filename$SECONDPARTOF_REQUIREMENT" $i
+codesign --force -s "$IDENTITY" 
--preserve-metadata=identifier,entitlements --requirements 
"$FIRSTPARTOF_REQUIREMENT$filename$SECONDPARTOF_REQUIREMENT" --timestamp=none $i
 done
 
 info "Signing the framework plist files"
@@ -125,7 +125,7 @@ else
 fbname=$(basename "$i")
 filename="${fbname%.*}"
 
-codesign --force -s "$IDENTITY" 
--preserve-metadata=identifier,entitlements,resource-rules --requirements 
"$FIRSTPARTOF_REQUIREMENT$filename$SECONDPARTOF_REQUIREMENT" $i
+codesign --force -s "$IDENTITY" 
--preserve-metadata=identifier,entitlements --requirements 
"$FIRSTPARTOF_REQUIREMENT$filename$SECONDPARTOF_REQUIREMENT" --timestamp=none $i
 done
 
 info "Signing the framework nib files"
@@ -134,7 +134,7 @@ else
 fbname=$(basename "$i")
 filename="${fbname%.*}"
 
-codesign --force -s "$IDENTITY" 
--preserve-metadata=identifier,entitlements,resource-rules --requirements 
"$FIRSTPARTOF_REQUIREMENT$filename$SECONDPARTOF_REQUIREMENT" $i
+codesign --force -s "$IDENTITY" 
--preserve-metadata=identifier,entitlements --requirements 
"$FIRSTPARTOF_REQUIREMENT$filename$SECONDPARTOF_REQUIREMENT"