comparison mp3.c @ 2189:da71207a7cf1 libavformat

use new string functions based on patch by Reimar Dffinger
author mru
date Sat, 23 Jun 2007 23:10:32 +0000
parents b51b57909b5f
children 3427d0c63a32
comparison
equal deleted inserted replaced
2188:4c2924cebe00 2189:da71207a7cf1
18 * License along with FFmpeg; if not, write to the Free Software 18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */ 20 */
21 #include "avformat.h" 21 #include "avformat.h"
22 #include "mpegaudio.h" 22 #include "mpegaudio.h"
23 #include "avstring.h"
23 24
24 #define ID3v2_HEADER_SIZE 10 25 #define ID3v2_HEADER_SIZE 10
25 #define ID3v1_TAG_SIZE 128 26 #define ID3v1_TAG_SIZE 128
26 27
27 #define ID3v1_GENRE_MAX 125 28 #define ID3v1_GENRE_MAX 125
348 id3v1_get_string(s->comment, sizeof(s->comment), buf + 97, 30); 349 id3v1_get_string(s->comment, sizeof(s->comment), buf + 97, 30);
349 if (buf[125] == 0 && buf[126] != 0) 350 if (buf[125] == 0 && buf[126] != 0)
350 s->track = buf[126]; 351 s->track = buf[126];
351 genre = buf[127]; 352 genre = buf[127];
352 if (genre <= ID3v1_GENRE_MAX) 353 if (genre <= ID3v1_GENRE_MAX)
353 pstrcpy(s->genre, sizeof(s->genre), id3v1_genre_str[genre]); 354 av_strlcpy(s->genre, id3v1_genre_str[genre], sizeof(s->genre));
354 return 0; 355 return 0;
355 } 356 }
356 357
357 static void id3v1_create_tag(AVFormatContext *s, uint8_t *buf) 358 static void id3v1_create_tag(AVFormatContext *s, uint8_t *buf)
358 { 359 {