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
50883693
Commit
50883693
authored
Jan 06, 2013
by
Peter Ross
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wtvdec: demux thumbnail picture to AVStream.attached_pic
parent
2a89081c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
wtvdec.c
libavformat/wtvdec.c
+7
-5
No files found.
libavformat/wtvdec.c
View file @
50883693
...
...
@@ -414,6 +414,7 @@ static void get_attachment(AVFormatContext *s, AVIOContext *pb, int length)
char
description
[
1024
];
unsigned
int
filesize
;
AVStream
*
st
;
int
ret
;
int64_t
pos
=
avio_tell
(
pb
);
avio_get_str16le
(
pb
,
INT_MAX
,
mime
,
sizeof
(
mime
));
...
...
@@ -430,13 +431,14 @@ static void get_attachment(AVFormatContext *s, AVIOContext *pb, int length)
if
(
!
st
)
goto
done
;
av_dict_set
(
&
st
->
metadata
,
"title"
,
description
,
0
);
st
->
codec
->
codec_type
=
AVMEDIA_TYPE_VIDEO
;
st
->
codec
->
codec_id
=
AV_CODEC_ID_MJPEG
;
st
->
codec
->
codec_type
=
AVMEDIA_TYPE_ATTACHMENT
;
st
->
codec
->
extradata
=
av_mallocz
(
filesize
);
if
(
!
st
->
codec
->
extradata
)
ret
=
av_get_packet
(
pb
,
&
st
->
attached_pic
,
filesize
);
if
(
ret
<
0
)
goto
done
;
st
->
codec
->
extradata_size
=
filesize
;
avio_read
(
pb
,
st
->
codec
->
extradata
,
filesize
);
st
->
attached_pic
.
stream_index
=
st
->
index
;
st
->
attached_pic
.
flags
|=
AV_PKT_FLAG_KEY
;
st
->
disposition
|=
AV_DISPOSITION_ATTACHED_PIC
;
done:
avio_seek
(
pb
,
pos
+
length
,
SEEK_SET
);
}
...
...
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