Mercurial > libavformat.hg
comparison utils.c @ 4624:3dfd5f8c63ee libavformat
use new metadata API in libavformat/utils.c
| author | aurel |
|---|---|
| date | Sun, 01 Mar 2009 15:38:06 +0000 |
| parents | 108bb305ba6f |
| children | 166d293b44fa |
comparison
equal
deleted
inserted
replaced
| 4623:993860d53040 | 4624:3dfd5f8c63ee |
|---|---|
| 2413 if(!chapter) | 2413 if(!chapter) |
| 2414 return NULL; | 2414 return NULL; |
| 2415 dynarray_add(&s->chapters, &s->nb_chapters, chapter); | 2415 dynarray_add(&s->chapters, &s->nb_chapters, chapter); |
| 2416 } | 2416 } |
| 2417 av_free(chapter->title); | 2417 av_free(chapter->title); |
| 2418 chapter->title = av_strdup(title); | 2418 av_metadata_set(&chapter->metadata, "title", title); |
| 2419 chapter->id = id; | 2419 chapter->id = id; |
| 2420 chapter->time_base= time_base; | 2420 chapter->time_base= time_base; |
| 2421 chapter->start = start; | 2421 chapter->start = start; |
| 2422 chapter->end = end; | 2422 chapter->end = end; |
| 2423 | 2423 |
| 2806 { | 2806 { |
| 2807 char buf[256]; | 2807 char buf[256]; |
| 2808 int flags = (is_output ? ic->oformat->flags : ic->iformat->flags); | 2808 int flags = (is_output ? ic->oformat->flags : ic->iformat->flags); |
| 2809 AVStream *st = ic->streams[i]; | 2809 AVStream *st = ic->streams[i]; |
| 2810 int g = av_gcd(st->time_base.num, st->time_base.den); | 2810 int g = av_gcd(st->time_base.num, st->time_base.den); |
| 2811 AVMetadataTag *lang = av_metadata_get(st->metadata, "language", NULL, 0); | |
| 2811 avcodec_string(buf, sizeof(buf), st->codec, is_output); | 2812 avcodec_string(buf, sizeof(buf), st->codec, is_output); |
| 2812 av_log(NULL, AV_LOG_INFO, " Stream #%d.%d", index, i); | 2813 av_log(NULL, AV_LOG_INFO, " Stream #%d.%d", index, i); |
| 2813 /* the pid is an important information, so we display it */ | 2814 /* the pid is an important information, so we display it */ |
| 2814 /* XXX: add a generic system */ | 2815 /* XXX: add a generic system */ |
| 2815 if (flags & AVFMT_SHOW_IDS) | 2816 if (flags & AVFMT_SHOW_IDS) |
| 2816 av_log(NULL, AV_LOG_INFO, "[0x%x]", st->id); | 2817 av_log(NULL, AV_LOG_INFO, "[0x%x]", st->id); |
| 2817 if (strlen(st->language) > 0) | 2818 if (lang) |
| 2818 av_log(NULL, AV_LOG_INFO, "(%s)", st->language); | 2819 av_log(NULL, AV_LOG_INFO, "(%s)", lang->value); |
| 2819 av_log(NULL, AV_LOG_DEBUG, ", %d/%d", st->time_base.num/g, st->time_base.den/g); | 2820 av_log(NULL, AV_LOG_DEBUG, ", %d/%d", st->time_base.num/g, st->time_base.den/g); |
| 2820 av_log(NULL, AV_LOG_INFO, ": %s", buf); | 2821 av_log(NULL, AV_LOG_INFO, ": %s", buf); |
| 2821 if (st->sample_aspect_ratio.num && // default | 2822 if (st->sample_aspect_ratio.num && // default |
| 2822 av_cmp_q(st->sample_aspect_ratio, st->codec->sample_aspect_ratio)) { | 2823 av_cmp_q(st->sample_aspect_ratio, st->codec->sample_aspect_ratio)) { |
| 2823 AVRational display_aspect_ratio; | 2824 AVRational display_aspect_ratio; |
| 2884 av_log(NULL, AV_LOG_INFO, "\n"); | 2885 av_log(NULL, AV_LOG_INFO, "\n"); |
| 2885 } | 2886 } |
| 2886 if(ic->nb_programs) { | 2887 if(ic->nb_programs) { |
| 2887 int j, k; | 2888 int j, k; |
| 2888 for(j=0; j<ic->nb_programs; j++) { | 2889 for(j=0; j<ic->nb_programs; j++) { |
| 2890 AVMetadataTag *name = av_metadata_get(ic->programs[j]->metadata, | |
| 2891 "name", NULL, 0); | |
| 2889 av_log(NULL, AV_LOG_INFO, " Program %d %s\n", ic->programs[j]->id, | 2892 av_log(NULL, AV_LOG_INFO, " Program %d %s\n", ic->programs[j]->id, |
| 2890 ic->programs[j]->name ? ic->programs[j]->name : ""); | 2893 name ? name->value : ""); |
| 2891 for(k=0; k<ic->programs[j]->nb_stream_indexes; k++) | 2894 for(k=0; k<ic->programs[j]->nb_stream_indexes; k++) |
| 2892 dump_stream_format(ic, ic->programs[j]->stream_index[k], index, is_output); | 2895 dump_stream_format(ic, ic->programs[j]->stream_index[k], index, is_output); |
| 2893 } | 2896 } |
| 2894 } else | 2897 } else |
| 2895 for(i=0;i<ic->nb_streams;i++) | 2898 for(i=0;i<ic->nb_streams;i++) |
