[vlc-commits] demux: mp4: rename union data pointer.

2014-03-25 Thread Francois Cartegnie
vlc | branch: master | Francois Cartegnie  | Wed Mar 26 
06:40:46 2014 +0100| [c99c90d180073d857e6d44e7765263037ca3f8ba] | committer: 
Francois Cartegnie

demux: mp4: rename union data pointer.

Avoid naming confusion, because data is an atom itself.

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

 modules/demux/mp4/libmp4.c |8 
 modules/demux/mp4/libmp4.h |4 ++--
 modules/demux/mp4/mp4.c|2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index 50f77a6..ab6edc8 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -90,7 +90,7 @@ int MP4_ReadBoxCommon( stream_t *p_stream, MP4_Box_t *p_box )
 }
 p_box->i_pos = stream_Tell( p_stream );
 
-p_box->data.p_data = NULL;
+p_box->data.p_payload = NULL;
 p_box->p_father = NULL;
 p_box->p_first  = NULL;
 p_box->p_last  = NULL;
@@ -3467,7 +3467,7 @@ void MP4_BoxFree( stream_t *s, MP4_Box_t *p_box )
 }
 
 /* Now search function to call */
-if( p_box->data.p_data )
+if( p_box->data.p_payload )
 {
 for( i_index = 0; ; i_index++ )
 {
@@ -3493,7 +3493,7 @@ void MP4_BoxFree( stream_t *s, MP4_Box_t *p_box )
 {
 MP4_Box_Function[i_index].MP4_FreeBox_function( p_box );
 }
-free( p_box->data.p_data );
+free( p_box->data.p_payload );
 }
 free( p_box );
 }
@@ -3591,7 +3591,7 @@ MP4_Box_t *MP4_BoxGetRoot( stream_t *s )
 p_root->i_size = 0;
 CreateUUID( &p_root->i_uuid, p_root->i_type );
 
-p_root->data.p_data = NULL;
+p_root->data.p_payload = NULL;
 p_root->p_father= NULL;
 p_root->p_first = NULL;
 p_root->p_last  = NULL;
diff --git a/modules/demux/mp4/libmp4.h b/modules/demux/mp4/libmp4.h
index 3f539ec..c6c0aaf 100644
--- a/modules/demux/mp4/libmp4.h
+++ b/modules/demux/mp4/libmp4.h
@@ -1250,7 +1250,7 @@ typedef union MP4_Box_data_s
 MP4_Box_data_tfxd_t *p_tfxd;
 MP4_Box_data_hvcC_t *p_hvcC;
 
-void*p_data; /* for unknow type */
+void*p_payload; /* for unknow type */
 } MP4_Box_data_t;
 
 
@@ -1431,7 +1431,7 @@ static inline size_t mp4_box_headersize( MP4_Box_t *p_box 
)
 } \
 p_peek += mp4_box_headersize( p_box ); \
 i_read -= mp4_box_headersize( p_box ); \
