[vlc-commits] vlc_fourcc: add a define for "twos" (Raw Signed PCM big-endian)
Steve Lhomme
git at videolan.org
Wed Jul 12 12:24:01 CEST 2017
vlc | branch: master | Steve Lhomme <robux4 at videolabs.io> | Thu Jul 6 17:07:29 2017 +0200| [cb5820f7001ec304be278fc7e03ba1382ff5f192] | committer: Jean-Baptiste Kempf
vlc_fourcc: add a define for "twos" (Raw Signed PCM big-endian)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=cb5820f7001ec304be278fc7e03ba1382ff5f192
---
include/vlc_fourcc.h | 1 +
modules/codec/araw.c | 2 +-
modules/demux/aiff.c | 2 +-
modules/demux/caf.c | 2 +-
modules/demux/mkv/matroska_segment_parse.cpp | 2 +-
modules/demux/mod.c | 2 +-
modules/demux/mp4/essetup.c | 2 +-
src/misc/fourcc.c | 2 +-
src/misc/fourcc_list.h | 3 +++
9 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/include/vlc_fourcc.h b/include/vlc_fourcc.h
index d2a22fbaa1..965940f348 100644
--- a/include/vlc_fourcc.h
+++ b/include/vlc_fourcc.h
@@ -474,6 +474,7 @@
#define VLC_CODEC_RALF VLC_FOURCC('R','A','L','F')
#define VLC_CODEC_RAW_PCM VLC_FOURCC('a','r','a','w')
+#define VLC_CODEC_RAW_PCM_SIGNED_BE VLC_FOURCC('t','w','o','s')
#define VLC_CODEC_RAW_IEEE_PCM VLC_FOURCC('a','f','l','t')
#define VLC_CODEC_S8 VLC_FOURCC('s','8',' ',' ')
#define VLC_CODEC_U8 VLC_FOURCC('u','8',' ',' ')
diff --git a/modules/codec/araw.c b/modules/codec/araw.c
index f38dbe343d..44728cb585 100644
--- a/modules/codec/araw.c
+++ b/modules/codec/araw.c
@@ -119,7 +119,7 @@ static int DecoderOpen( vlc_object_t *p_this )
case VLC_CODEC_RAW_PCM:
case VLC_CODEC_RAW_IEEE_PCM:
/* _signed_ big endian samples (mov) */
- case VLC_FOURCC('t','w','o','s'):
+ case VLC_CODEC_RAW_PCM_SIGNED_BE:
/* _signed_ little endian samples (mov) */
case VLC_FOURCC('s','o','w','t'):
format =
diff --git a/modules/demux/aiff.c b/modules/demux/aiff.c
index 6413b86d3e..e117ba0a15 100644
--- a/modules/demux/aiff.c
+++ b/modules/demux/aiff.c
@@ -119,7 +119,7 @@ static int Open( vlc_object_t *p_this )
/* Fill p_demux field */
DEMUX_INIT_COMMON(); p_sys = p_demux->p_sys;
- es_format_Init( &p_sys->fmt, AUDIO_ES, VLC_FOURCC( 't', 'w', 'o', 's' ) );
+ es_format_Init( &p_sys->fmt, AUDIO_ES, VLC_CODEC_RAW_PCM_SIGNED_BE );
p_sys->i_time = 0;
p_sys->i_ssnd_pos = -1;
diff --git a/modules/demux/caf.c b/modules/demux/caf.c
index b44e1b625e..1b820c4bb3 100644
--- a/modules/demux/caf.c
+++ b/modules/demux/caf.c
@@ -462,7 +462,7 @@ static int ReadDescChunk( demux_t *p_demux )
if( !b_is_float )
{
- i_basic_codec = b_is_be ? VLC_FOURCC( 't', 'w', 'o', 's' ) : VLC_FOURCC( 's', 'o', 'w', 't' );
+ i_basic_codec = b_is_be ? VLC_CODEC_RAW_PCM_SIGNED_BE : VLC_FOURCC( 's', 'o', 'w', 't' );
es_format_Init( &p_sys->fmt, AUDIO_ES, vlc_fourcc_GetCodecAudio( i_basic_codec, i_unpacked_bits_per_sample ));
}
else
diff --git a/modules/demux/mkv/matroska_segment_parse.cpp b/modules/demux/mkv/matroska_segment_parse.cpp
index a1213c2e89..7addfc6e82 100644
--- a/modules/demux/mkv/matroska_segment_parse.cpp
+++ b/modules/demux/mkv/matroska_segment_parse.cpp
@@ -1726,7 +1726,7 @@ int32_t matroska_segment_c::TrackInit( mkv_track_t * p_tk )
vars.p_fmt->audio.i_blockalign = ( vars.p_fmt->audio.i_bitspersample + 7 ) / 8 * vars.p_fmt->audio.i_channels;
}
- S_CASE("A_PCM/INT/BIG") { A_PCM__helper ( vars, VLC_FOURCC( 't','w','o','s' ) ); }
+ S_CASE("A_PCM/INT/BIG") { A_PCM__helper ( vars, VLC_CODEC_RAW_PCM_SIGNED_BE ); }
S_CASE("A_PCM/INT/LIT") { A_PCM__helper ( vars, VLC_CODEC_RAW_PCM ); }
S_CASE("A_PCM/FLOAT/IEEE") { A_PCM__helper ( vars, VLC_CODEC_RAW_IEEE_PCM ) ;}
S_CASE("A_REAL/14_4") {
diff --git a/modules/demux/mod.c b/modules/demux/mod.c
index 407052c12b..69e00b5d28 100644
--- a/modules/demux/mod.c
+++ b/modules/demux/mod.c
@@ -232,7 +232,7 @@ static int Open( vlc_object_t *p_this )
p_sys->i_length );
#ifdef WORDS_BIGENDIAN
- es_format_Init( &p_sys->fmt, AUDIO_ES, VLC_FOURCC( 't', 'w', 'o', 's' ) );
+ es_format_Init( &p_sys->fmt, AUDIO_ES, VLC_CODEC_RAW_PCM_SIGNED_BE );
#else
es_format_Init( &p_sys->fmt, AUDIO_ES, VLC_CODEC_RAW_PCM );
#endif
diff --git a/modules/demux/mp4/essetup.c b/modules/demux/mp4/essetup.c
index 86d718e779..515ca59c61 100644
--- a/modules/demux/mp4/essetup.c
+++ b/modules/demux/mp4/essetup.c
@@ -970,7 +970,7 @@ int SetupAudioES( demux_t *p_demux, mp4_track_t *p_track, MP4_Box_t *p_sample )
if( (p_soun->i_samplesize+7)/8 == 1 )
p_track->fmt.i_codec = VLC_CODEC_U8;
else
- p_track->fmt.i_codec = VLC_FOURCC( 't', 'w', 'o', 's' );
+ p_track->fmt.i_codec = VLC_CODEC_RAW_PCM_SIGNED_BE;
/* Buggy files workaround */
if( (p_track->i_timescale != p_soun->i_sampleratehi) )
diff --git a/src/misc/fourcc.c b/src/misc/fourcc.c
index 2ffa6c2cd1..838262fc13 100644
--- a/src/misc/fourcc.c
+++ b/src/misc/fourcc.c
@@ -159,7 +159,7 @@ vlc_fourcc_t vlc_fourcc_GetCodecAudio( vlc_fourcc_t i_fourcc, int i_bits )
return 0;
}
}
- else if( i_fourcc == VLC_FOURCC( 't', 'w', 'o', 's' ) )
+ else if( i_fourcc == VLC_CODEC_RAW_PCM_SIGNED_BE )
{
switch( i_bytes )
{
diff --git a/src/misc/fourcc_list.h b/src/misc/fourcc_list.h
index 72d8818640..13f89c9d29 100644
--- a/src/misc/fourcc_list.h
+++ b/src/misc/fourcc_list.h
@@ -1433,6 +1433,9 @@ static const staticentry_t p_list_audio[] = {
B(VLC_CODEC_RAW_PCM, "Raw PCM"),
A("araw"),
+ B(VLC_CODEC_RAW_PCM_SIGNED_BE, "Raw Signed PCM big-endian"),
+ A("twos"),
+
B(VLC_CODEC_RAW_IEEE_PCM, "Raw IEEE Float PCM"),
A("aflt"),
More information about the vlc-commits
mailing list