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
78c3c188
Commit
78c3c188
authored
Jul 07, 2007
by
Måns Rullgård
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use bytestream_get_* and AV_RLxx
Originally committed as revision 9525 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
3c3f7ce1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
26 deletions
+23
-26
oggparseogm.c
libavformat/oggparseogm.c
+23
-26
No files found.
libavformat/oggparseogm.c
View file @
78c3c188
...
...
@@ -25,7 +25,8 @@
#include <stdlib.h>
#include "avformat.h"
#include "bitstream.h"
#include "bswap.h"
#include "bytestream.h"
#include "intreadwrite.h"
#include "ogg2.h"
#include "riff.h"
...
...
@@ -51,42 +52,38 @@ ogm_header(AVFormatContext *s, int idx)
int
tag
;
st
->
codec
->
codec_type
=
CODEC_TYPE_VIDEO
;
p
+=
8
;
tag
=
le2me_32
(
unaligned32
(
p
)
);
tag
=
bytestream_get_le32
(
&
p
);
st
->
codec
->
codec_id
=
codec_get_bmp_id
(
tag
);
st
->
codec
->
codec_tag
=
tag
;
}
else
{
uint8_t
acid
[
5
];
int
cid
;
st
->
codec
->
codec_type
=
CODEC_TYPE_AUDIO
;
p
+=
8
;
p
[
4
]
=
0
;
cid
=
strtol
(
p
,
NULL
,
16
);
bytestream_get_buffer
(
&
p
,
acid
,
4
);
acid
[
4
]
=
0
;
cid
=
strtol
(
acid
,
NULL
,
16
);
st
->
codec
->
codec_id
=
codec_get_wav_id
(
cid
);
}
p
+=
4
;
p
+=
4
;
/* useless size field */
time_unit
=
le2me_64
(
unaligned64
(
p
));
p
+=
8
;
spu
=
le2me_64
(
unaligned64
(
p
));
p
+=
8
;
default_len
=
le2me_32
(
unaligned32
(
p
));
p
+=
4
;
time_unit
=
bytestream_get_le64
(
&
p
);
spu
=
bytestream_get_le64
(
&
p
);
default_len
=
bytestream_get_le32
(
&
p
);
p
+=
8
;
/* buffersize + bits_per_sample */
if
(
st
->
codec
->
codec_type
==
CODEC_TYPE_VIDEO
){
st
->
codec
->
width
=
le2me_32
(
unaligned32
(
p
));
p
+=
4
;
st
->
codec
->
height
=
le2me_32
(
unaligned32
(
p
));
st
->
codec
->
width
=
bytestream_get_le32
(
&
p
);
st
->
codec
->
height
=
bytestream_get_le32
(
&
p
);
st
->
codec
->
time_base
.
den
=
spu
*
10000000
;
st
->
codec
->
time_base
.
num
=
time_unit
;
st
->
time_base
=
st
->
codec
->
time_base
;
}
else
{
st
->
codec
->
channels
=
le2me_16
(
unaligned16
(
p
));
p
+=
2
;
st
->
codec
->
channels
=
bytestream_get_le16
(
&
p
);
p
+=
2
;
/* block_align */
st
->
codec
->
bit_rate
=
le2me_32
(
unaligned32
(
p
)
)
*
8
;
st
->
codec
->
bit_rate
=
bytestream_get_le32
(
&
p
)
*
8
;
st
->
codec
->
sample_rate
=
spu
*
10000000
/
time_unit
;
st
->
time_base
.
num
=
1
;
st
->
time_base
.
den
=
st
->
codec
->
sample_rate
;
...
...
@@ -109,21 +106,21 @@ ogm_dshow_header(AVFormatContext *s, int idx)
if
(
*
p
!=
1
)
return
1
;
t
=
le2me_32
(
unaligned32
(
p
+
96
)
);
t
=
AV_RL32
(
p
+
96
);
if
(
t
==
0x05589f80
){
st
->
codec
->
codec_type
=
CODEC_TYPE_VIDEO
;
st
->
codec
->
codec_id
=
codec_get_bmp_id
(
le2me_32
(
unaligned32
(
p
+
68
)
));
st
->
codec
->
codec_id
=
codec_get_bmp_id
(
AV_RL32
(
p
+
68
));
st
->
codec
->
time_base
.
den
=
10000000
;
st
->
codec
->
time_base
.
num
=
le2me_64
(
unaligned64
(
p
+
164
)
);
st
->
codec
->
width
=
le2me_32
(
unaligned32
(
p
+
176
)
);
st
->
codec
->
height
=
le2me_32
(
unaligned32
(
p
+
180
)
);
st
->
codec
->
time_base
.
num
=
AV_RL64
(
p
+
164
);
st
->
codec
->
width
=
AV_RL32
(
p
+
176
);
st
->
codec
->
height
=
AV_RL32
(
p
+
180
);
}
else
if
(
t
==
0x05589f81
){
st
->
codec
->
codec_type
=
CODEC_TYPE_AUDIO
;
st
->
codec
->
codec_id
=
codec_get_wav_id
(
le2me_16
(
unaligned16
(
p
+
124
)
));
st
->
codec
->
channels
=
le2me_16
(
unaligned16
(
p
+
126
)
);
st
->
codec
->
sample_rate
=
le2me_32
(
unaligned32
(
p
+
128
)
);
st
->
codec
->
bit_rate
=
le2me_32
(
unaligned32
(
p
+
132
)
)
*
8
;
st
->
codec
->
codec_id
=
codec_get_wav_id
(
AV_RL16
(
p
+
124
));
st
->
codec
->
channels
=
AV_RL16
(
p
+
126
);
st
->
codec
->
sample_rate
=
AV_RL32
(
p
+
128
);
st
->
codec
->
bit_rate
=
AV_RL32
(
p
+
132
)
*
8
;
}
return
1
;
...
...
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