Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(221)

Side by Side Diff: source/patched-ffmpeg-mt/libavformat/vorbiscomment.c

Issue 4533003: patched ffmpeg nov 2 (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/ffmpeg/
Patch Set: '' Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * VorbisComment writer 2 * VorbisComment writer
3 * Copyright (c) 2009 James Darnley 3 * Copyright (c) 2009 James Darnley
4 * 4 *
5 * This file is part of FFmpeg. 5 * This file is part of FFmpeg.
6 * 6 *
7 * FFmpeg is free software; you can redistribute it and/or 7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public 8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version. 10 * version 2.1 of the License, or (at your option) any later version.
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 if (m) { 45 if (m) {
46 AVMetadataTag *tag = NULL; 46 AVMetadataTag *tag = NULL;
47 while ((tag = av_metadata_get(m, "", tag, AV_METADATA_IGNORE_SUFFIX))) { 47 while ((tag = av_metadata_get(m, "", tag, AV_METADATA_IGNORE_SUFFIX))) {
48 len += 4 +strlen(tag->key) + 1 + strlen(tag->value); 48 len += 4 +strlen(tag->key) + 1 + strlen(tag->value);
49 (*count)++; 49 (*count)++;
50 } 50 }
51 } 51 }
52 return len; 52 return len;
53 } 53 }
54 54
55 int ff_vorbiscomment_write(uint8_t **p, AVMetadata *m, 55 int ff_vorbiscomment_write(uint8_t **p, AVMetadata **m,
56 const char *vendor_string, const unsigned count) 56 const char *vendor_string, const unsigned count)
57 { 57 {
58 ff_metadata_conv(m, ff_vorbiscomment_metadata_conv, NULL);
58 bytestream_put_le32(p, strlen(vendor_string)); 59 bytestream_put_le32(p, strlen(vendor_string));
59 bytestream_put_buffer(p, vendor_string, strlen(vendor_string)); 60 bytestream_put_buffer(p, vendor_string, strlen(vendor_string));
60 if (m) { 61 if (*m) {
61 AVMetadataTag *tag = NULL; 62 AVMetadataTag *tag = NULL;
62 bytestream_put_le32(p, count); 63 bytestream_put_le32(p, count);
63 while ((tag = av_metadata_get(m, "", tag, AV_METADATA_IGNORE_SUFFIX))) { 64 while ((tag = av_metadata_get(*m, "", tag, AV_METADATA_IGNORE_SUFFIX))) {
64 unsigned int len1 = strlen(tag->key); 65 unsigned int len1 = strlen(tag->key);
65 unsigned int len2 = strlen(tag->value); 66 unsigned int len2 = strlen(tag->value);
66 bytestream_put_le32(p, len1+1+len2); 67 bytestream_put_le32(p, len1+1+len2);
67 bytestream_put_buffer(p, tag->key, len1); 68 bytestream_put_buffer(p, tag->key, len1);
68 bytestream_put_byte(p, '='); 69 bytestream_put_byte(p, '=');
69 bytestream_put_buffer(p, tag->value, len2); 70 bytestream_put_buffer(p, tag->value, len2);
70 } 71 }
71 } else 72 } else
72 bytestream_put_le32(p, 0); 73 bytestream_put_le32(p, 0);
73 return 0; 74 return 0;
74 } 75 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698