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
adb9b235
Commit
adb9b235
authored
Jan 24, 2015
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/gif: simplify gif_image_write_header() prototype
parent
088dfd3f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
10 deletions
+6
-10
gif.c
libavformat/gif.c
+6
-10
No files found.
libavformat/gif.c
View file @
adb9b235
...
...
@@ -28,13 +28,12 @@
#include "libavutil/log.h"
#include "libavutil/opt.h"
static
int
gif_image_write_header
(
AV
FormatContext
*
s
,
int
width
,
int
height
,
static
int
gif_image_write_header
(
AV
IOContext
*
pb
,
const
AVCodecContext
*
avctx
,
int
loop_count
,
uint32_t
*
palette
)
{
AVIOContext
*
pb
=
s
->
pb
;
AVRational
sar
=
s
->
streams
[
0
]
->
codec
->
sample_aspect_ratio
;
int
i
;
int64_t
aspect
=
0
;
const
AVRational
sar
=
avctx
->
sample_aspect_ratio
;
if
(
sar
.
num
>
0
&&
sar
.
den
>
0
)
{
aspect
=
sar
.
num
*
64LL
/
sar
.
den
-
15
;
...
...
@@ -44,8 +43,8 @@ static int gif_image_write_header(AVFormatContext *s, int width, int height,
avio_write
(
pb
,
"GIF"
,
3
);
avio_write
(
pb
,
"89a"
,
3
);
avio_wl16
(
pb
,
width
);
avio_wl16
(
pb
,
height
);
avio_wl16
(
pb
,
avctx
->
width
);
avio_wl16
(
pb
,
avctx
->
height
);
if
(
palette
)
{
avio_w8
(
pb
,
0xf7
);
/* flags: global clut, 256 entries */
...
...
@@ -89,7 +88,6 @@ static int gif_write_header(AVFormatContext *s)
{
GIFContext
*
gif
=
s
->
priv_data
;
AVCodecContext
*
video_enc
;
int
width
,
height
;
uint32_t
palette
[
AVPALETTE_COUNT
];
if
(
s
->
nb_streams
!=
1
||
...
...
@@ -101,15 +99,13 @@ static int gif_write_header(AVFormatContext *s)
}
video_enc
=
s
->
streams
[
0
]
->
codec
;
width
=
video_enc
->
width
;
height
=
video_enc
->
height
;
avpriv_set_pts_info
(
s
->
streams
[
0
],
64
,
1
,
100
);
if
(
avpriv_set_systematic_pal2
(
palette
,
video_enc
->
pix_fmt
)
<
0
)
{
av_assert0
(
video_enc
->
pix_fmt
==
AV_PIX_FMT_PAL8
);
gif_image_write_header
(
s
,
width
,
height
,
gif
->
loop
,
NULL
);
gif_image_write_header
(
s
->
pb
,
video_enc
,
gif
->
loop
,
NULL
);
}
else
{
gif_image_write_header
(
s
,
width
,
height
,
gif
->
loop
,
palette
);
gif_image_write_header
(
s
->
pb
,
video_enc
,
gif
->
loop
,
palette
);
}
avio_flush
(
s
->
pb
);
...
...
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