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
20c1281f
Commit
20c1281f
authored
Mar 12, 2011
by
Peter Ross
Committed by
Ronald S. Bultje
Mar 14, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jv demuxer: calculate palette_size for each frame in read_header
Signed-off-by:
Ronald S. Bultje
<
rsbultje@gmail.com
>
parent
402f9ad5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
jvdec.c
libavformat/jvdec.c
+5
-5
No files found.
libavformat/jvdec.c
View file @
20c1281f
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
typedef
struct
{
typedef
struct
{
int
audio_size
;
/** audio packet size (bytes) */
int
audio_size
;
/** audio packet size (bytes) */
int
video_size
;
/** video packet size (bytes) */
int
video_size
;
/** video packet size (bytes) */
int
palette
;
/** frame contains palette change
*/
int
palette
_size
;
/** palette size (bytes)
*/
int
video_type
;
/** per-frame video compression type */
int
video_type
;
/** per-frame video compression type */
}
JVFrame
;
}
JVFrame
;
...
@@ -113,7 +113,7 @@ static int read_header(AVFormatContext *s,
...
@@ -113,7 +113,7 @@ static int read_header(AVFormatContext *s,
jvf
->
audio_size
=
avio_rl32
(
pb
);
jvf
->
audio_size
=
avio_rl32
(
pb
);
jvf
->
video_size
=
avio_rl32
(
pb
);
jvf
->
video_size
=
avio_rl32
(
pb
);
jvf
->
palette
=
avio_r8
(
pb
)
;
jvf
->
palette
_size
=
avio_r8
(
pb
)
?
768
:
0
;
if
(
avio_r8
(
pb
))
if
(
avio_r8
(
pb
))
av_log
(
s
,
AV_LOG_WARNING
,
"unsupported audio codec
\n
"
);
av_log
(
s
,
AV_LOG_WARNING
,
"unsupported audio codec
\n
"
);
jvf
->
video_type
=
avio_r8
(
pb
);
jvf
->
video_type
=
avio_r8
(
pb
);
...
@@ -152,8 +152,8 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
...
@@ -152,8 +152,8 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
}
}
case
JV_VIDEO
:
case
JV_VIDEO
:
jv
->
state
++
;
jv
->
state
++
;
if
(
jvf
->
video_size
||
jvf
->
palette
)
{
if
(
jvf
->
video_size
||
jvf
->
palette
_size
)
{
int
size
=
jvf
->
video_size
+
(
jvf
->
palette
?
768
:
0
)
;
int
size
=
jvf
->
video_size
+
jvf
->
palette_size
;
if
(
av_new_packet
(
pkt
,
size
+
5
))
if
(
av_new_packet
(
pkt
,
size
+
5
))
return
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
...
@@ -171,7 +171,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
...
@@ -171,7 +171,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
}
}
case
JV_PADDING
:
case
JV_PADDING
:
avio_skip
(
pb
,
FFMAX
(
e
->
size
-
jvf
->
audio_size
-
jvf
->
video_size
avio_skip
(
pb
,
FFMAX
(
e
->
size
-
jvf
->
audio_size
-
jvf
->
video_size
-
(
jvf
->
palette
?
768
:
0
)
,
0
));
-
jvf
->
palette_size
,
0
));
jv
->
state
=
JV_AUDIO
;
jv
->
state
=
JV_AUDIO
;
jv
->
pts
++
;
jv
->
pts
++
;
}
}
...
...
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