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
57d63d43
Commit
57d63d43
authored
Mar 12, 2011
by
Peter Ross
Committed by
Michael Niedermayer
Mar 13, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jv demuxer: define JV_PREAMBLE_SIZE instead of hard coding the number
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
2f1084ca
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
jvdec.c
libavformat/jvdec.c
+5
-3
No files found.
libavformat/jvdec.c
View file @
57d63d43
...
...
@@ -28,6 +28,8 @@
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#define JV_PREAMBLE_SIZE 5
typedef
struct
{
int
audio_size
;
/** audio packet size (bytes) */
int
video_size
;
/** video packet size (bytes) */
...
...
@@ -154,15 +156,15 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
jv
->
state
++
;
if
(
jvf
->
video_size
||
jvf
->
palette_size
)
{
int
size
=
jvf
->
video_size
+
jvf
->
palette_size
;
if
(
av_new_packet
(
pkt
,
size
+
5
))
if
(
av_new_packet
(
pkt
,
size
+
JV_PREAMBLE_SIZE
))
return
AVERROR
(
ENOMEM
);
AV_WL32
(
pkt
->
data
,
jvf
->
video_size
);
pkt
->
data
[
4
]
=
jvf
->
video_type
;
if
(
avio_read
(
pb
,
pkt
->
data
+
5
,
size
)
<
0
)
if
(
avio_read
(
pb
,
pkt
->
data
+
JV_PREAMBLE_SIZE
,
size
)
<
0
)
return
AVERROR
(
EIO
);
pkt
->
size
=
size
+
5
;
pkt
->
size
=
size
+
JV_PREAMBLE_SIZE
;
pkt
->
stream_index
=
1
;
pkt
->
pts
=
jv
->
pts
;
if
(
jvf
->
video_type
!=
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