Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
c18375ec
Commit
c18375ec
authored
Jul 09, 2013
by
James Almer
Committed by
Anton Khirnov
Oct 12, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oggvorbisdec: add support for embedded cover art
Signed-off-by:
James Almer
<
jamrial@gmail.com
>
parent
601d6228
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
2 deletions
+29
-2
Makefile
libavformat/Makefile
+2
-1
oggparsevorbis.c
libavformat/oggparsevorbis.c
+27
-1
No files found.
libavformat/Makefile
View file @
c18375ec
...
...
@@ -218,7 +218,8 @@ OBJS-$(CONFIG_OGG_DEMUXER) += oggdec.o \
oggparsespeex.o
\
oggparsetheora.o
\
oggparsevorbis.o
\
vorbiscomment.o
vorbiscomment.o
\
flac_picture.o
OBJS-$(CONFIG_OGG_MUXER)
+=
oggenc.o
\
vorbiscomment.o
OBJS-$(CONFIG_OMA_DEMUXER)
+=
omadec.o
pcm.o
oma.o
...
...
libavformat/oggparsevorbis.c
View file @
c18375ec
...
...
@@ -25,12 +25,14 @@
#include <stdlib.h>
#include "libavutil/avstring.h"
#include "libavutil/base64.h"
#include "libavutil/bswap.h"
#include "libavutil/dict.h"
#include "libavcodec/bytestream.h"
#include "libavcodec/get_bits.h"
#include "libavcodec/vorbis_parser.h"
#include "avformat.h"
#include "flac_picture.h"
#include "internal.h"
#include "oggdec.h"
#include "vorbiscomment.h"
...
...
@@ -130,7 +132,31 @@ int ff_vorbis_comment(AVFormatContext *as, AVDictionary **m,
memcpy
(
ct
,
v
,
vl
);
ct
[
vl
]
=
0
;
if
(
!
ogm_chapter
(
as
,
tt
,
ct
))
/* The format in which the pictures are stored is the FLAC format.
* Xiph says: "The binary FLAC picture structure is base64 encoded
* and placed within a VorbisComment with the tag name
* 'METADATA_BLOCK_PICTURE'. This is the preferred and
* recommended way of embedding cover art within VorbisComments."
*/
if
(
!
strcmp
(
tt
,
"METADATA_BLOCK_PICTURE"
))
{
int
ret
;
char
*
pict
=
av_malloc
(
vl
);
if
(
!
pict
)
{
av_freep
(
&
tt
);
av_freep
(
&
ct
);
return
AVERROR
(
ENOMEM
);
}
if
((
ret
=
av_base64_decode
(
pict
,
ct
,
vl
))
>
0
)
ret
=
ff_flac_parse_picture
(
as
,
pict
,
ret
);
av_freep
(
&
tt
);
av_freep
(
&
ct
);
av_freep
(
&
pict
);
if
(
ret
<
0
)
{
av_log
(
as
,
AV_LOG_WARNING
,
"Failed to parse cover art block.
\n
"
);
continue
;
}
}
else
if
(
!
ogm_chapter
(
as
,
tt
,
ct
))
av_dict_set
(
m
,
tt
,
ct
,
AV_DICT_DONT_STRDUP_KEY
|
AV_DICT_DONT_STRDUP_VAL
);
...
...
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