| OLD | NEW |
| 1 /** | 1 /** |
| 2 Copyright (C) 2005 Michael Ahlberg, Måns Rullgård | 2 Copyright (C) 2005 Michael Ahlberg, Måns Rullgård |
| 3 | 3 |
| 4 Permission is hereby granted, free of charge, to any person | 4 Permission is hereby granted, free of charge, to any person |
| 5 obtaining a copy of this software and associated documentation | 5 obtaining a copy of this software and associated documentation |
| 6 files (the "Software"), to deal in the Software without | 6 files (the "Software"), to deal in the Software without |
| 7 restriction, including without limitation the rights to use, copy, | 7 restriction, including without limitation the rights to use, copy, |
| 8 modify, merge, publish, distribute, sublicense, and/or sell copies | 8 modify, merge, publish, distribute, sublicense, and/or sell copies |
| 9 of the Software, and to permit persons to whom the Software is | 9 of the Software, and to permit persons to whom the Software is |
| 10 furnished to do so, subject to the following conditions: | 10 furnished to do so, subject to the following conditions: |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 DEALINGS IN THE SOFTWARE. | 22 DEALINGS IN THE SOFTWARE. |
| 23 **/ | 23 **/ |
| 24 | 24 |
| 25 #include <stdlib.h> | 25 #include <stdlib.h> |
| 26 #include "libavutil/avstring.h" | 26 #include "libavutil/avstring.h" |
| 27 #include "libavutil/bswap.h" | 27 #include "libavutil/bswap.h" |
| 28 #include "libavcodec/get_bits.h" | 28 #include "libavcodec/get_bits.h" |
| 29 #include "libavcodec/bytestream.h" | 29 #include "libavcodec/bytestream.h" |
| 30 #include "avformat.h" | 30 #include "avformat.h" |
| 31 #include "oggdec.h" | 31 #include "oggdec.h" |
| 32 #include "vorbiscomment.h" |
| 32 | 33 |
| 33 static int ogm_chapter(AVFormatContext *as, uint8_t *key, uint8_t *val) | 34 static int ogm_chapter(AVFormatContext *as, uint8_t *key, uint8_t *val) |
| 34 { | 35 { |
| 35 int i, cnum, h, m, s, ms, keylen = strlen(key); | 36 int i, cnum, h, m, s, ms, keylen = strlen(key); |
| 36 AVChapter *chapter = NULL; | 37 AVChapter *chapter = NULL; |
| 37 | 38 |
| 38 if (keylen < 9 || sscanf(key, "CHAPTER%02d", &cnum) != 1) | 39 if (keylen < 9 || sscanf(key, "CHAPTER%02d", &cnum) != 1) |
| 39 return 0; | 40 return 0; |
| 40 | 41 |
| 41 if (keylen == 9) { | 42 if (keylen == 9) { |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 AV_METADATA_DONT_STRDUP_VAL); | 131 AV_METADATA_DONT_STRDUP_VAL); |
| 131 } | 132 } |
| 132 } | 133 } |
| 133 | 134 |
| 134 if (p != end) | 135 if (p != end) |
| 135 av_log(as, AV_LOG_INFO, "%ti bytes of comment header remain\n", end-p); | 136 av_log(as, AV_LOG_INFO, "%ti bytes of comment header remain\n", end-p); |
| 136 if (n > 0) | 137 if (n > 0) |
| 137 av_log(as, AV_LOG_INFO, | 138 av_log(as, AV_LOG_INFO, |
| 138 "truncated comment header, %i comments not found\n", n); | 139 "truncated comment header, %i comments not found\n", n); |
| 139 | 140 |
| 141 ff_metadata_conv(m, NULL, ff_vorbiscomment_metadata_conv); |
| 142 |
| 140 return 0; | 143 return 0; |
| 141 } | 144 } |
| 142 | 145 |
| 143 | 146 |
| 144 /** Parse the vorbis header | 147 /** Parse the vorbis header |
| 145 * Vorbis Identification header from Vorbis_I_spec.html#vorbis-spec-codec | 148 * Vorbis Identification header from Vorbis_I_spec.html#vorbis-spec-codec |
| 146 * [vorbis_version] = read 32 bits as unsigned integer | Not used | 149 * [vorbis_version] = read 32 bits as unsigned integer | Not used |
| 147 * [audio_channels] = read 8 bit integer as unsigned | Used | 150 * [audio_channels] = read 8 bit integer as unsigned | Used |
| 148 * [audio_sample_rate] = read 32 bits as unsigned integer | Used | 151 * [audio_sample_rate] = read 32 bits as unsigned integer | Used |
| 149 * [bitrate_maximum] = read 32 bits as signed integer | Not used yet | 152 * [bitrate_maximum] = read 32 bits as signed integer | Not used yet |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 } | 260 } |
| 258 | 261 |
| 259 return 1; | 262 return 1; |
| 260 } | 263 } |
| 261 | 264 |
| 262 const struct ogg_codec ff_vorbis_codec = { | 265 const struct ogg_codec ff_vorbis_codec = { |
| 263 .magic = "\001vorbis", | 266 .magic = "\001vorbis", |
| 264 .magicsize = 7, | 267 .magicsize = 7, |
| 265 .header = vorbis_header | 268 .header = vorbis_header |
| 266 }; | 269 }; |
| OLD | NEW |