-if( !( p_box->data.p_data = calloc( 1, sizeof( MP4_Box_data_TYPE_t ) ) ) ) 
\
+if( !( p_box->data.p_payload = calloc( 1, sizeof( MP4_Box_data_TYPE_t ) ) 
) ) \
 { \
 free( p_buff ); \
 return( 0 ); \
diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index a4184d5..99435b5 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -1656,7 +1656,7 @@ static int TrackCreateES( demux_t *p_demux, mp4_track_t 
*p_track,
 i_sample_description_index - 1 );
 
 if( !p_sample ||
-( !p_sample->data.p_data && p_track->fmt.i_cat != SPU_ES ) )
+( !p_sample->data.p_payload && p_track->fmt.i_cat != SPU_ES ) )
 {
 msg_Warn( p_demux, "cannot find SampleEntry (track[Id 0x%x])",
   p_track->i_track_ID );

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


[vlc-commits] demux: mp4: read covr atoms (fix #8091)

2014-03-25 Thread Francois Cartegnie
vlc | branch: master | Francois Cartegnie  | Wed Mar 26 
07:37:56 2014 +0100| [c9cce4e91f34b96b2cbaa9b39aadb6a65852e674] | committer: 
Francois Cartegnie

demux: mp4: read covr atoms (fix #8091)

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

 modules/demux/mp4/libmp4.c |   25 ++
 modules/demux/mp4/libmp4.h |9 ++
 modules/demux/mp4/mp4.c|   77 +---
 3 files changed, 107 insertions(+), 4 deletions(-)

diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index ab6edc8..52ae9ca 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -2622,6 +2622,29 @@ static void MP4_FreeBox_name( MP4_Box_t *p_box )
 FREENULL( p_box->data.p_name->psz_text );
 }
 
+static int MP4_ReadBox_data( stream_t *p_stream, MP4_Box_t *p_box )
+{
+MP4_READBOX_ENTER( MP4_Box_data_data_t );
+
+/* What's that header ?? */
+if ( i_read <= 8 )
+MP4_READBOX_EXIT( 0 );
+
+p_box->data.p_data->p_blob = malloc( i_read - 8 );
+if ( !p_box->data.p_data->p_blob )
+MP4_READBOX_EXIT( 0 );
+
+p_box->data.p_data->i_blob = i_read - 8;
+memcpy( p_box->data.p_data->p_blob, p_peek + 8, i_read - 8 );
+
+MP4_READBOX_EXIT( 1 );
+}
+
+static void MP4_FreeBox_data( MP4_Box_t *p_box )
+{
+free( p_box->data.p_data->p_blob );
+}
+
 static int MP4_ReadBox_0xa9xxx( stream_t *p_stream, MP4_Box_t *p_box )
 {
 uint16_t i16;
@@ -3380,6 +3403,8 @@ static const struct
 /* iTunes/Quicktime meta info */
 { ATOM_meta,MP4_ReadBox_meta, MP4_FreeBox_Common },
 { ATOM_name,MP4_ReadBox_name, MP4_FreeBox_name },
+{ ATOM_covr,MP4_ReadBoxContainer, MP4_FreeBox_Common },
+{ ATOM_data,MP4_ReadBox_data, MP4_FreeBox_data },
 
 /* found in smoothstreaming */
 { ATOM_traf,MP4_ReadBoxContainer, MP4_FreeBox_Common },
diff --git a/modules/demux/mp4/libmp4.h b/modules/demux/mp4/libmp4.h
index c6c0aaf..aac5e3f 100644
--- a/modules/demux/mp4/libmp4.h
+++ b/modules/demux/mp4/libmp4.h
@@ -261,6 +261,7 @@
 
 #define ATOM_meta VLC_FOURCC( 'm', 'e', 't', 'a' )
 #define ATOM_ilst VLC_FOURCC( 'i', 'l', 's', 't' )
+#define ATOM_covr VLC_FOURCC( 'c', 'o', 'v', 'r' )
 
 #define ATOM_chap VLC_FOURCC( 'c', 'h', 'a', 'p' )
 
@@ -1164,6 +1165,12 @@ typedef struct
 uint8_t *p_hvcC;
 } MP4_Box_data_hvcC_t;
 
+typedef struct
+{
+uint8_t *p_blob;
+uint32_t i_blob;
+} MP4_Box_data_data_t;
+
 /*
 typedef struct MP4_Box_data__s
 {
@@ -1250,6 +1257,8 @@ typedef union MP4_Box_data_s
 MP4_Box_data_tfxd_t *p_tfxd;
 MP4_Box_data_hvcC_t *p_hvcC;
 
+MP4_Box_data_data_t *p_data;
+
 void*p_payload; /* for unknow type */
 } MP4_Box_data_t;
 
diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index 99435b5..c3038f4 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -952,19 +952,89 @@ static int Control( demux_t *p_demux, int i_query, 
va_list args )
 *pf = p_sys->f_fps;
 return VLC_SUCCESS;
 
+case DEMUX_GET_ATTACHMENTS:
+{
+input_attachment_t ***ppp_attach = va_arg( args, 
input_attachment_t*** );
+int *pi_int = va_arg( args, int * );
+
+MP4_Box_t  *p_covr = MP4_BoxGet( p_sys->p_root, 
"/moov/udta/meta/ilst/covr" );
+if ( !p_covr ) return VLC_EGENERIC;
+MP4_Box_t  *p_box;
+int i_count = 0;
+
+for( p_box = p_covr->p_first; p_box != NULL; p_box = p_box->p_next 
)
+{
+if ( p_box->i_type == ATOM_data && p_box->data.p_data->i_blob 
>= 16 )
+i_count++;
+}
+
+if ( i_count == 0 )
+return VLC_EGENERIC;
+
+*ppp_attach = (input_attachment_t**)
+malloc( sizeof(input_attachment_t*) * i_count );
+if( !(*ppp_attach) ) return VLC_ENOMEM;
+char *psz_mime;
+char *psz_filename;
+i_count = 0;
+for( p_box = p_covr->p_first; p_box != NULL; p_box = p_box->p_next 
)
+{
+if ( p_box->i_type != ATOM_data || p_box->data.p_data->i_blob 
< 16 )
+continue;
+
+if ( !memcmp( p_box->data.p_data->p_blob,
+  "\x89\x50\x4E\x47\x0D\x0A\x1A\x0A", 8 ) )
+{
+psz_mime = strdup( "image/png" );
+}
+else if ( !memcmp( p_box->data.p_data->p_blob, "\xFF\xD8", 2 ) 
)
+{
+psz_mime = strdup( "image/jpeg" );
+}
+else
+{
+continue;
+}
+
+if ( asprintf( &psz_filename, "picture%u", i_count ) >= 0 )
+{
+(*ppp_attach)[i_count++] =
+vlc_input_attachment_New( psz_filename,

[vlc-commits] demux: mp4: remove unused dummy fields warnings

2014-03-25 Thread Francois Cartegnie
vlc | branch: master | Francois Cartegnie  | Wed Mar 26 
07:41:11 2014 +0100| [a72b33b062bad7c52f4b5b8dfb8da4d1beeac8d5] | committer: 
Francois Cartegnie

demux: mp4: remove unused dummy fields warnings

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

 modules/demux/mp4/libmp4.c |   11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index 52ae9ca..629d82c 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -503,6 +503,7 @@ static int MP4_ReadBox_stra( stream_t *p_stream, MP4_Box_t 
*p_box )
 MP4_Box_data_stra_t *p_stra = p_box->data.p_stra;
 
 uint8_t i_reserved;
+VLC_UNUSED(i_reserved);
 MP4_GET1BYTE( p_stra->i_es_cat );
 MP4_GET1BYTE( i_reserved );
 MP4_GET2BYTES( p_stra->i_track_ID );
@@ -595,6 +596,7 @@ static int MP4_ReadBox_sidx(  stream_t *p_stream, MP4_Box_t 
*p_box )
 }
 
 uint16_t i_reserved;
+VLC_UNUSED(i_reserved);
 MP4_GET2BYTES( i_reserved );
 MP4_GET2BYTES( p_sidx_data->i_reference_count );
 uint16_t i_count = p_sidx_data->i_reference_count;
@@ -907,6 +909,7 @@ static int MP4_ReadBox_mdhd( stream_t *p_stream, MP4_Box_t 
*p_box )
 static int MP4_ReadBox_hdlr( stream_t *p_stream, MP4_Box_t *p_box )
 {
 int32_t i_reserved;
+VLC_UNUSED(i_reserved);
 
 MP4_READBOX_ENTER( MP4_Box_data_hdlr_t );
 
@@ -1532,7 +1535,9 @@ static int MP4_ReadBox_gnre( stream_t *p_stream, 
MP4_Box_t *p_box )
 MP4_READBOX_EXIT( 0 );
 
 uint32_t i_version;
+VLC_UNUSED(i_version);
 uint32_t i_reserved;
+VLC_UNUSED(i_reserved);
 MP4_GET4BYTES( i_version );
 MP4_GET4BYTES( i_reserved );
 MP4_GET2BYTES( p_gnre->i_genre );
@@ -1561,7 +1566,9 @@ static int MP4_ReadBox_trkn( stream_t *p_stream, 
MP4_Box_t *p_box )
 MP4_READBOX_EXIT( 0 );
 
 uint32_t i_version;
+VLC_UNUSED(i_version);
 uint32_t i_reserved;
+VLC_UNUSED(i_reserved);
 MP4_GET4BYTES( i_version );
 MP4_GET4BYTES( i_reserved );
 MP4_GET2BYTES( i_reserved );
@@ -1580,7 +1587,6 @@ static int MP4_ReadBox_trkn( stream_t *p_stream, 
MP4_Box_t *p_box )
 MP4_READBOX_EXIT( 1 );
 }
 
-
 static int MP4_ReadBox_sample_soun( stream_t *p_stream, MP4_Box_t *p_box )
 {
 MP4_READBOX_ENTER( MP4_Box_data_sample_soun_t );
@@ -2694,6 +2700,7 @@ static int MP4_ReadBox_0xa9xxx( stream_t *p_stream, 
MP4_Box_t *p_box )
 /* data box contains a version/flags field */
 uint32_t i_version;
 uint32_t i_reserved;
+VLC_UNUSED(i_reserved);
 MP4_GET4BYTES( i_version );
 MP4_GET4BYTES( i_reserved );
 // version should be 0, flags should be 1 for text, 0 for data
@@ -2741,6 +2748,7 @@ static int MP4_ReadBox_chpl( stream_t *p_stream, 
MP4_Box_t *p_box )
 {
 MP4_Box_data_chpl_t *p_chpl;
 uint32_t i_dummy;
+VLC_UNUSED(i_dummy);
 int i;
 MP4_READBOX_ENTER( MP4_Box_data_chpl_t );
 
@@ -2851,6 +2859,7 @@ static int MP4_ReadBox_meta( stream_t *p_stream, 
MP4_Box_t *p_box )
 static int MP4_ReadBox_iods( stream_t *p_stream, MP4_Box_t *p_box )
 {
 char i_unused;
+VLC_UNUSED(i_unused);
 
 MP4_READBOX_ENTER( MP4_Box_data_iods_t );
 MP4_GETVERSIONFLAGS( p_box->data.p_iods );

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


[vlc-commits] codec: substext: process asprintf returnval

2014-03-25 Thread Francois Cartegnie
vlc | branch: master | Francois Cartegnie  | Wed Mar 26 
05:45:20 2014 +0100| [b8f8588eadf17dcb5499b5ff95d5e0d5c53d2775] | committer: 
Francois Cartegnie

codec: substext: process asprintf returnval

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

 modules/codec/substext.h |   25 +
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git a/modules/codec/substext.h b/modules/codec/substext.h
index 05129e3..73c33e9 100644
--- a/modules/codec/substext.h
+++ b/modules/codec/substext.h
@@ -89,7 +89,7 @@ static void HtmlAppend( char **ppsz_dst, const char *psz_src,
 const segment_style_t *p_styles, const float f_scale )
 {
 if ( !ppsz_dst ) return;
-int i_ignore; VLC_UNUSED(i_ignore);
+int i_return;
 char *psz_subtext = NULL;
 char *psz_text = NULL;
 char *psz_fontsize = NULL;
@@ -100,14 +100,20 @@ static void HtmlAppend( char **ppsz_dst, const char 
*psz_src,
 MakeHtmlNewLines( &psz_encoded );
 
 if ( p_styles->i_color & 0xFF00 ) //ARGB
-i_ignore = asprintf( &psz_color, " color=\"#%6x\"",
+{
+i_return = asprintf( &psz_color, " color=\"#%6x\"",
  p_styles->i_color & 0x00FF );
+if ( i_return < 0 ) psz_color = NULL;
+}
 
 if ( p_styles->i_fontsize > 0 && f_scale > 0 )
-i_ignore = asprintf( &psz_fontsize, " size=\"%u\"",
+{
+i_return = asprintf( &psz_fontsize, " size=\"%u\"",
  (unsigned) (f_scale * p_styles->i_fontsize) );
+if ( i_return < 0 ) psz_fontsize = NULL;
+}
 
-i_ignore = asprintf( &psz_subtext, "%s%s%s%s%s%s%s",
+i_return = asprintf( &psz_subtext, "%s%s%s%s%s%s%s",
 ( p_styles->i_flags & STYLE_UNDERLINE ) ? "" : "",
 ( p_styles->i_flags & STYLE_BOLD ) ? "" : "",
 ( p_styles->i_flags & STYLE_ITALIC ) ? "" : "",
@@ -116,13 +122,15 @@ static void HtmlAppend( char **ppsz_dst, const char 
*psz_src,
 ( p_styles->i_flags & STYLE_BOLD ) ? "" : "",
 ( p_styles->i_flags & STYLE_UNDERLINE ) ? "" : ""
 );
+if ( i_return < 0 ) psz_subtext = NULL;
 
 if ( psz_color || psz_fontsize )
 {
-i_ignore = asprintf( &psz_text, "%s",
+i_return = asprintf( &psz_text, "%s",
 psz_color ? psz_color : "",
 psz_fontsize ? psz_fontsize : "",
 psz_subtext );
+if ( i_return < 0 ) psz_text = NULL;
 free( psz_subtext );
 }
 else
@@ -136,7 +144,8 @@ static void HtmlAppend( char **ppsz_dst, const char 
*psz_src,
 if ( *ppsz_dst )
 {
 char *psz_dst = *ppsz_dst;
-i_ignore = asprintf( ppsz_dst, "%s%s", psz_dst, psz_text );
+i_return = asprintf( ppsz_dst, "%s%s", psz_dst, psz_text );
+if ( i_return < 0 ) ppsz_dst = NULL;
 free( psz_dst );
 free( psz_text );
 }
@@ -153,8 +162,8 @@ static char *SegmentsToHtml( segment_t *p_head, const float 
f_scale )
 HtmlAppend( &psz_dst, p_head->psz_string, &p_head->styles, f_scale );
 p_head = p_head->p_next;
 }
-int i_ignore = asprintf( &psz_ret, "%s", psz_dst );
-VLC_UNUSED( i_ignore );
+int i_ret = asprintf( &psz_ret, "%s", psz_dst );
+if ( i_ret < 0 ) psz_ret = NULL;
 free( psz_dst );
 return psz_ret;
 }

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


[vlc-commits] macosx: do not handle triple clicks explicitely

2014-03-25 Thread David Fuhrmann
vlc/vlc-2.1 | branch: master | David Fuhrmann  | 
Tue Mar 25 19:05:23 2014 +0100| [2b2d05640628d4ee5a70c1b0259e9d4aa25e774c] | 
committer: David Fuhrmann

macosx: do not handle triple clicks explicitely

refs #11061

(cherry picked from commit c877b353969c78b7e98b71a8e5cdf0013ec03826)
Signed-off-by: David Fuhrmann 

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

 modules/gui/macosx/VideoView.m |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/gui/macosx/VideoView.m b/modules/gui/macosx/VideoView.m
index 6e2ebbe..c368a20 100644
--- a/modules/gui/macosx/VideoView.m
+++ b/modules/gui/macosx/VideoView.m
@@ -153,8 +153,9 @@
 - (void)mouseDown:(NSEvent *)o_event
 {
 if (([o_event type] == NSLeftMouseDown) && (! ([o_event modifierFlags] &  
NSControlKeyMask))) {
-if ([o_event clickCount] > 1)
+if ([o_event clickCount] == 2)
 [[VLCCoreInteraction sharedInstance] toggleFullscreen];
+
 } else if (([o_event type] == NSRightMouseDown) ||
(([o_event type] == NSLeftMouseDown) &&
([o_event modifierFlags] &  NSControlKeyMask)))

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


[vlc-commits] macosx: do not handle triple clicks explicitely

2014-03-25 Thread David Fuhrmann
vlc | branch: master | David Fuhrmann  | Tue Mar 
25 19:05:23 2014 +0100| [c877b353969c78b7e98b71a8e5cdf0013ec03826] | committer: 
David Fuhrmann

macosx: do not handle triple clicks explicitely

refs #11061

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

 modules/gui/macosx/VideoView.m |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/gui/macosx/VideoView.m b/modules/gui/macosx/VideoView.m
index ca961e3..c02e449 100644
--- a/modules/gui/macosx/VideoView.m
+++ b/modules/gui/macosx/VideoView.m
@@ -151,8 +151,9 @@
 - (void)mouseDown:(NSEvent *)o_event
 {
 if (([o_event type] == NSLeftMouseDown) && (! ([o_event modifierFlags] &  
NSControlKeyMask))) {
-if ([o_event clickCount] > 1)
+if ([o_event clickCount] == 2)
 [[VLCCoreInteraction sharedInstance] toggleFullscreen];
+
 } else if (([o_event type] == NSRightMouseDown) ||
(([o_event type] == NSLeftMouseDown) &&
([o_event modifierFlags] &  NSControlKeyMask)))

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


[vlc-commits] macosx: already set fullscreen to no when fullscreen exit animation is started

2014-03-25 Thread David Fuhrmann
vlc | branch: master | David Fuhrmann  | Tue Mar 
25 18:40:48 2014 +0100| [8a8767fed1ca22a7ec57e69da7cea79dae6f3a11] | committer: 
David Fuhrmann

macosx: already set fullscreen to no when fullscreen exit animation is started

close #11061

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

 modules/gui/macosx/Windows.m |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/gui/macosx/Windows.m b/modules/gui/macosx/Windows.m
index 9267c5b..3666da4 100644
--- a/modules/gui/macosx/Windows.m
+++ b/modules/gui/macosx/Windows.m
@@ -1074,6 +1074,7 @@
 }
 
 b_in_fullscreen_transition = YES;
+[self setFullscreen:NO];
 
 [self setAlphaValue: 0.0];
 [self orderFront: self];
@@ -1119,7 +1120,6 @@
 
 - (void)hasEndedFullscreen
 {
-[self setFullscreen:NO];
 b_in_fullscreen_transition = NO;
 
 /* This function is private and should be only triggered at the end of the 
fullscreen change animation */

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


[vlc-commits] Contribs: update libass to 0.11.1

2014-03-25 Thread Tristan Matthews
vlc | branch: master | Tristan Matthews  | Tue Mar 25 
14:05:29 2014 -0400| [cf3eec8b6f0dc796f1b85a1c1710f95e485ba59c] | committer: 
Tristan Matthews

Contribs: update libass to 0.11.1

libass is now hosted on github

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

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

diff --git a/contrib/src/ass/SHA512SUMS b/contrib/src/ass/SHA512SUMS
index b7e578b..8d589d9 100644
--- a/contrib/src/ass/SHA512SUMS
+++ b/contrib/src/ass/SHA512SUMS
@@ -1 +1 @@
-450141f5de5125696edbd44019e5eccb8b34f6173692c50abbc3b82b565221d4454760489469542dc4e2a51c7f952b4a565f2e9468b3fa8550a62e2eb1836b77
  libass-0.10.2.tar.gz
+e40dc0bdc7a12d4515122026dba7cb8b98b9a114eb23a9c36444a8d7bc1b6ec3d8876e113238a5ba5acd39faec5d302d191a14de59478ab4c1c66be58ffa3654
  libass-0.11.1.tar.gz
diff --git a/contrib/src/ass/rules.mak b/contrib/src/ass/rules.mak
index 507064a..e9f30df 100644
--- a/contrib/src/ass/rules.mak
+++ b/contrib/src/ass/rules.mak
@@ -1,6 +1,6 @@
 # ASS
-ASS_VERSION := 0.10.2
-ASS_URL := http://libass.googlecode.com/files/libass-$(ASS_VERSION).tar.gz
+ASS_VERSION := 0.11.1
+ASS_URL := 
https://github.com/libass/libass/releases/download/$(ASS_VERSION)/libass-$(ASS_VERSION).tar.gz
 
 PKGS += ass
 ifeq ($(call need_pkg,"libass"),)

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


[vlc-commits] demux: asf: only apply valid A/R

2014-03-25 Thread Francois Cartegnie
vlc | branch: master | Francois Cartegnie  | Tue Mar 25 
16:37:36 2014 +0100| [11662eb81928c230871746131ef4dd04315514ad] | committer: 
Francois Cartegnie

demux: asf: only apply valid A/R

refs #11063

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

 modules/demux/asf/asf.c |   18 +++---
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/modules/demux/asf/asf.c b/modules/demux/asf/asf.c
index 62795f6..6b339f0 100644
--- a/modules/demux/asf/asf.c
+++ b/modules/demux/asf/asf.c
@@ -658,15 +658,19 @@ static void ParsePayloadExtensions(demux_t *p_demux, 
asf_track_t *tk,
 uint8_t i_ratio_y = *(p_data + 1);
 if ( tk->p_fmt->video.i_sar_num != i_ratio_x || 
tk->p_fmt->video.i_sar_den != i_ratio_y )
 {
-vout_thread_t *p_vout = input_GetVout( p_demux->p_input );
-if ( p_vout )
+/* Only apply if origin pixel size >= 1x1, due to broken 
yacast */
+if ( tk->p_fmt->video.i_height * i_ratio_x > 
tk->p_fmt->video.i_width * i_ratio_y )
 {
-msg_Info( p_demux, "Changing aspect ratio to %i/%i", 
i_ratio_x, i_ratio_y );
-tk->p_fmt->video.i_sar_num = i_ratio_x;
-tk->p_fmt->video.i_sar_den = i_ratio_y;
-vout_ChangeAspectRatio( p_vout, i_ratio_x, i_ratio_y );
-vlc_object_release( p_vout );
+vout_thread_t *p_vout = input_GetVout( p_demux->p_input );
+if ( p_vout )
+{
+msg_Info( p_demux, "Changing aspect ratio to %i/%i", 
i_ratio_x, i_ratio_y );
+vout_ChangeAspectRatio( p_vout, i_ratio_x, i_ratio_y );
+vlc_object_release( p_vout );
+}
 }
+tk->p_fmt->video.i_sar_num = i_ratio_x;
+tk->p_fmt->video.i_sar_den = i_ratio_y;
 }
 }
 i_length -= i_payload_extensions_size;

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


[vlc-commits] codec: add tx3g spu

2014-03-25 Thread Francois Cartegnie
vlc | branch: master | Francois Cartegnie  | Fri Mar 21 
19:47:11 2014 +0100| [6a63bcae635b35ae291a47e45a1d5ca75e079075] | committer: 
Francois Cartegnie

codec: add tx3g spu

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

 NEWS  |1 +
 include/vlc_fourcc.h  |1 +
 modules/MODULES_LIST  |1 +
 modules/codec/Makefile.am |2 +
 modules/codec/substext.h  |  192 -
 modules/codec/substx3g.c  |  346 +
 po/POTFILES.in|1 +
 7 files changed, 538 insertions(+), 6 deletions(-)

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


[vlc-commits] es_format: allow codecs to override spu styles

2014-03-25 Thread Francois Cartegnie
vlc | branch: master | Francois Cartegnie  | Fri Mar 21 
07:51:29 2014 +0100| [39401931218b00bc2a24794c4543fc286adffa62] | committer: 
Francois Cartegnie

es_format: allow codecs to override spu styles

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

 include/vlc_es.h |3 +++
 src/misc/es_format.c |3 +++
 2 files changed, 6 insertions(+)

diff --git a/include/vlc_es.h b/include/vlc_es.h
index d7f2d94..b7cc4a9 100644
--- a/include/vlc_es.h
+++ b/include/vlc_es.h
@@ -25,6 +25,7 @@
 #define VLC_ES_H 1
 
 #include 
+#include 
 
 /**
  * \file
@@ -356,6 +357,8 @@ struct subs_format_t
 int i_magazine;
 int i_page;
 } teletext;
+
+text_style_t *p_style; /* Default styles to use */
 };
 
 /**
diff --git a/src/misc/es_format.c b/src/misc/es_format.c
index 9028847..0b948cf 100644
--- a/src/misc/es_format.c
+++ b/src/misc/es_format.c
@@ -475,6 +475,7 @@ int es_format_Copy( es_format_t *dst, const es_format_t 
*src )
 }
 
 dst->subs.psz_encoding = dst->subs.psz_encoding ? strdup( 
src->subs.psz_encoding ) : NULL;
+dst->subs.p_style = src->subs.p_style ? text_style_Duplicate( 
src->subs.p_style ) : NULL;
 
 if( src->video.p_palette )
 {
@@ -523,6 +524,8 @@ void es_format_Clean( es_format_t *fmt )
 free( fmt->video.p_palette );
 free( fmt->subs.psz_encoding );
 
+if ( fmt->subs.p_style ) text_style_Delete( fmt->subs.p_style );
+
 if( fmt->i_extra_languages > 0 && fmt->p_extra_languages )
 {
 int i;

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


[vlc-commits] text_style/renderer: unify default font size

2014-03-25 Thread Francois Cartegnie
vlc | branch: master | Francois Cartegnie  | Fri Mar 21 
19:33:39 2014 +0100| [2a60d695e5682f60fd0627df6c88abafd818f4b2] | committer: 
Francois Cartegnie

text_style/renderer: unify default font size

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

 include/vlc_text_style.h  |2 ++
 modules/text_renderer/text_renderer.c |4 ++--
 src/misc/text_style.c |2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/include/vlc_text_style.h b/include/vlc_text_style.h
index 722387a..7398dd4 100644
--- a/include/vlc_text_style.h
+++ b/include/vlc_text_style.h
@@ -77,6 +77,8 @@ typedef struct
 #define STYLE_UNDERLINE   32
 #define STYLE_STRIKEOUT   64
 
+#define STYLE_DEFAULT_FONT_SIZE 22
+
 /**
  * Create a default text style
  */
diff --git a/modules/text_renderer/text_renderer.c 
b/modules/text_renderer/text_renderer.c
index d272621..3648581 100644
--- a/modules/text_renderer/text_renderer.c
+++ b/modules/text_renderer/text_renderer.c
@@ -325,7 +325,7 @@ int HandleFontAttributes( xml_reader_t *p_xml_reader,
 uint32_t   i_font_color = 0xff;
 inti_font_alpha = 255;
 uint32_t   i_karaoke_bg_color = 0x00ff;
-inti_font_size  = 24;
+inti_font_size  = STYLE_DEFAULT_FONT_SIZE;
 
 /* Default all attributes to the top font in the stack -- in case not
  * all attributes are specified in the sub-font
@@ -411,7 +411,7 @@ int HandleTT(font_stack_t **p_fonts, const char 
*p_fontfamily )
 char  *psz_unused_fontname = NULL;
 uint32_t   i_font_color = 0xff;
 uint32_t   i_karaoke_bg_color = 0x00ff;
-inti_font_size  = 24;
+inti_font_size  = STYLE_DEFAULT_FONT_SIZE;
 
 /* Default all attributes to the top font in the stack -- in case not
  * all attributes are specified in the sub-font
diff --git a/src/misc/text_style.c b/src/misc/text_style.c
index 2763a25..a779814 100644
--- a/src/misc/text_style.c
+++ b/src/misc/text_style.c
@@ -38,7 +38,7 @@ text_style_t *text_style_New( void )
 /* initialize to default text style */
 p_style->psz_fontname = NULL;
 p_style->psz_monofontname = NULL;
-p_style->i_font_size = 22;
+p_style->i_font_size = STYLE_DEFAULT_FONT_SIZE;
 p_style->i_font_color = 0xff;
 p_style->i_font_alpha = 0xff;
 p_style->i_style_flags = STYLE_OUTLINE;

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


[vlc-commits] demux: mp4: add support for tx3g (fix #8305)

2014-03-25 Thread Francois Cartegnie
vlc | branch: master | Francois Cartegnie  | Fri Mar 21 
19:56:48 2014 +0100| [fd569c883b602a5ae6da3fffed98751fb0fba26f] | committer: 
Francois Cartegnie

demux: mp4: add support for tx3g (fix #8305)

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

 NEWS   |1 +
 modules/demux/mp4/libmp4.c |   13 +-
 modules/demux/mp4/libmp4.h |7 +
 modules/demux/mp4/mp4.c|   61 ++--
 4 files changed, 51 insertions(+), 31 deletions(-)

diff --git a/NEWS b/NEWS
index cb3ad9e..4fce4e6 100644
--- a/NEWS
+++ b/NEWS
@@ -49,6 +49,7 @@ Demuxer:
  * Fix encoding issues in some XML playlist formats
  * Support THP Wii/Gamecube, RenderWare and Escape Replay game video files
  * New HEVC raw packetizer and demuxer
+ * Handle MOV/MP4 tx3g styled subtitles through codec
 
 Muxers:
  * Important rework of the Ogg muxer, notably for skeleton
diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index 1357f44..50f77a6 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -1842,7 +1842,7 @@ static int MP4_ReadBox_sample_text( stream_t *p_stream, 
MP4_Box_t *p_box )
 MP4_GET2BYTES( p_box->data.p_sample_text->i_background_color[0] );
 MP4_GET2BYTES( p_box->data.p_sample_text->i_background_color[1] );
 MP4_GET2BYTES( p_box->data.p_sample_text->i_background_color[2] );
-p_box->data.p_sample_text->i_background_color[3] = 0;
+p_box->data.p_sample_text->i_background_color[3] = 0xFF;
 
 MP4_GET2BYTES( p_box->data.p_sample_text->i_text_box_top );
 MP4_GET2BYTES( p_box->data.p_sample_text->i_text_box_left );
@@ -1879,6 +1879,13 @@ static int MP4_ReadBox_sample_tx3g( stream_t *p_stream, 
MP4_Box_t *p_box )
 MP4_GET2BYTES( p_box->data.p_sample_text->i_text_box_bottom );
 MP4_GET2BYTES( p_box->data.p_sample_text->i_text_box_right );
 
+MP4_GET4BYTES( p_box->data.p_sample_text->i_reserved3 );
+
+MP4_GET2BYTES( p_box->data.p_sample_text->i_font_id );
+MP4_GET1BYTE ( p_box->data.p_sample_text->i_font_face );
+MP4_GET1BYTE ( p_box->data.p_sample_text->i_font_size );
+MP4_GET4BYTES( p_box->data.p_sample_text->i_font_color );
+
 #ifdef MP4_VERBOSE
 msg_Dbg( p_stream, "read box: \"tx3g\" in stsd text" );
 #endif
@@ -3218,6 +3225,10 @@ static const struct
 { ATOM_free,MP4_ReadBoxSkip,  MP4_FreeBox_Common },
 { ATOM_wide,MP4_ReadBoxSkip,  MP4_FreeBox_Common },
 
+/* Subtitles */
+{ ATOM_tx3g,MP4_ReadBox_sample_tx3g,  MP4_FreeBox_Common },
+//{ ATOM_text,MP4_ReadBox_sample_text,  MP4_FreeBox_Common },
+
 /* for codecs */
 { ATOM_soun,MP4_ReadBox_sample_soun,  MP4_FreeBox_sample_soun },
 { ATOM_ms02,MP4_ReadBox_sample_soun,  MP4_FreeBox_sample_soun },
diff --git a/modules/demux/mp4/libmp4.h b/modules/demux/mp4/libmp4.h
index c430f22..3f539ec 100644
--- a/modules/demux/mp4/libmp4.h
+++ b/modules/demux/mp4/libmp4.h
@@ -580,6 +580,13 @@ typedef struct
 uint16_t i_text_box_bottom;
 uint16_t i_text_box_right;
 
+uint32_t i_reserved3;
+
+uint16_t i_font_id;
+uint8_t  i_font_face;
+uint8_t  i_font_size;
+uint32_t i_font_color; //RGBA
+
 // TODO to complete
 } MP4_Box_data_sample_text_t;
 
diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index 45ee4cd..a4184d5 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -756,36 +756,12 @@ static int Demux( demux_t *p_demux )
 MP4_TrackUnselect( p_demux, tk );
 break;
 }
-
 else if( tk->fmt.i_cat == SPU_ES )
 {
-if( tk->fmt.i_codec == VLC_CODEC_SUBT &&
-p_block->i_buffer >= 2 )
-{
-size_t i_size = GetWBE( p_block->p_buffer );
-
-if( i_size + 2 <= p_block->i_buffer )
-{
-char *p;
-/* remove the length field, and append a '\0' */
-memmove( &p_block->p_buffer[0],
- &p_block->p_buffer[2], i_size );
-p_block->p_buffer[i_size] = '\0';
-p_block->i_buffer = i_size + 1;
-
-/* convert \r -> \n */
-while( ( p = strchr((char *) p_block->p_buffer, 
'\r' ) ) )
-{
-*p = '\n';
-}
-}
-else
-{
-/* Invalid */
-p_block->i_buffer = 0;
-}
-}
+if ( tk->fmt.i_codec != VLC_CODEC_TX3G )
+p_block->i_buffer = 0;
 }
+

[vlc-commits] lpcm bd: fix 24 bit stereo decoding

2014-03-25 Thread Tristan Matthews
vlc | branch: master | Tristan Matthews  | Tue Mar 25 
01:14:21 2014 -0400| [84d7b2761dd9a033e0f0df7e6a3943e6e53990d7] | committer: 
Tristan Matthews

lpcm bd: fix 24 bit stereo decoding

Fixes #10265

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

 modules/codec/lpcm.c |   10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/modules/codec/lpcm.c b/modules/codec/lpcm.c
index eb9793f..24c8555 100644
--- a/modules/codec/lpcm.c
+++ b/modules/codec/lpcm.c
@@ -1117,10 +1117,12 @@ static void BdExtract( block_t *p_aout_buffer, block_t 
*p_block,
 if (i_bits == 16) {
 swab( p_src, p_dst, (i_channels + i_channels_padding) * i_bits 
/ 8 );
 } else {
-p_dst[0] = 0;
-p_dst[1] = p_src[2];
-p_dst[2] = p_src[1];
-p_dst[3] = p_src[0];
+for (unsigned i = 0; i < i_channels; ++i) {
+p_dst[i * 4] = 0;
+p_dst[1 + (i * 4)] = p_src[2 + (i * 3)];
+p_dst[2 + (i * 4)] = p_src[1 + (i * 3)];
+p_dst[3 + (i * 4)] = p_src[i * 3];
+}
 }
 #endif
 p_src += (i_channels + i_channels_padding) * i_bits / 8;

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