OLD | NEW |
1 /* | 1 /* |
2 * APE tag handling | 2 * APE tag handling |
3 * Copyright (c) 2007 Benjamin Zores <ben@geexbox.org> | 3 * Copyright (c) 2007 Benjamin Zores <ben@geexbox.org> |
4 * based upon libdemac from Dave Chapman. | 4 * based upon libdemac from Dave Chapman. |
5 * | 5 * |
6 * This file is part of FFmpeg. | 6 * This file is part of FFmpeg. |
7 * | 7 * |
8 * FFmpeg is free software; you can redistribute it and/or | 8 * FFmpeg is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Lesser General Public | 9 * modify it under the terms of the GNU Lesser General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
11 * version 2.1 of the License, or (at your option) any later version. | 11 * version 2.1 of the License, or (at your option) any later version. |
12 * | 12 * |
13 * FFmpeg is distributed in the hope that it will be useful, | 13 * FFmpeg is distributed in the hope that it will be useful, |
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
16 * Lesser General Public License for more details. | 16 * Lesser General Public License for more details. |
17 * | 17 * |
18 * You should have received a copy of the GNU Lesser General Public | 18 * You should have received a copy of the GNU Lesser General Public |
19 * License along with FFmpeg; if not, write to the Free Software | 19 * License along with FFmpeg; if not, write to the Free Software |
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
21 */ | 21 */ |
22 | 22 |
23 #include "libavutil/intreadwrite.h" | 23 #include "libavutil/intreadwrite.h" |
24 #include "avformat.h" | 24 #include "avformat.h" |
| 25 #include "apetag.h" |
25 | 26 |
26 #define ENABLE_DEBUG 0 | 27 #define ENABLE_DEBUG 0 |
27 | 28 |
28 #define APE_TAG_VERSION 2000 | 29 #define APE_TAG_VERSION 2000 |
29 #define APE_TAG_FOOTER_BYTES 32 | 30 #define APE_TAG_FOOTER_BYTES 32 |
30 #define APE_TAG_FLAG_CONTAINS_HEADER (1 << 31) | 31 #define APE_TAG_FLAG_CONTAINS_HEADER (1 << 31) |
31 #define APE_TAG_FLAG_IS_HEADER (1 << 29) | 32 #define APE_TAG_FLAG_IS_HEADER (1 << 29) |
32 | 33 |
33 static int ape_tag_read_field(AVFormatContext *s) | 34 static int ape_tag_read_field(AVFormatContext *s) |
34 { | 35 { |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 if (val & APE_TAG_FLAG_IS_HEADER) { | 103 if (val & APE_TAG_FLAG_IS_HEADER) { |
103 av_log(s, AV_LOG_ERROR, "APE Tag is a header\n"); | 104 av_log(s, AV_LOG_ERROR, "APE Tag is a header\n"); |
104 return; | 105 return; |
105 } | 106 } |
106 | 107 |
107 url_fseek(pb, file_size - tag_bytes, SEEK_SET); | 108 url_fseek(pb, file_size - tag_bytes, SEEK_SET); |
108 | 109 |
109 for (i=0; i<fields; i++) | 110 for (i=0; i<fields; i++) |
110 if (ape_tag_read_field(s) < 0) break; | 111 if (ape_tag_read_field(s) < 0) break; |
111 } | 112 } |
OLD | NEW |