Revision a181981e libavformat/metadata.c

View differences:

libavformat/metadata.c
46 46
    return NULL;
47 47
}
48 48

  
49
int av_metadata_set(AVMetadata **pm, const char *key, const char *value)
49
int av_metadata_set2(AVMetadata **pm, const char *key, const char *value, int flags)
50 50
{
51 51
    AVMetadata *m= *pm;
52 52
    AVMetadataTag *tag= av_metadata_get(m, key, NULL, AV_METADATA_MATCH_CASE);
......
66 66
            return AVERROR(ENOMEM);
67 67
    }
68 68
    if(value){
69
        if(flags & AV_METADATA_DONT_STRDUP_KEY){
70
            m->elems[m->count].key  = key;
71
        }else
69 72
        m->elems[m->count].key  = av_strdup(key  );
73
        if(flags & AV_METADATA_DONT_STRDUP_VAL){
74
            m->elems[m->count].value= value;
75
        }else
70 76
        m->elems[m->count].value= av_strdup(value);
71 77
        m->count++;
72 78
    }
......
78 84
    return 0;
79 85
}
80 86

  
87
#if LIBAVFORMAT_VERSION_MAJOR == 52
88
int av_metadata_set(AVMetadata **pm, const char *key, const char *value)
89
{
90
    return av_metadata_set2(pm, key, value, 0);
91
}
92
#endif
93

  
81 94
void av_metadata_free(AVMetadata **pm)
82 95
{
83 96
    AVMetadata *m= *pm;

Also available in: Unified diff