]> git.sesse.net Git - ffmpeg/commitdiff
Merge commit 'db68ef898a3802e51b6f41fd600d0d46d058e3f8'
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 13 Aug 2014 22:04:42 +0000 (00:04 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 13 Aug 2014 22:05:49 +0000 (00:05 +0200)
* commit 'db68ef898a3802e51b6f41fd600d0d46d058e3f8':
  ogg: update event_flags with STREAM_/METADATA_UPDATED whenever metadata changes.

Conflicts:
libavformat/oggparsevorbis.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavformat/flacdec.c
libavformat/oggdec.h
libavformat/oggparsecelt.c
libavformat/oggparseflac.c
libavformat/oggparseogm.c
libavformat/oggparseopus.c
libavformat/oggparsespeex.c
libavformat/oggparsetheora.c
libavformat/oggparsevorbis.c

Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 8103d9dbb18bd5433592b07bd7614927602fad93,6bd1411cdb1f4f43860fedad2ba77d460e07dc59..5e34be5378d17f90afc3917be9d9bbd70109e020
@@@ -158,13 -170,10 +171,14 @@@ int ff_vorbis_comment(AVFormatContext *
                      continue;
                  }
              } else if (!ogm_chapter(as, tt, ct)) {
+                 updates++;
 +                if (av_dict_get(*m, tt, NULL, 0)) {
 +                    av_dict_set(m, tt, ";", AV_DICT_APPEND);
 +                }
                  av_dict_set(m, tt, ct,
                              AV_DICT_DONT_STRDUP_KEY |
 -                            AV_DICT_DONT_STRDUP_VAL);
 +                            AV_DICT_APPEND);
 +                av_freep(&ct);
              }
          }
      }
@@@ -244,36 -250,6 +258,36 @@@ static void vorbis_cleanup(AVFormatCont
              av_freep(&priv->packet[i]);
  }
  
-     ret = ff_vorbis_comment(s, &st->metadata, os->buf + os->pstart + 7,
-                             os->psize - 8, 1);
 +static int vorbis_update_metadata(AVFormatContext *s, int idx)
 +{
 +    struct ogg *ogg = s->priv_data;
 +    struct ogg_stream *os = ogg->streams + idx;
 +    AVStream *st = s->streams[idx];
 +    int ret;
 +
 +    if (os->psize <= 8)
 +        return 0;
 +
 +    /* New metadata packet; release old data. */
 +    av_dict_free(&st->metadata);
++    ret = ff_vorbis_stream_comment(s, st, os->buf + os->pstart + 7,
++                                   os->psize - 8);
 +    if (ret < 0)
 +        return ret;
 +
 +    /* Update the metadata if possible. */
 +    av_freep(&os->new_metadata);
 +    if (st->metadata) {
 +        os->new_metadata = av_packet_pack_dictionary(st->metadata, &os->new_metadata_size);
 +    /* Send an empty dictionary to indicate that metadata has been cleared. */
 +    } else {
 +        os->new_metadata = av_malloc(1);
 +        os->new_metadata_size = 0;
 +    }
 +
 +    return ret;
 +}
 +
  static int vorbis_header(AVFormatContext *s, int idx)
  {
      struct ogg *ogg = s->priv_data;