[vlc-commits] Support parsing IAS* in AVI
Jean-Baptiste Kempf
git at videolan.org
Mon Sep 8 20:44:59 CEST 2014
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sat Sep 6 03:55:45 2014 +0200| [9ef8db17fda567a43d6e8febd5cd0f6ec79757a0] | committer: Felix Paul Kühne
Support parsing IAS* in AVI
Signed-off-by: Felix Paul Kühne <fkuehne at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9ef8db17fda567a43d6e8febd5cd0f6ec79757a0
---
modules/demux/avi/avi.c | 11 ++++++++++-
modules/demux/avi/libavi.c | 20 ++++++++++++++++++++
modules/demux/avi/libavi.h | 9 +++++++++
3 files changed, 39 insertions(+), 1 deletion(-)
diff --git a/modules/demux/avi/avi.c b/modules/demux/avi/avi.c
index 2b5b9a1..3c213e7 100644
--- a/modules/demux/avi/avi.c
+++ b/modules/demux/avi/avi.c
@@ -407,7 +407,7 @@ static int Open( vlc_object_t * p_this )
tk->i_scale = p_strh->i_scale;
tk->i_samplesize = p_strh->i_samplesize;
msg_Dbg( p_demux, "stream[%d] rate:%d scale:%d samplesize:%d",
- i, tk->i_rate, tk->i_scale, tk->i_samplesize );
+ i, tk->i_rate, tk->i_scale, tk->i_samplesize );
switch( p_strh->i_type )
{
@@ -454,6 +454,15 @@ static int Open( vlc_object_t * p_this )
fmt.audio.i_bitspersample = p_auds->p_wf->wBitsPerSample;
fmt.b_packetized = !tk->i_blocksize;
+ avi_chunk_list_t *p_info = AVI_ChunkFind( p_riff, AVIFOURCC_INFO, 0 );
+ if( p_info )
+ {
+ int i_chunk = AVIFOURCC_IAS1 + ((i - 1) << 24);
+ avi_chunk_STRING_t *p_lang = AVI_ChunkFind( p_info, i_chunk, 0 );
+ if( p_lang != NULL )
+ fmt.psz_language = FromACP( p_lang->p_str );
+ }
+
msg_Dbg( p_demux,
"stream[%d] audio(0x%x - %s) %d channels %dHz %dbits",
i, p_auds->p_wf->wFormatTag,vlc_fourcc_GetDescription(AUDIO_ES,tk->i_codec),
diff --git a/modules/demux/avi/libavi.c b/modules/demux/avi/libavi.c
index 075d7d9..79cd34b 100644
--- a/modules/demux/avi/libavi.c
+++ b/modules/demux/avi/libavi.c
@@ -762,8 +762,19 @@ static const struct
{ AVIFOURCC_ISTR, "Starring" },
{ AVIFOURCC_IFRM, "Total number of parts" },
{ AVIFOURCC_strn, "Stream name" },
+ { AVIFOURCC_IAS1, "First Language" },
+ { AVIFOURCC_IAS2, "Second Language" },
+ { AVIFOURCC_IAS3, "Third Language" },
+ { AVIFOURCC_IAS4, "Fourth Language" },
+ { AVIFOURCC_IAS5, "Fifth Language" },
+ { AVIFOURCC_IAS6, "Sixth Language" },
+ { AVIFOURCC_IAS7, "Seventh Language" },
+ { AVIFOURCC_IAS8, "Eighth Language" },
+ { AVIFOURCC_IAS9, "Ninth Language" },
+
{ 0, "???" }
};
+
static int AVI_ChunkRead_strz( stream_t *s, avi_chunk_t *p_chk )
{
int i_index;
@@ -872,6 +883,15 @@ static const struct
{ AVIFOURCC_ICNT, AVI_ChunkRead_strz, AVI_ChunkFree_strz },
{ AVIFOURCC_ISTR, AVI_ChunkRead_strz, AVI_ChunkFree_strz },
{ AVIFOURCC_IFRM, AVI_ChunkRead_strz, AVI_ChunkFree_strz },
+ { AVIFOURCC_IAS1, AVI_ChunkRead_strz, AVI_ChunkFree_strz },
+ { AVIFOURCC_IAS2, AVI_ChunkRead_strz, AVI_ChunkFree_strz },
+ { AVIFOURCC_IAS3, AVI_ChunkRead_strz, AVI_ChunkFree_strz },
+ { AVIFOURCC_IAS4, AVI_ChunkRead_strz, AVI_ChunkFree_strz },
+ { AVIFOURCC_IAS5, AVI_ChunkRead_strz, AVI_ChunkFree_strz },
+ { AVIFOURCC_IAS6, AVI_ChunkRead_strz, AVI_ChunkFree_strz },
+ { AVIFOURCC_IAS7, AVI_ChunkRead_strz, AVI_ChunkFree_strz },
+ { AVIFOURCC_IAS8, AVI_ChunkRead_strz, AVI_ChunkFree_strz },
+ { AVIFOURCC_IAS9, AVI_ChunkRead_strz, AVI_ChunkFree_strz },
{ AVIFOURCC_strn, AVI_ChunkRead_strz, AVI_ChunkFree_strz },
diff --git a/modules/demux/avi/libavi.h b/modules/demux/avi/libavi.h
index d3684fd..988066b 100644
--- a/modules/demux/avi/libavi.h
+++ b/modules/demux/avi/libavi.h
@@ -344,6 +344,15 @@ int AVI_ChunkFetchIndexes( stream_t *, avi_chunk_t *p_riff );
#define AVIFOURCC_ISTR VLC_FOURCC('I','S','T','R')
#define AVIFOURCC_IFRM VLC_FOURCC('I','F','R','M')
+#define AVIFOURCC_IAS1 VLC_FOURCC('I','A','S','1')
+#define AVIFOURCC_IAS2 VLC_FOURCC('I','A','S','2')
+#define AVIFOURCC_IAS3 VLC_FOURCC('I','A','S','3')
+#define AVIFOURCC_IAS4 VLC_FOURCC('I','A','S','4')
+#define AVIFOURCC_IAS5 VLC_FOURCC('I','A','S','5')
+#define AVIFOURCC_IAS6 VLC_FOURCC('I','A','S','6')
+#define AVIFOURCC_IAS7 VLC_FOURCC('I','A','S','7')
+#define AVIFOURCC_IAS8 VLC_FOURCC('I','A','S','8')
+#define AVIFOURCC_IAS9 VLC_FOURCC('I','A','S','9')
#define AVITWOCC_wb VLC_TWOCC('w','b')
#define AVITWOCC_db VLC_TWOCC('d','b')
More information about the vlc-commits
mailing list