Revision c0f14458

View differences:

libavformat/aiff.c
79 79
}
80 80

  
81 81
/* Metadata string read */
82
static void get_meta(ByteIOContext *pb, char * str, int strsize, int size)
82
static void get_meta(AVFormatContext *s, const char *key, int size)
83 83
{
84
    int res = get_buffer(pb, (uint8_t*)str, FFMIN(strsize-1, size));
84
    uint8_t str[1024];
85
    int res = get_buffer(s->pb, str, FFMIN(sizeof(str)-1, size));
85 86
    if (res < 0)
86 87
        return;
87 88

  
......
90 91
        size++;
91 92
    size -= res;
92 93
    if (size)
93
        url_fskip(pb, size);
94
        url_fskip(s->pb, size);
95

  
96
    av_metadata_set(&s->metadata, key, str);
94 97
}
95 98

  
96 99
/* Returns the number of sound data frames or negative on error */
......
351 354
            version = get_be32(pb);
352 355
            break;
353 356
        case MKTAG('N', 'A', 'M', 'E'):     /* Sample name chunk */
354
            get_meta(pb, s->title, sizeof(s->title), size);
357
            get_meta(s, "title"    , size);
355 358
            break;
356 359
        case MKTAG('A', 'U', 'T', 'H'):     /* Author chunk */
357
            get_meta(pb, s->author, sizeof(s->author), size);
360
            get_meta(s, "author"   , size);
358 361
            break;
359 362
        case MKTAG('(', 'c', ')', ' '):     /* Copyright chunk */
360
            get_meta(pb, s->copyright, sizeof(s->copyright), size);
363
            get_meta(s, "copyright", size);
361 364
            break;
362 365
        case MKTAG('A', 'N', 'N', 'O'):     /* Annotation chunk */
363
            get_meta(pb, s->comment, sizeof(s->comment), size);
366
            get_meta(s, "comment"  , size);
364 367
            break;
365 368
        case MKTAG('S', 'S', 'N', 'D'):     /* Sampled sound chunk */
366 369
            offset = get_be32(pb);      /* Offset of sound data */

Also available in: Unified diff