summaryrefslogtreecommitdiff
path: root/libavformat/mov.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2014-04-29 15:37:52 +0200
committerAnton Khirnov <anton@khirnov.net>2014-05-01 09:25:46 +0200
commit18f2514c4037befd37b02e4d4f10c159edf3b26f (patch)
tree5f45008e7507ea0505ecc21f30bdadb97a341958 /libavformat/mov.c
parenta2941c8cb216bdc144953cace64973f5600ffa2d (diff)
mov: export stsd Compressorname in metadata
Stop using the undocumented to-be-deprecated AVCodecContext.codec_name field.
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 30f7f6e264..e3dc67b9c1 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1107,6 +1107,7 @@ static int mov_codec_id(AVStream *st, uint32_t format)
static void mov_parse_stsd_video(MOVContext *c, AVIOContext *pb,
AVStream *st, MOVStreamContext *sc)
{
+ uint8_t codec_name[32];
unsigned int color_depth, len, j;
int color_greyscale;
int color_table_id;
@@ -1128,15 +1129,19 @@ static void mov_parse_stsd_video(MOVContext *c, AVIOContext *pb,
len = avio_r8(pb); /* codec name, pascal string */
if (len > 31)
len = 31;
- mov_read_mac_string(c, pb, len, st->codec->codec_name, 32);
+ mov_read_mac_string(c, pb, len, codec_name, sizeof(codec_name));
if (len < 31)
avio_skip(pb, 31 - len);
+
+ if (codec_name[0])
+ av_dict_set(&st->metadata, "encoder", codec_name, 0);
+
/* codec_tag YV12 triggers an UV swap in rawdec.c */
- if (!memcmp(st->codec->codec_name, "Planar Y'CbCr 8-bit 4:2:0", 25))
+ if (!memcmp(codec_name, "Planar Y'CbCr 8-bit 4:2:0", 25))
st->codec->codec_tag = MKTAG('I', '4', '2', '0');
/* Flash Media Server uses tag H263 with Sorenson Spark */
if (st->codec->codec_tag == MKTAG('H','2','6','3') &&
- !memcmp(st->codec->codec_name, "Sorenson H263", 13))
+ !memcmp(codec_name, "Sorenson H263", 13))
st->codec->codec_id = AV_CODEC_ID_FLV1;
st->codec->bits_per_coded_sample = avio_rb16(pb); /* depth */