aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorAurelien Jacobs <aurel@gnuage.org>2009-02-27 23:10:34 +0000
committerAurelien Jacobs <aurel@gnuage.org>2009-02-27 23:10:34 +0000
commit00798e456376a33bd3cfe1ff01082673db6feab9 (patch)
tree055c2533196d9f0cc61f36c9aca8d65f87786e10 /libavformat
parentc27516003fb01b7e0cde9d5bbe4f2cbb747005ce (diff)
downloadffmpeg-00798e456376a33bd3cfe1ff01082673db6feab9.tar.gz
use new metadata API in nut demuxer
Originally committed as revision 17652 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/nutdec.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index 02d828a67e..2243d001d9 100644
--- a/libavformat/nutdec.c
+++ b/libavformat/nutdec.c
@@ -20,6 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <strings.h>
#include "libavutil/avstring.h"
#include "libavutil/bswap.h"
#include "libavutil/tree.h"
@@ -395,6 +396,7 @@ static int decode_info_header(NUTContext *nut){
char name[256], str_value[1024], type_str[256];
const char *type;
AVChapter *chapter= NULL;
+ AVStream *st= NULL;
end= get_packetheader(nut, bc, 1, INFO_STARTCODE);
end += url_ftell(bc);
@@ -410,7 +412,8 @@ static int decode_info_header(NUTContext *nut){
chapter= ff_new_chapter(s, chapter_id,
nut->time_base[chapter_start % nut->time_base_count],
start, start + chapter_len, NULL);
- }
+ } else if(stream_id_plus1)
+ st= s->streams[stream_id_plus1 - 1];
for(i=0; i<count; i++){
get_str(bc, name, sizeof(name));
@@ -440,21 +443,16 @@ static int decode_info_header(NUTContext *nut){
continue;
}
- if(chapter_id==0 && !strcmp(type, "UTF-8")){
- if (!strcmp(name, "Author"))
- av_strlcpy(s->author , str_value, sizeof(s->author));
- else if(!strcmp(name, "Title"))
- av_strlcpy(s->title , str_value, sizeof(s->title));
- else if(!strcmp(name, "Copyright"))
- av_strlcpy(s->copyright, str_value, sizeof(s->copyright));
- else if(!strcmp(name, "Description"))
- av_strlcpy(s->comment , str_value, sizeof(s->comment));
- else if(!strcmp(name, "Disposition"))
+ if(!strcmp(type, "UTF-8")){
+ AVMetadata **metadata = NULL;
+ if(chapter_id==0 && !strcmp(name, "Disposition"))
set_disposition_bits(s, str_value, stream_id_plus1 - 1);
- }
- if(chapter && !strcmp(type, "UTF-8")){
- if(!strcmp(name, "Title"))
- chapter->title= av_strdup(str_value);
+ else if(chapter) metadata= &chapter->metadata;
+ else if(stream_id_plus1) metadata= &st->metadata;
+ else metadata= &s->metadata;
+ if(metadata && strcasecmp(name,"Uses")
+ && strcasecmp(name,"Depends") && strcasecmp(name,"Replaces"))
+ av_metadata_set(metadata, name, str_value);
}
}