Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
96fe4432
Commit
96fe4432
authored
Jan 20, 2017
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/wmaprodec: unbreak XMA mono decoding
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
cab0f3ab
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
wmaprodec.c
libavcodec/wmaprodec.c
+9
-6
No files found.
libavcodec/wmaprodec.c
View file @
96fe4432
...
...
@@ -1755,8 +1755,9 @@ static int xma_decode_packet(AVCodecContext *avctx, void *data,
if
(
got_stream_frame_ptr
)
{
memcpy
(
&
s
->
samples
[
s
->
current_stream
*
2
+
0
][
s
->
offset
[
s
->
current_stream
]
*
512
],
s
->
frames
[
s
->
current_stream
]
->
extended_data
[
0
],
512
*
4
);
memcpy
(
&
s
->
samples
[
s
->
current_stream
*
2
+
1
][
s
->
offset
[
s
->
current_stream
]
*
512
],
s
->
frames
[
s
->
current_stream
]
->
extended_data
[
1
],
512
*
4
);
if
(
avctx
->
channels
>
1
)
memcpy
(
&
s
->
samples
[
s
->
current_stream
*
2
+
1
][
s
->
offset
[
s
->
current_stream
]
*
512
],
s
->
frames
[
s
->
current_stream
]
->
extended_data
[
1
],
512
*
4
);
s
->
offset
[
s
->
current_stream
]
++
;
}
...
...
@@ -1794,7 +1795,7 @@ static int xma_decode_packet(AVCodecContext *avctx, void *data,
s
->
xma
[
i
].
skip_packets
=
FFMAX
(
0
,
s
->
xma
[
i
].
skip_packets
-
1
);
}
for
(
i
=
0
;
i
<
avctx
->
channels
/
2
;
i
++
)
{
for
(
i
=
0
;
i
<
(
avctx
->
channels
+
1
)
/
2
;
i
++
)
{
offset
=
FFMIN
(
offset
,
s
->
offset
[
i
]);
}
...
...
@@ -1803,13 +1804,15 @@ static int xma_decode_packet(AVCodecContext *avctx, void *data,
if
((
bret
=
ff_get_buffer
(
avctx
,
frame
,
0
))
<
0
)
return
bret
;
for
(
i
=
0
;
i
<
avctx
->
channels
/
2
;
i
++
)
{
for
(
i
=
0
;
i
<
(
avctx
->
channels
+
1
)
/
2
;
i
++
)
{
memcpy
(
frame
->
extended_data
[
i
*
2
+
0
],
s
->
samples
[
i
*
2
+
0
],
frame
->
nb_samples
*
4
);
memcpy
(
frame
->
extended_data
[
i
*
2
+
1
],
s
->
samples
[
i
*
2
+
1
],
frame
->
nb_samples
*
4
);
if
(
avctx
->
channels
>
1
)
memcpy
(
frame
->
extended_data
[
i
*
2
+
1
],
s
->
samples
[
i
*
2
+
1
],
frame
->
nb_samples
*
4
);
s
->
offset
[
i
]
-=
offset
;
if
(
s
->
offset
[
i
])
{
memmove
(
s
->
samples
[
i
*
2
+
0
],
s
->
samples
[
i
*
2
+
0
]
+
frame
->
nb_samples
,
s
->
offset
[
i
]
*
4
*
512
);
memmove
(
s
->
samples
[
i
*
2
+
1
],
s
->
samples
[
i
*
2
+
1
]
+
frame
->
nb_samples
,
s
->
offset
[
i
]
*
4
*
512
);
if
(
avctx
->
channels
>
1
)
memmove
(
s
->
samples
[
i
*
2
+
1
],
s
->
samples
[
i
*
2
+
1
]
+
frame
->
nb_samples
,
s
->
offset
[
i
]
*
4
*
512
);
}
}
...
...
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