mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-05-31 00:47:44 +00:00
Merge remote-tracking branch 'qatar/master'
* qatar/master: crypto: Use av_freep instead of av_free lavf: don't try to free private options if priv_data is NULL. swscale: fix types of assembly arguments. swscale: move two macros that are only used once into caller. swscale: remove unused function. options: Add missing braces around struct initializer. mov: Remove leftover crufty debug statement with references to a local file. dvbsubdec: Fix compilation of debug code. Remove all uses of now deprecated metadata functions. Move metadata API from lavf to lavu. Conflicts: doc/APIchanges libavformat/aiffdec.c libavformat/asfdec.c libavformat/avformat.h libavformat/avidec.c libavformat/cafdec.c libavformat/matroskaenc.c libavformat/mov.c libavformat/mp3enc.c libavformat/wtv.c libavutil/avutil.h libavutil/internal.h libswscale/swscale.c libswscale/x86/swscale_template.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
f9ecb849ef
65 changed files with 565 additions and 414 deletions
|
@ -27,6 +27,7 @@
|
|||
#include "libavcodec/internal.h"
|
||||
#include "libavcodec/raw.h"
|
||||
#include "libavutil/opt.h"
|
||||
#include "libavutil/dict.h"
|
||||
#include "metadata.h"
|
||||
#include "id3v2.h"
|
||||
#include "libavutil/avstring.h"
|
||||
|
@ -2593,7 +2594,7 @@ void avformat_free_context(AVFormatContext *s)
|
|||
AVStream *st;
|
||||
|
||||
av_opt_free(s);
|
||||
if (s->iformat && s->iformat->priv_class)
|
||||
if (s->iformat && s->iformat->priv_class && s->priv_data)
|
||||
av_opt_free(s->priv_data);
|
||||
|
||||
for(i=0;i<s->nb_streams;i++) {
|
||||
|
@ -2603,7 +2604,7 @@ void avformat_free_context(AVFormatContext *s)
|
|||
av_parser_close(st->parser);
|
||||
av_free_packet(&st->cur_pkt);
|
||||
}
|
||||
av_metadata_free(&st->metadata);
|
||||
av_dict_free(&st->metadata);
|
||||
av_free(st->index_entries);
|
||||
av_free(st->codec->extradata);
|
||||
av_free(st->codec->subtitle_header);
|
||||
|
@ -2613,18 +2614,18 @@ void avformat_free_context(AVFormatContext *s)
|
|||
av_free(st);
|
||||
}
|
||||
for(i=s->nb_programs-1; i>=0; i--) {
|
||||
av_metadata_free(&s->programs[i]->metadata);
|
||||
av_dict_free(&s->programs[i]->metadata);
|
||||
av_freep(&s->programs[i]->stream_index);
|
||||
av_freep(&s->programs[i]);
|
||||
}
|
||||
av_freep(&s->programs);
|
||||
av_freep(&s->priv_data);
|
||||
while(s->nb_chapters--) {
|
||||
av_metadata_free(&s->chapters[s->nb_chapters]->metadata);
|
||||
av_dict_free(&s->chapters[s->nb_chapters]->metadata);
|
||||
av_free(s->chapters[s->nb_chapters]);
|
||||
}
|
||||
av_freep(&s->chapters);
|
||||
av_metadata_free(&s->metadata);
|
||||
av_dict_free(&s->metadata);
|
||||
av_freep(&s->streams);
|
||||
av_free(s);
|
||||
}
|
||||
|
@ -2728,7 +2729,7 @@ AVChapter *ff_new_chapter(AVFormatContext *s, int id, AVRational time_base, int6
|
|||
return NULL;
|
||||
dynarray_add(&s->chapters, &s->nb_chapters, chapter);
|
||||
}
|
||||
av_metadata_set2(&chapter->metadata, "title", title, 0);
|
||||
av_dict_set(&chapter->metadata, "title", title, 0);
|
||||
chapter->id = id;
|
||||
chapter->time_base= time_base;
|
||||
chapter->start = start;
|
||||
|
@ -2923,7 +2924,7 @@ int av_write_header(AVFormatContext *s)
|
|||
|
||||
/* set muxer identification string */
|
||||
if (s->nb_streams && !(s->streams[0]->codec->flags & CODEC_FLAG_BITEXACT)) {
|
||||
av_metadata_set2(&s->metadata, "encoder", LIBAVFORMAT_IDENT, 0);
|
||||
av_dict_set(&s->metadata, "encoder", LIBAVFORMAT_IDENT, 0);
|
||||
}
|
||||
|
||||
if(s->oformat->write_header){
|
||||
|
@ -3245,13 +3246,13 @@ static void print_fps(double d, const char *postfix){
|
|||
else av_log(NULL, AV_LOG_INFO, ", %1.0fk %s", d/1000, postfix);
|
||||
}
|
||||
|
||||
static void dump_metadata(void *ctx, AVMetadata *m, const char *indent)
|
||||
static void dump_metadata(void *ctx, AVDictionary *m, const char *indent)
|
||||
{
|
||||
if(m && !(m->count == 1 && av_metadata_get(m, "language", NULL, 0))){
|
||||
AVMetadataTag *tag=NULL;
|
||||
if(m && !(m->count == 1 && av_dict_get(m, "language", NULL, 0))){
|
||||
AVDictionaryEntry *tag=NULL;
|
||||
|
||||
av_log(ctx, AV_LOG_INFO, "%sMetadata:\n", indent);
|
||||
while((tag=av_metadata_get(m, "", tag, AV_METADATA_IGNORE_SUFFIX))) {
|
||||
while((tag=av_dict_get(m, "", tag, AV_DICT_IGNORE_SUFFIX))) {
|
||||
if(strcmp("language", tag->key))
|
||||
av_log(ctx, AV_LOG_INFO, "%s %-16s: %s\n", indent, tag->key, tag->value);
|
||||
}
|
||||
|
@ -3265,7 +3266,7 @@ static void dump_stream_format(AVFormatContext *ic, int i, int index, int is_out
|
|||
int flags = (is_output ? ic->oformat->flags : ic->iformat->flags);
|
||||
AVStream *st = ic->streams[i];
|
||||
int g = av_gcd(st->time_base.num, st->time_base.den);
|
||||
AVMetadataTag *lang = av_metadata_get(st->metadata, "language", NULL, 0);
|
||||
AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL, 0);
|
||||
avcodec_string(buf, sizeof(buf), st->codec, is_output);
|
||||
av_log(NULL, AV_LOG_INFO, " Stream #%d.%d", index, i);
|
||||
/* the pid is an important information, so we display it */
|
||||
|
@ -3389,7 +3390,7 @@ void av_dump_format(AVFormatContext *ic,
|
|||
if(ic->nb_programs) {
|
||||
int j, k, total = 0;
|
||||
for(j=0; j<ic->nb_programs; j++) {
|
||||
AVMetadataTag *name = av_metadata_get(ic->programs[j]->metadata,
|
||||
AVDictionaryEntry *name = av_dict_get(ic->programs[j]->metadata,
|
||||
"name", NULL, 0);
|
||||
av_log(NULL, AV_LOG_INFO, " Program %d %s\n", ic->programs[j]->id,
|
||||
name ? name->value : "");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue