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
8ea6157d
Commit
8ea6157d
authored
Aug 18, 2011
by
Sven Hesse
Committed by
Michael Niedermayer
Aug 18, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xmv: Read the video packet data first, then swap its bytes
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
c062aa8d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
xmv.c
libavformat/xmv.c
+6
-6
No files found.
libavformat/xmv.c
View file @
8ea6157d
...
@@ -450,7 +450,7 @@ static int xmv_fetch_video_packet(AVFormatContext *s,
...
@@ -450,7 +450,7 @@ static int xmv_fetch_video_packet(AVFormatContext *s,
int
result
;
int
result
;
uint32_t
frame_header
;
uint32_t
frame_header
;
uint32_t
frame_size
,
frame_timestamp
;
uint32_t
frame_size
,
frame_timestamp
;
uint
32_t
i
;
uint
8_t
*
data
,
*
end
;
/* Seek to it */
/* Seek to it */
if
(
avio_seek
(
pb
,
video
->
data_offset
,
SEEK_SET
)
!=
video
->
data_offset
)
if
(
avio_seek
(
pb
,
video
->
data_offset
,
SEEK_SET
)
!=
video
->
data_offset
)
...
@@ -465,17 +465,17 @@ static int xmv_fetch_video_packet(AVFormatContext *s,
...
@@ -465,17 +465,17 @@ static int xmv_fetch_video_packet(AVFormatContext *s,
if
((
frame_size
+
4
)
>
video
->
data_size
)
if
((
frame_size
+
4
)
>
video
->
data_size
)
return
AVERROR
(
EIO
);
return
AVERROR
(
EIO
);
/*
Create the packet
*/
/*
Get the packet data
*/
result
=
av_
new_packet
(
pkt
,
frame_size
);
result
=
av_
get_packet
(
pb
,
pkt
,
frame_size
);
if
(
result
)
if
(
result
!=
frame_size
)
return
result
;
return
result
;
/* Contrary to normal WMV2 video, the bit stream in XMV's
/* Contrary to normal WMV2 video, the bit stream in XMV's
* WMV2 is little-endian.
* WMV2 is little-endian.
* TODO: This manual swap is of course suboptimal.
* TODO: This manual swap is of course suboptimal.
*/
*/
for
(
i
=
0
;
i
<
frame_size
;
i
+=
4
)
for
(
data
=
pkt
->
data
,
end
=
pkt
->
data
+
frame_size
;
data
<
end
;
data
+=
4
)
AV_WB32
(
pkt
->
data
+
i
,
avio_rl32
(
pb
));
AV_WB32
(
data
,
AV_RL32
(
data
));
pkt
->
stream_index
=
video
->
stream_index
;
pkt
->
stream_index
=
video
->
stream_index
;
...
...
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