diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2009-06-24 23:04:05 +0000 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2009-06-24 23:04:05 +0000 |
commit | 91d19d471b7bd8c621813a02e8cfe068e19ba699 (patch) | |
tree | e92d4fba7ccc8f269dc0a0af24b14bbd1754fbf4 /libavformat/asfdec.c | |
parent | a752069dbacae4f25de71c637619123a967065d7 (diff) | |
download | ffmpeg-91d19d471b7bd8c621813a02e8cfe068e19ba699.tar.gz |
Remove any reference to ASFContext.packet_size and replace it with
AVFormatContext.packet_size. See "[PATCH] asf*.c/h: use
AVFormatContext->packet_size instead of own copy" thread on ML.
Originally committed as revision 19270 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/asfdec.c')
-rw-r--r-- | libavformat/asfdec.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c index a93ac09929..c294ff58b8 100644 --- a/libavformat/asfdec.c +++ b/libavformat/asfdec.c @@ -221,7 +221,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap) asf->hdr.min_pktsize = get_le32(pb); asf->hdr.max_pktsize = get_le32(pb); asf->hdr.max_bitrate = get_le32(pb); - asf->packet_size = asf->hdr.max_pktsize; + s->packet_size = asf->hdr.max_pktsize; } else if (!guidcmp(&g, &ff_asf_stream_header)) { enum CodecType type; int type_specific_size, sizeX; @@ -595,7 +595,7 @@ static int ff_asf_get_packet(AVFormatContext *s, ByteIOContext *pb) int rsize = 8; int c, d, e, off; - off= (url_ftell(pb) - s->data_offset) % asf->packet_size + 3; + off= (url_ftell(pb) - s->data_offset) % s->packet_size + 3; c=d=e=-1; while(off-- > 0){ @@ -625,7 +625,7 @@ static int ff_asf_get_packet(AVFormatContext *s, ByteIOContext *pb) asf->packet_flags = c; asf->packet_property = d; - DO_2BITS(asf->packet_flags >> 5, packet_length, asf->packet_size); + DO_2BITS(asf->packet_flags >> 5, packet_length, s->packet_size); DO_2BITS(asf->packet_flags >> 1, padsize, 0); // sequence ignored DO_2BITS(asf->packet_flags >> 3, padsize, 0); // padding length @@ -654,7 +654,7 @@ static int ff_asf_get_packet(AVFormatContext *s, ByteIOContext *pb) if (packet_length < asf->hdr.min_pktsize) padsize += asf->hdr.min_pktsize - packet_length; asf->packet_padsize = padsize; - dprintf(s, "packet: size=%d padsize=%d left=%d\n", asf->packet_size, asf->packet_padsize, asf->packet_size_left); + dprintf(s, "packet: size=%d padsize=%d left=%d\n", s->packet_size, asf->packet_padsize, asf->packet_size_left); return 0; } @@ -835,7 +835,7 @@ static int ff_asf_parse_packet(AVFormatContext *s, ByteIOContext *pb, AVPacket * /* read data */ //printf("READ PACKET s:%d os:%d o:%d,%d l:%d DATA:%p\n", - // asf->packet_size, asf_st->pkt.size, asf->packet_frag_offset, + // s->packet_size, asf_st->pkt.size, asf->packet_frag_offset, // asf_st->frag_offset, asf->packet_frag_size, asf_st->pkt.data); asf->packet_size_left -= asf->packet_frag_size; if (asf->packet_size_left < 0) @@ -978,7 +978,6 @@ static int asf_read_close(AVFormatContext *s) static int64_t asf_read_pts(AVFormatContext *s, int stream_index, int64_t *ppos, int64_t pos_limit) { - ASFContext *asf = s->priv_data; AVPacket pkt1, *pkt = &pkt1; ASFStream *asf_st; int64_t pts; @@ -990,7 +989,7 @@ static int64_t asf_read_pts(AVFormatContext *s, int stream_index, int64_t *ppos, start_pos[i]= pos; } - pos= (pos+asf->packet_size-1-s->data_offset)/asf->packet_size*asf->packet_size+ s->data_offset; + pos= (pos+s->packet_size-1-s->data_offset)/s->packet_size*s->packet_size+ s->data_offset; *ppos= pos; url_fseek(s->pb, pos, SEEK_SET); @@ -1010,7 +1009,7 @@ static int64_t asf_read_pts(AVFormatContext *s, int stream_index, int64_t *ppos, asf_st= s->streams[i]->priv_data; -// assert((asf_st->packet_pos - s->data_offset) % asf->packet_size == 0); +// assert((asf_st->packet_pos - s->data_offset) % s->packet_size == 0); pos= asf_st->packet_pos; av_add_index_entry(s->streams[i], pos, pts, pkt->size, pos - start_pos[i] + 1, AVINDEX_KEYFRAME); @@ -1049,11 +1048,11 @@ static void asf_build_simple_index(AVFormatContext *s, int stream_index) for (i=0;i<ict;i++){ int pktnum=get_le32(s->pb); int pktct =get_le16(s->pb); - int64_t pos = s->data_offset + asf->packet_size*(int64_t)pktnum; + int64_t pos = s->data_offset + s->packet_size*(int64_t)pktnum; int64_t index_pts= av_rescale(itime, i, 10000); av_log(s, AV_LOG_DEBUG, "pktnum:%d, pktct:%d\n", pktnum, pktct); - av_add_index_entry(s->streams[stream_index], pos, index_pts, asf->packet_size, 0, AVINDEX_KEYFRAME); + av_add_index_entry(s->streams[stream_index], pos, index_pts, s->packet_size, 0, AVINDEX_KEYFRAME); } asf->index_read= 1; } @@ -1067,7 +1066,7 @@ static int asf_read_seek(AVFormatContext *s, int stream_index, int64_t pts, int int64_t pos; int index; - if (asf->packet_size <= 0) + if (s->packet_size <= 0) return -1; /* Try using the protocol's read_seek if available */ |