"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "libavformat/asfdec.c" between
libav-12.tar.gz and libav-12.1.tar.gz

About: libav provides cross-platform tools ("avconv") and libraries to convert, manipulate and stream a wide range of multimedia (audio and video) formats and protocols.

asfdec.c  (libav-12):asfdec.c  (libav-12.1)
skipping to change at line 694 skipping to change at line 694
asf->b_flags = avio_rl32(pb); asf->b_flags = avio_rl32(pb);
avio_skip(pb, 4); // skip minimal packet size avio_skip(pb, 4); // skip minimal packet size
asf->packet_size = avio_rl32(pb); asf->packet_size = avio_rl32(pb);
avio_skip(pb, 4); // skip max_bitrate avio_skip(pb, 4); // skip max_bitrate
return 0; return 0;
} }
static int parse_video_info(AVIOContext *pb, AVStream *st) static int parse_video_info(AVIOContext *pb, AVStream *st)
{ {
uint16_t size; uint16_t size_asf; // ASF-specific Format Data size
uint32_t size_bmp; // BMP_HEADER-specific Format Data size
unsigned int tag; unsigned int tag;
st->codecpar->width = avio_rl32(pb); st->codecpar->width = avio_rl32(pb);
st->codecpar->height = avio_rl32(pb); st->codecpar->height = avio_rl32(pb);
avio_skip(pb, 1); // skip reserved flags avio_skip(pb, 1); // skip reserved flags
size = avio_rl16(pb); // size of the Format Data size_asf = avio_rl16(pb);
tag = ff_get_bmp_header(pb, st); tag = ff_get_bmp_header(pb, st, &size_bmp);
st->codecpar->codec_tag = tag; st->codecpar->codec_tag = tag;
st->codecpar->codec_id = ff_codec_get_id(ff_codec_bmp_tags, tag); st->codecpar->codec_id = ff_codec_get_id(ff_codec_bmp_tags, tag);
size_bmp = FFMAX(size_asf, size_bmp);
if (size > BMP_HEADER_SIZE) { if (size_bmp > BMP_HEADER_SIZE) {
int ret; int ret;
st->codecpar->extradata_size = size - BMP_HEADER_SIZE; st->codecpar->extradata_size = size_bmp - BMP_HEADER_SIZE;
if (!(st->codecpar->extradata = av_malloc(st->codecpar->extradata_size + if (!(st->codecpar->extradata = av_malloc(st->codecpar->extradata_size +
AV_INPUT_BUFFER_PADDING_SIZE))) { AV_INPUT_BUFFER_PADDING_SIZE))) {
st->codecpar->extradata_size = 0; st->codecpar->extradata_size = 0;
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
} }
memset(st->codecpar->extradata + st->codecpar->extradata_size , 0, memset(st->codecpar->extradata + st->codecpar->extradata_size , 0,
AV_INPUT_BUFFER_PADDING_SIZE); AV_INPUT_BUFFER_PADDING_SIZE);
if ((ret = avio_read(pb, st->codecpar->extradata, if ((ret = avio_read(pb, st->codecpar->extradata,
st->codecpar->extradata_size)) < 0) st->codecpar->extradata_size)) < 0)
return ret; return ret;
skipping to change at line 977 skipping to change at line 979
} }
static int asf_read_simple_index(AVFormatContext *s, const GUIDParseTable *g) static int asf_read_simple_index(AVFormatContext *s, const GUIDParseTable *g)
{ {
ASFContext *asf = s->priv_data; ASFContext *asf = s->priv_data;
AVIOContext *pb = s->pb; AVIOContext *pb = s->pb;
AVStream *st = NULL; AVStream *st = NULL;
uint64_t interval; // index entry time interval in 100 ns units, usually it' s 1s uint64_t interval; // index entry time interval in 100 ns units, usually it' s 1s
uint32_t pkt_num, nb_entries; uint32_t pkt_num, nb_entries;
int32_t prev_pkt_num = -1; int32_t prev_pkt_num = -1;
int i, ret; int i;
int64_t offset;
uint64_t size = avio_rl64(pb); uint64_t size = avio_rl64(pb);
// simple index objects should be ordered by stream number, this loop tries to find // simple index objects should be ordered by stream number, this loop tries to find
// the first not indexed video stream // the first not indexed video stream
for (i = 0; i < asf->nb_streams; i++) { for (i = 0; i < asf->nb_streams; i++) {
if ((asf->asf_st[i]->type == AVMEDIA_TYPE_VIDEO) && !asf->asf_st[i]->ind exed) { if ((asf->asf_st[i]->type == AVMEDIA_TYPE_VIDEO) && !asf->asf_st[i]->ind exed) {
asf->asf_st[i]->indexed = 1; asf->asf_st[i]->indexed = 1;
st = s->streams[asf->asf_st[i]->index]; st = s->streams[asf->asf_st[i]->index];
break; break;
} }
skipping to change at line 999 skipping to change at line 1002
if (!st) { if (!st) {
avio_skip(pb, size - 24); // if there's no video stream, skip index obje ct avio_skip(pb, size - 24); // if there's no video stream, skip index obje ct
return 0; return 0;
} }
avio_skip(pb, 16); // skip File ID avio_skip(pb, 16); // skip File ID
interval = avio_rl64(pb); interval = avio_rl64(pb);
avio_skip(pb, 4); avio_skip(pb, 4);
nb_entries = avio_rl32(pb); nb_entries = avio_rl32(pb);
for (i = 0; i < nb_entries; i++) { for (i = 0; i < nb_entries; i++) {
pkt_num = avio_rl32(pb); pkt_num = avio_rl32(pb);
ret = avio_skip(pb, 2); offset = avio_skip(pb, 2);
if (ret < 0) { if (offset < 0) {
av_log(s, AV_LOG_ERROR, "Skipping failed in asf_read_simple_index.\n "); av_log(s, AV_LOG_ERROR, "Skipping failed in asf_read_simple_index.\n ");
return ret; return offset;
} }
if (prev_pkt_num != pkt_num) { if (prev_pkt_num != pkt_num) {
av_add_index_entry(st, asf->first_packet_offset + asf->packet_size * av_add_index_entry(st, asf->first_packet_offset + asf->packet_size *
pkt_num, av_rescale(interval, i, 10000), pkt_num, av_rescale(interval, i, 10000),
asf->packet_size, 0, AVINDEX_KEYFRAME); asf->packet_size, 0, AVINDEX_KEYFRAME);
prev_pkt_num = pkt_num; prev_pkt_num = pkt_num;
} }
} }
asf->is_simple_index = 1; asf->is_simple_index = 1;
align_position(pb, asf->offset, size); align_position(pb, asf->offset, size);
skipping to change at line 1487 skipping to change at line 1490
avio_skip(pb, asf->pad_len); // skip padding avio_skip(pb, asf->pad_len); // skip padding
if (asf->packet_offset + asf->packet_size > avio_tell(pb)) if (asf->packet_offset + asf->packet_size > avio_tell(pb))
avio_seek(pb, asf->packet_offset + asf->packet_size, SEEK_SE T); avio_seek(pb, asf->packet_offset + asf->packet_size, SEEK_SE T);
} }
break; break;
} }
if (asf->return_subpayload) { if (asf->return_subpayload) {
asf->return_subpayload = 0; asf->return_subpayload = 0;
return 0; return 0;
} }
for (i = 0; i < s->nb_streams; i++) { for (i = 0; i < asf->nb_streams; i++) {
ASFPacket *asf_pkt = &asf->asf_st[i]->pkt; ASFPacket *asf_pkt = &asf->asf_st[i]->pkt;
if (asf_pkt && !asf_pkt->size_left && asf_pkt->data_size) { if (asf_pkt && !asf_pkt->size_left && asf_pkt->data_size) {
if (asf->asf_st[i]->span > 1 && if (asf->asf_st[i]->span > 1 &&
asf->asf_st[i]->type == AVMEDIA_TYPE_AUDIO) asf->asf_st[i]->type == AVMEDIA_TYPE_AUDIO)
if ((ret = asf_deinterleave(s, asf_pkt, i)) < 0) if ((ret = asf_deinterleave(s, asf_pkt, i)) < 0)
return ret; return ret;
av_packet_move_ref(pkt, &asf_pkt->avpkt); av_packet_move_ref(pkt, &asf_pkt->avpkt);
pkt->stream_index = asf->asf_st[i]->index; pkt->stream_index = asf->asf_st[i]->index;
pkt->flags = asf_pkt->flags; pkt->flags = asf_pkt->flags;
pkt->dts = asf_pkt->dts - asf->preroll; pkt->dts = asf_pkt->dts - asf->preroll;
 End of changes. 9 change blocks. 
10 lines changed or deleted 13 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS