~ubuntu-branches/ubuntu/lucid/ffmpeg/lucid-security

« back to all changes in this revision

Viewing changes to libavformat/nutdec.c

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2009-03-13 09:18:28 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20090313091828-n4ktby5eca487uhv
Tags: 3:0.svn20090303-1ubuntu1+unstripped1
merge from ubuntu.jaunty branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21
21
 */
22
22
 
 
23
#include <strings.h>
23
24
#include "libavutil/avstring.h"
24
25
#include "libavutil/bswap.h"
25
26
#include "libavutil/tree.h"
395
396
    char name[256], str_value[1024], type_str[256];
396
397
    const char *type;
397
398
    AVChapter *chapter= NULL;
 
399
    AVStream *st= NULL;
398
400
 
399
401
    end= get_packetheader(nut, bc, 1, INFO_STARTCODE);
400
402
    end += url_ftell(bc);
410
412
        chapter= ff_new_chapter(s, chapter_id,
411
413
                                nut->time_base[chapter_start % nut->time_base_count],
412
414
                                start, start + chapter_len, NULL);
413
 
    }
 
415
    } else if(stream_id_plus1)
 
416
        st= s->streams[stream_id_plus1 - 1];
414
417
 
415
418
    for(i=0; i<count; i++){
416
419
        get_str(bc, name, sizeof(name));
440
443
            continue;
441
444
        }
442
445
 
443
 
        if(chapter_id==0 && !strcmp(type, "UTF-8")){
444
 
            if     (!strcmp(name, "Author"))
445
 
                av_strlcpy(s->author   , str_value, sizeof(s->author));
446
 
            else if(!strcmp(name, "Title"))
447
 
                av_strlcpy(s->title    , str_value, sizeof(s->title));
448
 
            else if(!strcmp(name, "Copyright"))
449
 
                av_strlcpy(s->copyright, str_value, sizeof(s->copyright));
450
 
            else if(!strcmp(name, "Description"))
451
 
                av_strlcpy(s->comment  , str_value, sizeof(s->comment));
452
 
            else if(!strcmp(name, "Disposition"))
 
446
        if(!strcmp(type, "UTF-8")){
 
447
            AVMetadata **metadata = NULL;
 
448
            if(chapter_id==0 && !strcmp(name, "Disposition"))
453
449
                set_disposition_bits(s, str_value, stream_id_plus1 - 1);
454
 
        }
455
 
        if(chapter && !strcmp(type, "UTF-8")){
456
 
            if(!strcmp(name, "Title"))
457
 
                chapter->title= av_strdup(str_value);
 
450
            else if(chapter)          metadata= &chapter->metadata;
 
451
            else if(stream_id_plus1)  metadata= &st->metadata;
 
452
            else                      metadata= &s->metadata;
 
453
            if(metadata && strcasecmp(name,"Uses")
 
454
               && strcasecmp(name,"Depends") && strcasecmp(name,"Replaces"))
 
455
                av_metadata_set(metadata, name, str_value);
458
456
        }
459
457
    }
460
458