Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
df7648f0
Commit
df7648f0
authored
Jul 05, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed ALAC. (close #633)
parent
4d763911
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
38 deletions
+50
-38
modules/codec/avcodec/audio.c
modules/codec/avcodec/audio.c
+40
-13
modules/demux/mp4/libmp4.c
modules/demux/mp4/libmp4.c
+10
-25
No files found.
modules/codec/avcodec/audio.c
View file @
df7648f0
...
...
@@ -127,29 +127,56 @@ int InitAudioDec( decoder_t *p_dec, AVCodecContext *p_context,
p_sys
->
p_context
->
bit_rate
=
p_dec
->
fmt_in
.
i_bitrate
;
p_sys
->
p_context
->
bits_per_sample
=
p_dec
->
fmt_in
.
audio
.
i_bitspersample
;
if
(
(
p_sys
->
p_context
->
extradata_size
=
p_dec
->
fmt_in
.
i_extra
)
>
0
)
if
(
p_dec
->
fmt_in
.
i_extra
>
0
)
{
int
i_offset
=
0
;
const
uint8_t
*
const
p_src
=
p_dec
->
fmt_in
.
p_extra
;
int
i_offset
;
int
i_size
;
if
(
p_dec
->
fmt_in
.
i_codec
==
VLC_FOURCC
(
'f'
,
'l'
,
'a'
,
'c'
)
)
{
i_offset
=
8
;
i_size
=
p_dec
->
fmt_in
.
i_extra
-
8
;
}
else
if
(
p_dec
->
fmt_in
.
i_codec
==
VLC_FOURCC
(
'a'
,
'l'
,
'a'
,
'c'
)
)
{
static
const
uint8_t
p_pattern
[]
=
{
0
,
0
,
0
,
36
,
'a'
,
'l'
,
'a'
,
'c'
};
/* Find alac atom XXX it is a bit ugly */
for
(
i_offset
=
0
;
i_offset
<
p_dec
->
fmt_in
.
i_extra
-
sizeof
(
p_pattern
);
i_offset
++
)
{
if
(
!
memcmp
(
&
p_src
[
i_offset
],
p_pattern
,
sizeof
(
p_pattern
)
)
)
break
;
}
i_size
=
__MIN
(
p_dec
->
fmt_in
.
i_extra
-
i_offset
,
36
);
if
(
i_size
<
36
)
i_size
=
0
;
}
else
{
i_offset
=
0
;
i_size
=
p_dec
->
fmt_in
.
i_extra
;
}
p_sys
->
p_context
->
extradata_size
-=
i_offset
;
if
(
i_size
>
0
)
{
p_sys
->
p_context
->
extradata
=
malloc
(
p_sys
->
p_context
->
extradata_size
+
FF_INPUT_BUFFER_PADDING_SIZE
);
malloc
(
i_size
+
FF_INPUT_BUFFER_PADDING_SIZE
);
if
(
p_sys
->
p_context
->
extradata
)
{
memcpy
(
p_sys
->
p_context
->
extradata
,
(
char
*
)
p_dec
->
fmt_in
.
p_extra
+
i_offset
,
p_sys
->
p_context
->
extradata_size
);
memset
(
(
char
*
)
p_sys
->
p_context
->
extradata
+
p_sys
->
p_context
->
extradata_size
,
0
,
FF_INPUT_BUFFER_PADDING_SIZE
);
uint8_t
*
p_dst
=
p_sys
->
p_context
->
extradata
;
p_sys
->
p_context
->
extradata_size
=
i_size
;
memcpy
(
&
p_dst
[
0
],
&
p_src
[
i_offset
],
i_size
);
memset
(
&
p_dst
[
i_size
],
0
,
FF_INPUT_BUFFER_PADDING_SIZE
);
}
}
}
else
{
p_sys
->
p_context
->
extradata_size
=
0
;
p_sys
->
p_context
->
extradata
=
NULL
;
}
/* ***** Open the codec ***** */
vlc_mutex_t
*
lock
=
var_AcquireMutex
(
"avcodec"
);
...
...
modules/demux/mp4/libmp4.c
View file @
df7648f0
...
...
@@ -1133,18 +1133,16 @@ static int MP4_ReadBox_sample_soun( stream_t *p_stream, MP4_Box_t *p_box )
/*
* XXX hack -> produce a copy of the nearly complete chunk
*/
p_box
->
data
.
p_sample_soun
->
i_qt_description
=
0
;
p_box
->
data
.
p_sample_soun
->
p_qt_description
=
NULL
;
if
(
i_read
>
0
)
{
p_box
->
data
.
p_sample_soun
->
p_qt_description
=
malloc
(
i_read
);
if
(
p_box
->
data
.
p_sample_soun
->
p_qt_description
==
NULL
)
MP4_READBOX_EXIT
(
0
);
if
(
p_box
->
data
.
p_sample_soun
->
p_qt_description
)
{
p_box
->
data
.
p_sample_soun
->
i_qt_description
=
i_read
;
memcpy
(
p_box
->
data
.
p_sample_soun
->
p_qt_description
,
p_peek
,
i_read
);
}
else
{
p_box
->
data
.
p_sample_soun
->
i_qt_description
=
0
;
p_box
->
data
.
p_sample_soun
->
p_qt_description
=
NULL
;
}
MP4_GET2BYTES
(
p_box
->
data
.
p_sample_soun
->
i_qt_version
);
...
...
@@ -1232,20 +1230,7 @@ static int MP4_ReadBox_sample_soun( stream_t *p_stream, MP4_Box_t *p_box )
p_box
->
data
.
p_sample_soun
->
i_channelcount
=
1
;
}
if
(
p_box
->
i_type
==
FOURCC_alac
)
{
free
(
p_box
->
data
.
p_sample_soun
->
p_qt_description
);
p_box
->
data
.
p_sample_soun
->
p_qt_description
=
malloc
(
i_read
);
if
(
p_box
->
data
.
p_sample_soun
->
p_qt_description
==
NULL
)
MP4_READBOX_EXIT
(
0
);
p_box
->
data
.
p_sample_soun
->
i_qt_description
=
i_read
;
memcpy
(
p_box
->
data
.
p_sample_soun
->
p_qt_description
,
p_peek
,
i_read
);
}
else
{
MP4_ReadBoxContainerRaw
(
p_stream
,
p_box
);
/* esds */
}
MP4_ReadBoxContainerRaw
(
p_stream
,
p_box
);
/* esds/wave/... */
#ifdef MP4_VERBOSE
msg_Dbg
(
p_stream
,
"read box:
\"
soun
\"
in stsd channel %d "
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment