diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-10-12 05:33:52 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-10-12 05:40:57 +0200 |
commit | b81f8880e010ccdef3604d9beb681d3c4c6a7bc0 (patch) | |
tree | 0a6534f8fd2d53e84f6b5716047e473b1598cd3d /libavformat | |
parent | b75d89a4784e027cec99236d58e9bd4121ec4309 (diff) | |
parent | 5f3fb599536dd5bceb1d45cb73cd0b0ce3e5560c (diff) | |
download | ffmpeg-b81f8880e010ccdef3604d9beb681d3c4c6a7bc0.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master: (23 commits)
fix AC3ENC_OPT_MODE_ON/OFF
h264: fix HRD parameters parsing
prores: implement multithreading.
prores: idct sse2/sse4 optimizations.
swscale: use aligned move for storage into temporary buffer.
prores: extract idct into its own dspcontext and merge with put_pixels.
h264: fix invalid shifts in init_cavlc_level_tab()
intfloat_readwrite: fix signed addition overflows
mov: do not misreport empty stts
mov: cosmetics, fix for and if spacing
id3v2: fix NULL pointer dereference
mov: read album_artist atom
mov: fix disc/track numbers and totals
doc: fix references to obsolete presets directories for avconv/ffmpeg
flashsv: return more meaningful error value
flashsv: fix typo in av_log() message
smacker: validate channels and sample format.
smacker: check buffer size before reading output size
smacker: validate number of channels
smacker: Separate audio flags from sample rates in smacker demuxer.
...
Conflicts:
cmdutils.h
doc/ffmpeg.texi
libavcodec/Makefile
libavcodec/motion_est_template.c
libavformat/id3v2.c
libavformat/mov.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/id3v2.c | 12 | ||||
-rw-r--r-- | libavformat/mov.c | 117 | ||||
-rw-r--r-- | libavformat/smacker.c | 31 |
3 files changed, 86 insertions, 74 deletions
diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c index 48124cee84..22a2df79e0 100644 --- a/libavformat/id3v2.c +++ b/libavformat/id3v2.c @@ -360,7 +360,7 @@ static void ff_id3v2_parse(AVFormatContext *s, int len, uint8_t version, uint8_t AVIOContext *pbx; unsigned char *buffer = NULL; int buffer_size = 0; - void (*extra_func)(AVFormatContext*, AVIOContext*, int, char*, ID3v2ExtraMeta**) = NULL; + const ID3v2EMFunc *extra_func; switch (version) { case 2: @@ -432,7 +432,7 @@ static void ff_id3v2_parse(AVFormatContext *s, int len, uint8_t version, uint8_t av_log(s, AV_LOG_WARNING, "Skipping encrypted/compressed ID3v2 frame %s.\n", tag); avio_skip(s->pb, tlen); /* check for text tag or supported special meta tag */ - } else if (tag[0] == 'T' || (extra_meta && (extra_func = get_extra_meta_func(tag, isv34)->read))) { + } else if (tag[0] == 'T' || (extra_meta && (extra_func = get_extra_meta_func(tag, isv34)))) { if (unsync || tunsync) { int i, j; av_fast_malloc(&buffer, &buffer_size, tlen); @@ -458,7 +458,7 @@ static void ff_id3v2_parse(AVFormatContext *s, int len, uint8_t version, uint8_t read_ttag(s, pbx, tlen, tag); else /* parse special meta tag */ - extra_func(s, pbx, tlen, tag, extra_meta); + extra_func->read(s, pbx, tlen, tag, extra_meta); } else if (!tag[0]) { if (tag[1]) @@ -521,11 +521,11 @@ void ff_id3v2_read(AVFormatContext *s, const char *magic) void ff_id3v2_free_extra_meta(ID3v2ExtraMeta **extra_meta) { ID3v2ExtraMeta *current = *extra_meta, *next; - void (*free_func)(void *); + const ID3v2EMFunc *extra_func; while (current) { - if ((free_func = get_extra_meta_func(current->tag, 1)->free)) - free_func(current->data); + if ((extra_func = get_extra_meta_func(current->tag, 1))) + extra_func->free(current->data); next = current->next; av_freep(¤t); current = next; diff --git a/libavformat/mov.c b/libavformat/mov.c index f4c4dbc7d2..87b6a4905a 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -81,15 +81,20 @@ typedef struct MOVParseTableEntry { static const MOVParseTableEntry mov_default_parse_table[]; -static int mov_metadata_track_or_disc_number(MOVContext *c, AVIOContext *pb, unsigned len, const char *type) +static int mov_metadata_track_or_disc_number(MOVContext *c, AVIOContext *pb, + unsigned len, const char *key) { char buf[16]; + short current, total; avio_rb16(pb); // unknown - snprintf(buf, sizeof(buf), "%d", avio_rb16(pb)); - av_dict_set(&c->fc->metadata, type, buf, 0); - - avio_rb16(pb); // total tracks/discs + current = avio_rb16(pb); + total = avio_rb16(pb); + if (!total) + snprintf(buf, sizeof(buf), "%d", current); + else + snprintf(buf, sizeof(buf), "%d/%d", current, total); + av_dict_set(&c->fc->metadata, key, buf, 0); return 0; } @@ -140,13 +145,13 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom) const char *key = NULL; uint16_t str_size, langcode = 0; uint32_t data_type = 0; - int (*parse)(MOVContext*, AVIOContext*, unsigned, const char *) = NULL; + int (*parse)(MOVContext*, AVIOContext*, unsigned, const char*) = NULL; switch (atom.type) { case MKTAG(0xa9,'n','a','m'): key = "title"; break; case MKTAG(0xa9,'a','u','t'): case MKTAG(0xa9,'A','R','T'): key = "artist"; break; - case MKTAG( 'a','A','R','T'): key = "album_artist";break; + case MKTAG( 'a','A','R','T'): key = "album_artist"; break; case MKTAG(0xa9,'w','r','t'): key = "composer"; break; case MKTAG( 'c','p','r','t'): case MKTAG(0xa9,'c','p','y'): key = "copyright"; break; @@ -268,7 +273,7 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom) int (*parse)(MOVContext*, AVIOContext*, MOVAtom) = NULL; a.size = atom.size; a.type=0; - if(atom.size >= 8) { + if (atom.size >= 8) { a.size = avio_rb32(pb); a.type = avio_rl32(pb); } @@ -285,7 +290,7 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom) break; } a.size -= 8; - if(a.size < 0) + if (a.size < 0) break; a.size = FFMIN(a.size, atom.size - total_size); @@ -452,11 +457,11 @@ static int mov_read_hdlr(MOVContext *c, AVIOContext *pb, MOVAtom atom) if (type == MKTAG('v','i','d','e')) st->codec->codec_type = AVMEDIA_TYPE_VIDEO; - else if(type == MKTAG('s','o','u','n')) + else if (type == MKTAG('s','o','u','n')) st->codec->codec_type = AVMEDIA_TYPE_AUDIO; - else if(type == MKTAG('m','1','a',' ')) + else if (type == MKTAG('m','1','a',' ')) st->codec->codec_id = CODEC_ID_MP2; - else if((type == MKTAG('s','u','b','p')) || (type == MKTAG('c','l','c','p'))) + else if ((type == MKTAG('s','u','b','p')) || (type == MKTAG('c','l','c','p'))) st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE; avio_rb32(pb); /* component manufacture */ @@ -553,7 +558,7 @@ static int mov_read_pasp(MOVContext *c, AVIOContext *pb, MOVAtom atom) /* this atom contains actual media data */ static int mov_read_mdat(MOVContext *c, AVIOContext *pb, MOVAtom atom) { - if(atom.size == 0) /* wrong one (MP4) */ + if (atom.size == 0) /* wrong one (MP4) */ return 0; c->found_mdat=1; return 0; /* now go for moov */ @@ -707,7 +712,7 @@ static int mov_read_smi(MOVContext *c, AVIOContext *pb, MOVAtom atom) return 0; st = c->fc->streams[c->fc->nb_streams-1]; - if((uint64_t)atom.size > (1<<30)) + if ((uint64_t)atom.size > (1<<30)) return -1; // currently SVQ3 decoder expect full STSD header - so let's fake it @@ -771,10 +776,10 @@ static int mov_read_extradata(MOVContext *c, AVIOContext *pb, MOVAtom atom, return 0; /* unexpected codec_id - don't mess with extradata */ size= (uint64_t)st->codec->extradata_size + atom.size + 8 + FF_INPUT_BUFFER_PADDING_SIZE; - if(size > INT_MAX || (uint64_t)atom.size > INT_MAX) + if (size > INT_MAX || (uint64_t)atom.size > INT_MAX) return -1; buf= av_realloc(st->codec->extradata, size); - if(!buf) + if (!buf) return -1; st->codec->extradata= buf; buf+= st->codec->extradata_size; @@ -814,7 +819,7 @@ static int mov_read_wave(MOVContext *c, AVIOContext *pb, MOVAtom atom) return 0; st = c->fc->streams[c->fc->nb_streams-1]; - if((uint64_t)atom.size > (1<<30)) + if ((uint64_t)atom.size > (1<<30)) return -1; if (st->codec->codec_id == CODEC_ID_QDM2 || st->codec->codec_id == CODEC_ID_QDMC) { @@ -845,7 +850,7 @@ static int mov_read_glbl(MOVContext *c, AVIOContext *pb, MOVAtom atom) return 0; st = c->fc->streams[c->fc->nb_streams-1]; - if((uint64_t)atom.size > (1<<30)) + if ((uint64_t)atom.size > (1<<30)) return -1; av_free(st->codec->extradata); @@ -872,7 +877,7 @@ static int mov_read_strf(MOVContext *c, AVIOContext *pb, MOVAtom atom) return 0; st = c->fc->streams[c->fc->nb_streams-1]; - if((uint64_t)atom.size > (1<<30)) + if ((uint64_t)atom.size > (1<<30)) return -1; av_free(st->codec->extradata); @@ -901,7 +906,7 @@ static int mov_read_stco(MOVContext *c, AVIOContext *pb, MOVAtom atom) entries = avio_rb32(pb); - if(entries >= UINT_MAX/sizeof(int64_t)) + if (entries >= UINT_MAX/sizeof(int64_t)) return -1; sc->chunk_offsets = av_malloc(entries * sizeof(int64_t)); @@ -910,10 +915,10 @@ static int mov_read_stco(MOVContext *c, AVIOContext *pb, MOVAtom atom) sc->chunk_count = entries; if (atom.type == MKTAG('s','t','c','o')) - for(i=0; i<entries; i++) + for (i=0; i<entries; i++) sc->chunk_offsets[i] = avio_rb32(pb); else if (atom.type == MKTAG('c','o','6','4')) - for(i=0; i<entries; i++) + for (i=0; i<entries; i++) sc->chunk_offsets[i] = avio_rb64(pb); else return -1; @@ -967,7 +972,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries) st = c->fc->streams[c->fc->nb_streams-1]; sc = st->priv_data; - for(pseudo_stream_id=0; pseudo_stream_id<entries; pseudo_stream_id++) { + for (pseudo_stream_id=0; pseudo_stream_id<entries; pseudo_stream_id++) { //Parsing Sample description table enum CodecID id; int dref_id = 1; @@ -1015,9 +1020,9 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries) id = ff_codec_get_id(ff_codec_bmp_tags, format); if (id > 0) st->codec->codec_type = AVMEDIA_TYPE_VIDEO; - else if(st->codec->codec_type == AVMEDIA_TYPE_DATA){ + else if (st->codec->codec_type == AVMEDIA_TYPE_DATA){ id = ff_codec_get_id(ff_codec_movsubtitle_tags, format); - if(id > 0) + if (id > 0) st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE; } } @@ -1026,7 +1031,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries) (format >> 0) & 0xff, (format >> 8) & 0xff, (format >> 16) & 0xff, (format >> 24) & 0xff, st->codec->codec_type); - if(st->codec->codec_type==AVMEDIA_TYPE_VIDEO) { + if (st->codec->codec_type==AVMEDIA_TYPE_VIDEO) { unsigned int color_depth, len; int color_greyscale; @@ -1132,7 +1137,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries) } sc->has_palette = 1; } - } else if(st->codec->codec_type==AVMEDIA_TYPE_AUDIO) { + } else if (st->codec->codec_type==AVMEDIA_TYPE_AUDIO) { int bits_per_sample, flags; uint16_t version = avio_rb16(pb); @@ -1151,13 +1156,13 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries) //Read QT version 1 fields. In version 0 these do not exist. av_dlog(c->fc, "version =%d, isom =%d\n",version,c->isom); - if(!c->isom) { - if(version==1) { + if (!c->isom) { + if (version==1) { sc->samples_per_frame = avio_rb32(pb); avio_rb32(pb); /* bytes per packet */ sc->bytes_per_frame = avio_rb32(pb); avio_rb32(pb); /* bytes per sample */ - } else if(version==2) { + } else if (version==2) { avio_rb32(pb); /* sizeof struct only */ st->codec->sample_rate = av_int2dbl(avio_rb64(pb)); /* float 64 */ st->codec->channels = avio_rb32(pb); @@ -1212,7 +1217,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries) st->codec->bits_per_coded_sample = bits_per_sample; sc->sample_size = (bits_per_sample >> 3) * st->codec->channels; } - } else if(st->codec->codec_type==AVMEDIA_TYPE_SUBTITLE){ + } else if (st->codec->codec_type==AVMEDIA_TYPE_SUBTITLE){ // ttxt stsd contains display flags, justification, background // color, fonts, and default styles, so fake an atom to read it MOVAtom fake_atom = { .size = size - (avio_tell(pb) - start_pos) }; @@ -1245,7 +1250,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries) avio_skip(pb, a.size); } - if(st->codec->codec_type==AVMEDIA_TYPE_AUDIO && st->codec->sample_rate==0 && sc->time_scale>1) + if (st->codec->codec_type==AVMEDIA_TYPE_AUDIO && st->codec->sample_rate==0 && sc->time_scale>1) st->codec->sample_rate= sc->time_scale; /* special codec parameters handling */ @@ -1337,14 +1342,14 @@ static int mov_read_stsc(MOVContext *c, AVIOContext *pb, MOVAtom atom) av_dlog(c->fc, "track[%i].stsc.entries = %i\n", c->fc->nb_streams-1, entries); - if(entries >= UINT_MAX / sizeof(*sc->stsc_data)) + if (entries >= UINT_MAX / sizeof(*sc->stsc_data)) return -1; sc->stsc_data = av_malloc(entries * sizeof(*sc->stsc_data)); if (!sc->stsc_data) return AVERROR(ENOMEM); sc->stsc_count = entries; - for(i=0; i<entries; i++) { + for (i=0; i<entries; i++) { sc->stsc_data[i].first = avio_rb32(pb); sc->stsc_data[i].count = avio_rb32(pb); sc->stsc_data[i].id = avio_rb32(pb); @@ -1399,14 +1404,14 @@ static int mov_read_stss(MOVContext *c, AVIOContext *pb, MOVAtom atom) av_dlog(c->fc, "keyframe_count = %d\n", entries); - if(entries >= UINT_MAX / sizeof(int)) + if (entries >= UINT_MAX / sizeof(int)) return -1; sc->keyframes = av_malloc(entries * sizeof(int)); if (!sc->keyframes) return AVERROR(ENOMEM); sc->keyframe_count = entries; - for(i=0; i<entries; i++) { + for (i=0; i<entries; i++) { sc->keyframes[i] = avio_rb32(pb); //av_dlog(c->fc, "keyframes[]=%d\n", sc->keyframes[i]); } @@ -1474,7 +1479,7 @@ static int mov_read_stsz(MOVContext *c, AVIOContext *pb, MOVAtom atom) init_get_bits(&gb, buf, 8*num_bytes); - for(i=0; i<entries; i++) + for (i=0; i<entries; i++) sc->sample_sizes[i] = get_bits_long(&gb, field_size); av_free(buf); @@ -1498,16 +1503,19 @@ static int mov_read_stts(MOVContext *c, AVIOContext *pb, MOVAtom atom) avio_rb24(pb); /* flags */ entries = avio_rb32(pb); - av_dlog(c->fc, "track[%i].stts.entries = %i\n", c->fc->nb_streams-1, entries); + av_dlog(c->fc, "track[%i].stts.entries = %i\n", + c->fc->nb_streams-1, entries); + + if (!entries || entries >= UINT_MAX / sizeof(*sc->stts_data)) + return AVERROR(EINVAL); - if(entries >= UINT_MAX / sizeof(*sc->stts_data)) - return -1; sc->stts_data = av_malloc(entries * sizeof(*sc->stts_data)); if (!sc->stts_data) return AVERROR(ENOMEM); + sc->stts_count = entries; - for(i=0; i<entries; i++) { + for (i=0; i<entries; i++) { int sample_duration; int sample_count; @@ -1521,14 +1529,15 @@ static int mov_read_stts(MOVContext *c, AVIOContext *pb, MOVAtom atom) sc->stts_data[i].count= sample_count; sc->stts_data[i].duration= sample_duration; - av_dlog(c->fc, "sample_count=%d, sample_duration=%d\n",sample_count,sample_duration); + av_dlog(c->fc, "sample_count=%d, sample_duration=%d\n", + sample_count, sample_duration); duration+=(int64_t)sample_duration*sample_count; total_sample_count+=sample_count; } st->nb_frames= total_sample_count; - if(duration) + if (duration) st->duration= duration; return 0; } @@ -1550,14 +1559,14 @@ static int mov_read_ctts(MOVContext *c, AVIOContext *pb, MOVAtom atom) av_dlog(c->fc, "track[%i].ctts.entries = %i\n", c->fc->nb_streams-1, entries); - if(entries >= UINT_MAX / sizeof(*sc->ctts_data)) + if (entries >= UINT_MAX / sizeof(*sc->ctts_data)) return -1; sc->ctts_data = av_malloc(entries * sizeof(*sc->ctts_data)); if (!sc->ctts_data) return AVERROR(ENOMEM); sc->ctts_count = entries; - for(i=0; i<entries; i++) { + for (i=0; i<entries; i++) { int count =avio_rb32(pb); int duration =avio_rb32(pb); @@ -1640,7 +1649,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st) if (keyframe) distance = 0; sample_size = sc->sample_size > 0 ? sc->sample_size : sc->sample_sizes[current_sample]; - if(sc->pseudo_stream_id == -1 || + if (sc->pseudo_stream_id == -1 || sc->stsc_data[stsc_index].id - 1 == sc->pseudo_stream_id) { AVIndexEntry *e = &st->index_entries[st->nb_index_entries++]; e->pos = current_offset; @@ -2209,9 +2218,9 @@ static int mov_read_cmov(MOVContext *c, AVIOContext *pb, MOVAtom atom) return AVERROR(ENOMEM); } avio_read(pb, cmov_data, cmov_len); - if(uncompress (moov_data, (uLongf *) &moov_len, (const Bytef *)cmov_data, cmov_len) != Z_OK) + if (uncompress (moov_data, (uLongf *) &moov_len, (const Bytef *)cmov_data, cmov_len) != Z_OK) goto free_and_return; - if(ffio_init_context(&ctx, moov_data, moov_len, 0, NULL, NULL, NULL, NULL) != 0) + if (ffio_init_context(&ctx, moov_data, moov_len, 0, NULL, NULL, NULL, NULL) != 0) goto free_and_return; atom.type = MKTAG('m','o','o','v'); atom.size = moov_len; @@ -2240,10 +2249,10 @@ static int mov_read_elst(MOVContext *c, AVIOContext *pb, MOVAtom atom) avio_rb24(pb); /* flags */ edit_count = avio_rb32(pb); /* entries */ - if((uint64_t)edit_count*12+8 > atom.size) + if ((uint64_t)edit_count*12+8 > atom.size) return -1; - for(i=0; i<edit_count; i++){ + for (i=0; i<edit_count; i++){ int64_t time; int64_t duration; if (version == 1) { @@ -2259,7 +2268,7 @@ static int mov_read_elst(MOVContext *c, AVIOContext *pb, MOVAtom atom) } } - if(edit_count > 1) + if (edit_count > 1) av_log(c->fc, AV_LOG_WARNING, "multiple edit list entries, " "a/v desync might occur, patch welcome\n"); @@ -2342,7 +2351,7 @@ static int mov_probe(AVProbeData *p) /* check file header */ offset = 0; - for(;;) { + for (;;) { /* ignore invalid offset */ if ((offset + 8) > (unsigned int)p->buf_size) return score; @@ -2450,7 +2459,7 @@ static int mov_read_header(AVFormatContext *s, AVFormatParameters *ap) mov->fc = s; /* .mov and .mp4 aren't streamable anyway (only progressive download if moov is before mdat) */ - if(pb->seekable) + if (pb->seekable) atom.size = avio_size(pb); else atom.size = INT64_MAX; @@ -2661,7 +2670,7 @@ static int mov_read_close(AVFormatContext *s) } if (mov->dv_demux) { - for(i = 0; i < mov->dv_fctx->nb_streams; i++) { + for (i = 0; i < mov->dv_fctx->nb_streams; i++) { av_freep(&mov->dv_fctx->streams[i]->codec); av_freep(&mov->dv_fctx->streams[i]); } diff --git a/libavformat/smacker.c b/libavformat/smacker.c index 347ee4e709..c2239b2845 100644 --- a/libavformat/smacker.c +++ b/libavformat/smacker.c @@ -31,11 +31,11 @@ #define SMACKER_FLAG_RING_FRAME 0x01 enum SAudFlags { - SMK_AUD_PACKED = 0x80000000, - SMK_AUD_16BITS = 0x20000000, - SMK_AUD_STEREO = 0x10000000, - SMK_AUD_BINKAUD = 0x08000000, - SMK_AUD_USEDCT = 0x04000000 + SMK_AUD_PACKED = 0x80, + SMK_AUD_16BITS = 0x20, + SMK_AUD_STEREO = 0x10, + SMK_AUD_BINKAUD = 0x08, + SMK_AUD_USEDCT = 0x04 }; typedef struct SmackerContext { @@ -48,6 +48,7 @@ typedef struct SmackerContext { uint32_t audio[7]; uint32_t treesize; uint32_t mmap_size, mclr_size, full_size, type_size; + uint8_t aflags[7]; uint32_t rates[7]; uint32_t pad; /* frame info */ @@ -129,8 +130,10 @@ static int smacker_read_header(AVFormatContext *s, AVFormatParameters *ap) smk->mclr_size = avio_rl32(pb); smk->full_size = avio_rl32(pb); smk->type_size = avio_rl32(pb); - for(i = 0; i < 7; i++) - smk->rates[i] = avio_rl32(pb); + for(i = 0; i < 7; i++) { + smk->rates[i] = avio_rl24(pb); + smk->aflags[i] = avio_r8(pb); + } smk->pad = avio_rl32(pb); /* setup data */ if(smk->frames > 0xFFFFFF) { @@ -173,23 +176,23 @@ static int smacker_read_header(AVFormatContext *s, AVFormatParameters *ap) /* handle possible audio streams */ for(i = 0; i < 7; i++) { smk->indexes[i] = -1; - if(smk->rates[i] & 0xFFFFFF){ + if (smk->rates[i]) { ast[i] = av_new_stream(s, 0); smk->indexes[i] = ast[i]->index; ast[i]->codec->codec_type = AVMEDIA_TYPE_AUDIO; - if (smk->rates[i] & SMK_AUD_BINKAUD) { + if (smk->aflags[i] & SMK_AUD_BINKAUD) { ast[i]->codec->codec_id = CODEC_ID_BINKAUDIO_RDFT; - } else if (smk->rates[i] & SMK_AUD_USEDCT) { + } else if (smk->aflags[i] & SMK_AUD_USEDCT) { ast[i]->codec->codec_id = CODEC_ID_BINKAUDIO_DCT; - } else if (smk->rates[i] & SMK_AUD_PACKED){ + } else if (smk->aflags[i] & SMK_AUD_PACKED){ ast[i]->codec->codec_id = CODEC_ID_SMACKAUDIO; ast[i]->codec->codec_tag = MKTAG('S', 'M', 'K', 'A'); } else { ast[i]->codec->codec_id = CODEC_ID_PCM_U8; } - ast[i]->codec->channels = (smk->rates[i] & SMK_AUD_STEREO) ? 2 : 1; - ast[i]->codec->sample_rate = smk->rates[i] & 0xFFFFFF; - ast[i]->codec->bits_per_coded_sample = (smk->rates[i] & SMK_AUD_16BITS) ? 16 : 8; + ast[i]->codec->channels = (smk->aflags[i] & SMK_AUD_STEREO) ? 2 : 1; + ast[i]->codec->sample_rate = smk->rates[i]; + ast[i]->codec->bits_per_coded_sample = (smk->aflags[i] & SMK_AUD_16BITS) ? 16 : 8; if(ast[i]->codec->bits_per_coded_sample == 16 && ast[i]->codec->codec_id == CODEC_ID_PCM_U8) ast[i]->codec->codec_id = CODEC_ID_PCM_S16LE; av_set_pts_info(ast[i], 64, 1, ast[i]->codec->sample_rate |