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
77bc3e19
Commit
77bc3e19
authored
Mar 12, 2016
by
Mats Peterson
Committed by
Michael Niedermayer
Mar 13, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/avienc: Add xxpc entries to index
Signed-off-by:
Michael Niedermayer
<
michael@niedermayer.cc
>
parent
9ee5b409
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
14 deletions
+27
-14
avi.h
libavformat/avi.h
+5
-1
avienc.c
libavformat/avienc.c
+20
-11
avi_cram
tests/ref/lavf-fate/avi_cram
+2
-2
No files found.
libavformat/avi.h
View file @
77bc3e19
...
...
@@ -32,7 +32,11 @@
#define AVI_MASTER_INDEX_SIZE 256
#define AVI_MAX_STREAM_COUNT 100
/* stream header flags */
#define AVISF_VIDEO_PALCHANGES 0x00010000
/* index flags */
#define AVIIF_INDEX 0x10
#define AVIIF_INDEX 0x00000010
#define AVIIF_NO_TIME 0x00000100
#endif
/* AVFORMAT_AVI_H */
libavformat/avienc.c
View file @
77bc3e19
...
...
@@ -52,8 +52,6 @@ typedef struct AVIIentry {
#define AVI_INDEX_CLUSTER_SIZE 16384
#define AVISF_VIDEO_PALCHANGES 0x00010000
typedef
struct
AVIIndex
{
int64_t
indx_start
;
int64_t
audio_strm_offset
;
...
...
@@ -652,9 +650,13 @@ static int avi_write_idx1(AVFormatContext *s)
}
if
(
!
empty
)
{
avist
=
s
->
streams
[
stream_id
]
->
priv_data
;
avi_stream2fourcc
(
tag
,
stream_id
,
if
(
*
ie
->
tag
)
ffio_wfourcc
(
pb
,
ie
->
tag
);
else
{
avi_stream2fourcc
(
tag
,
stream_id
,
s
->
streams
[
stream_id
]
->
codec
->
codec_type
);
ffio_wfourcc
(
pb
,
tag
);
ffio_wfourcc
(
pb
,
tag
);
}
avio_wl32
(
pb
,
ie
->
flags
);
avio_wl32
(
pb
,
ie
->
pos
);
avio_wl32
(
pb
,
ie
->
len
);
...
...
@@ -749,6 +751,20 @@ static int avi_write_packet(AVFormatContext *s, AVPacket *pkt)
unsigned
char
tag
[
5
];
avi_stream2fourcc
(
tag
,
stream_index
,
enc
->
codec_type
);
tag
[
2
]
=
'p'
;
tag
[
3
]
=
'c'
;
if
(
s
->
pb
->
seekable
)
{
int
ret
;
if
(
avist
->
strh_flags_offset
)
{
int64_t
cur_offset
=
avio_tell
(
pb
);
avio_seek
(
pb
,
avist
->
strh_flags_offset
,
SEEK_SET
);
avio_wl32
(
pb
,
AVISF_VIDEO_PALCHANGES
);
avio_seek
(
pb
,
cur_offset
,
SEEK_SET
);
avist
->
strh_flags_offset
=
0
;
}
ret
=
avi_add_ientry
(
s
,
stream_index
,
tag
,
AVIIF_NO_TIME
,
pal_size
*
4
+
4
);
if
(
ret
<
0
)
return
ret
;
}
pc_tag
=
ff_start_tag
(
pb
,
tag
);
avio_w8
(
pb
,
0
);
avio_w8
(
pb
,
pal_size
&
0xFF
);
...
...
@@ -759,13 +775,6 @@ static int avi_write_packet(AVFormatContext *s, AVPacket *pkt)
}
ff_end_tag
(
pb
,
pc_tag
);
memcpy
(
avist
->
old_palette
,
avist
->
palette
,
pal_size
*
4
);
if
(
pb
->
seekable
&&
avist
->
strh_flags_offset
)
{
int64_t
cur_offset
=
avio_tell
(
pb
);
avio_seek
(
pb
,
avist
->
strh_flags_offset
,
SEEK_SET
);
avio_wl32
(
pb
,
AVISF_VIDEO_PALCHANGES
);
avio_seek
(
pb
,
cur_offset
,
SEEK_SET
);
avist
->
strh_flags_offset
=
0
;
}
}
}
}
...
...
tests/ref/lavf-fate/avi_cram
View file @
77bc3e19
ba77c5c8bd2b0d1e0478d143346cc3b3
*./tests/data/lavf-fate/lavf.avi
9282
28
./tests/data/lavf-fate/lavf.avi
6fc88702c23b895c305c5e1f51a0904e
*./tests/data/lavf-fate/lavf.avi
9282
60
./tests/data/lavf-fate/lavf.avi
./tests/data/lavf-fate/lavf.avi CRC=0xa4770de2
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