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
09f59d6a
Commit
09f59d6a
authored
Jul 06, 2013
by
Eugene Dzhurinsky
Committed by
Michael Niedermayer
Jul 09, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/gif: Do not write GIF89a header if loop is set to -1.
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
9e214900
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
11 deletions
+14
-11
gif.c
libavformat/gif.c
+14
-11
No files found.
libavformat/gif.c
View file @
09f59d6a
...
...
@@ -52,15 +52,18 @@ static int gif_image_write_header(AVIOContext *pb, int width, int height,
avio_w8
(
pb
,
0
);
/* aspect ratio */
}
/* "NETSCAPE EXTENSION" for looped animation GIF */
avio_w8
(
pb
,
0x21
);
/* GIF Extension code */
avio_w8
(
pb
,
0xff
);
/* Application Extension Label */
avio_w8
(
pb
,
0x0b
);
/* Length of Application Block */
avio_write
(
pb
,
"NETSCAPE2.0"
,
sizeof
(
"NETSCAPE2.0"
)
-
1
);
avio_w8
(
pb
,
0x03
);
/* Length of Data Sub-Block */
avio_w8
(
pb
,
0x01
);
avio_wl16
(
pb
,
(
uint16_t
)
loop_count
);
avio_w8
(
pb
,
0x00
);
/* Data Sub-block Terminator */
if
(
loop_count
>=
0
)
{
/* "NETSCAPE EXTENSION" for looped animation GIF */
avio_w8
(
pb
,
0x21
);
/* GIF Extension code */
avio_w8
(
pb
,
0xff
);
/* Application Extension Label */
avio_w8
(
pb
,
0x0b
);
/* Length of Application Block */
avio_write
(
pb
,
"NETSCAPE2.0"
,
sizeof
(
"NETSCAPE2.0"
)
-
1
);
avio_w8
(
pb
,
0x03
);
/* Length of Data Sub-Block */
avio_w8
(
pb
,
0x01
);
avio_wl16
(
pb
,
(
uint16_t
)
loop_count
);
avio_w8
(
pb
,
0x00
);
/* Data Sub-block Terminator */
}
return
0
;
}
...
...
@@ -189,8 +192,8 @@ static int gif_write_trailer(AVFormatContext *s)
#define OFFSET(x) offsetof(GIFContext, x)
#define ENC AV_OPT_FLAG_ENCODING_PARAM
static
const
AVOption
options
[]
=
{
{
"loop"
,
"Number of times to loop the output
.
"
,
OFFSET
(
loop
),
AV_OPT_TYPE_INT
,
{
.
i64
=
0
},
0
,
65535
,
ENC
},
{
"loop"
,
"Number of times to loop the output
: -1 - no loop, 0 - infinite loop
"
,
OFFSET
(
loop
),
AV_OPT_TYPE_INT
,
{
.
i64
=
0
},
-
1
,
65535
,
ENC
},
{
"final_delay"
,
"Force delay (in ms) after the last frame"
,
OFFSET
(
last_delay
),
AV_OPT_TYPE_INT
,
{
.
i64
=
-
1
},
-
1
,
65535
,
ENC
},
{
NULL
},
...
...
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