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
6aac43f1
Commit
6aac43f1
authored
Feb 24, 2016
by
Mats Peterson
Committed by
Michael Niedermayer
Feb 27, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/matroskadec: Process QuickTime palette per track
Signed-off-by:
Michael Niedermayer
<
michael@niedermayer.cc
>
parent
9a277808
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
matroskadec.c
libavformat/matroskadec.c
+11
-8
No files found.
libavformat/matroskadec.c
View file @
6aac43f1
...
...
@@ -190,6 +190,9 @@ typedef struct MatroskaTrack {
int64_t
end_timecode
;
int
ms_compat
;
uint64_t
max_block_additional_id
;
uint32_t
palette
[
AVPALETTE_COUNT
];
int
has_palette
;
}
MatroskaTrack
;
typedef
struct
MatroskaAttachment
{
...
...
@@ -314,9 +317,6 @@ typedef struct MatroskaDemuxContext {
/* WebM DASH Manifest live flag/ */
int
is_live
;
uint32_t
palette
[
AVPALETTE_COUNT
];
int
has_palette
;
}
MatroskaDemuxContext
;
typedef
struct
MatroskaBlock
{
...
...
@@ -1930,9 +1930,9 @@ static int matroska_parse_tracks(AVFormatContext *s)
ffio_init_context
(
&
b
,
track
->
codec_priv
.
data
,
track
->
codec_priv
.
size
,
0
,
NULL
,
NULL
,
NULL
,
NULL
);
if
(
ff_get_qtpalette
(
codec_id
,
&
b
,
matroska
->
palette
))
{
if
(
ff_get_qtpalette
(
codec_id
,
&
b
,
track
->
palette
))
{
bit_depth
&=
0x1F
;
matroska
->
has_palette
=
1
;
track
->
has_palette
=
1
;
}
}
}
else
if
(
codec_id
==
AV_CODEC_ID_PCM_S16BE
)
{
...
...
@@ -2378,16 +2378,19 @@ static int matroska_deliver_packet(MatroskaDemuxContext *matroska,
AVPacket
*
pkt
)
{
if
(
matroska
->
num_packets
>
0
)
{
MatroskaTrack
*
tracks
=
matroska
->
tracks
.
elem
;
MatroskaTrack
*
track
;
memcpy
(
pkt
,
matroska
->
packets
[
0
],
sizeof
(
AVPacket
));
av_freep
(
&
matroska
->
packets
[
0
]);
if
(
matroska
->
has_palette
)
{
track
=
&
tracks
[
pkt
->
stream_index
];
if
(
track
->
has_palette
)
{
uint8_t
*
pal
=
av_packet_new_side_data
(
pkt
,
AV_PKT_DATA_PALETTE
,
AVPALETTE_SIZE
);
if
(
!
pal
)
{
av_log
(
matroska
->
ctx
,
AV_LOG_ERROR
,
"Cannot append palette to packet
\n
"
);
}
else
{
memcpy
(
pal
,
matroska
->
palette
,
AVPALETTE_SIZE
);
memcpy
(
pal
,
track
->
palette
,
AVPALETTE_SIZE
);
}
matroska
->
has_palette
=
0
;
track
->
has_palette
=
0
;
}
if
(
matroska
->
num_packets
>
1
)
{
void
*
newpackets
;
...
...
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