diff options
author | Michael Niedermayer | 2013-10-13 09:34:51 +0200 |
---|---|---|
committer | Michael Niedermayer | 2013-10-13 09:37:21 +0200 |
commit | 92b03cf926efae224762dcc74d035cbf67b45368 (patch) | |
tree | f1e2f0063ed4040339aa4c7e815a6c579857436a | |
parent | 8dbf98e68a9b7d92705661a2d6900c6d914a8068 (diff) | |
parent | 601d6228c4811d8971a2412a759e1a4ab775ebe8 (diff) |
Merge commit '601d6228c4811d8971a2412a759e1a4ab775ebe8'
* commit '601d6228c4811d8971a2412a759e1a4ab775ebe8':
flac: move picture parsing code in a separate file
Conflicts:
libavformat/Makefile
libavformat/flacdec.c
See: 1e5bbbfcf303ec3db0c7db30b85855e2e5358aec
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/Makefile | 4 | ||||
-rw-r--r-- | libavformat/flac_picture.c (renamed from libavformat/flacdec_picture.c) | 13 | ||||
-rw-r--r-- | libavformat/flac_picture.h (renamed from libavformat/flacdec.h) | 8 | ||||
-rw-r--r-- | libavformat/flacdec.c | 2 | ||||
-rw-r--r-- | libavformat/oggparsevorbis.c | 2 |
5 files changed, 15 insertions, 14 deletions
diff --git a/libavformat/Makefile b/libavformat/Makefile index f56cc72bfe..510701278e 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -138,7 +138,7 @@ OBJS-$(CONFIG_FFMETADATA_MUXER) += ffmetaenc.o OBJS-$(CONFIG_FILMSTRIP_DEMUXER) += filmstripdec.o OBJS-$(CONFIG_FILMSTRIP_MUXER) += filmstripenc.o OBJS-$(CONFIG_FLAC_DEMUXER) += flacdec.o rawdec.o \ - flacdec_picture.o \ + flac_picture.o \ oggparsevorbis.o \ vorbiscomment.o OBJS-$(CONFIG_FLAC_MUXER) += flacenc.o flacenc_header.o \ @@ -262,7 +262,7 @@ OBJS-$(CONFIG_OGG_DEMUXER) += oggdec.o \ oggparsetheora.o \ oggparsevorbis.o \ vorbiscomment.o \ - flacdec_picture.o + flac_picture.o OBJS-$(CONFIG_OGG_MUXER) += oggenc.o \ vorbiscomment.o OBJS-$(CONFIG_OMA_DEMUXER) += omadec.o pcm.o oma.o diff --git a/libavformat/flacdec_picture.c b/libavformat/flac_picture.c index 1b0bea2dd0..12d73e488f 100644 --- a/libavformat/flacdec_picture.c +++ b/libavformat/flac_picture.c @@ -1,5 +1,5 @@ /* - * Raw FLAC demuxer + * Raw FLAC picture parser * Copyright (c) 2001 Fabrice Bellard * * This file is part of FFmpeg. @@ -21,14 +21,14 @@ #include "libavutil/avassert.h" #include "avformat.h" -#include "flacdec.h" +#include "flac_picture.h" #include "id3v2.h" #include "internal.h" int ff_flac_parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size) { const CodecMime *mime = ff_id3v2_mime_tags; - enum AVCodecID id = AV_CODEC_ID_NONE; + enum AVCodecID id = AV_CODEC_ID_NONE; AVBufferRef *data = NULL; uint8_t mimetype[64], *desc = NULL; AVIOContext *pb = NULL; @@ -41,7 +41,7 @@ int ff_flac_parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size) return AVERROR(ENOMEM); /* read the picture type */ - type = avio_rb32(pb); + type = avio_rb32(pb); if (type >= FF_ARRAY_ELEMS(ff_id3v2_picture_types) || type < 0) { av_log(s, AV_LOG_ERROR, "Invalid picture type: %d.\n", type); if (s->error_recognition & AV_EF_EXPLODE) { @@ -51,7 +51,7 @@ int ff_flac_parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size) } /* picture mimetype */ - len = avio_rb32(pb); + len = avio_rb32(pb); if (len <= 0 || avio_read(pb, mimetype, FFMIN(len, sizeof(mimetype) - 1)) != len) { av_log(s, AV_LOG_ERROR, "Could not read mimetype from an attached " @@ -136,7 +136,7 @@ int ff_flac_parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size) st->codec->height = height; av_dict_set(&st->metadata, "comment", ff_id3v2_picture_types[type], 0); if (desc) - av_dict_set(&st->metadata, "title", desc, AV_DICT_DONT_STRDUP_VAL); + av_dict_set(&st->metadata, "title", desc, AV_DICT_DONT_STRDUP_VAL); av_freep(&pb); @@ -146,5 +146,6 @@ fail: av_buffer_unref(&data); av_freep(&desc); av_freep(&pb); + return ret; } diff --git a/libavformat/flacdec.h b/libavformat/flac_picture.h index dff0660311..4374b6f4f6 100644 --- a/libavformat/flacdec.h +++ b/libavformat/flac_picture.h @@ -1,5 +1,5 @@ /* - * Raw FLAC demuxer + * Raw FLAC picture parser * Copyright (c) 2001 Fabrice Bellard * * This file is part of FFmpeg. @@ -19,8 +19,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef AVFORMAT_FLACDEC_H -#define AVFORMAT_FLACDEC_H +#ifndef AVFORMAT_FLAC_PICTURE_H +#define AVFORMAT_FLAC_PICTURE_H #include "avformat.h" @@ -28,4 +28,4 @@ int ff_flac_parse_picture(AVFormatContext *s, uint8_t *buf, int buf_size); -#endif /* AVFORMAT_FLACDEC_H */ +#endif /* AVFORMAT_FLAC_PICTURE_H */ diff --git a/libavformat/flacdec.c b/libavformat/flacdec.c index 8384076b3d..29310b831f 100644 --- a/libavformat/flacdec.c +++ b/libavformat/flacdec.c @@ -21,7 +21,7 @@ #include "libavcodec/flac.h" #include "avformat.h" -#include "flacdec.h" +#include "flac_picture.h" #include "internal.h" #include "rawdec.h" #include "oggdec.h" diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c index 2ecc9ce0d8..a63e5978d9 100644 --- a/libavformat/oggparsevorbis.c +++ b/libavformat/oggparsevorbis.c @@ -32,7 +32,7 @@ #include "libavcodec/get_bits.h" #include "libavcodec/vorbis_parser.h" #include "avformat.h" -#include "flacdec.h" +#include "flac_picture.h" #include "internal.h" #include "oggdec.h" #include "vorbiscomment.h" |