@@ -341,7 +341,7 @@ static int fourxm_read_packet(AVFormatContext *s,
av_packet_unref(pkt);
} else {
packet_read = 1;
- av_shrink_packet(pkt, ret + 8);
+ av_packet_resize(pkt, ret + 8);
}
break;
@@ -80,7 +80,7 @@ static int adp_read_packet(AVFormatContext *s, AVPacket *pkt)
if (ret < 0) {
return ret;
}
- av_shrink_packet(pkt, ret);
+ av_packet_resize(pkt, ret);
}
pkt->stream_index = 0;
@@ -71,7 +71,7 @@ static int adx_read_packet(AVFormatContext *s, AVPacket *pkt)
return ret;
if ((ret % size) && ret >= size) {
size = ret - (ret % size);
- av_shrink_packet(pkt, size);
+ av_packet_resize(pkt, size);
pkt->flags &= ~AV_PKT_FLAG_CORRUPT;
} else if (ret < size) {
return AVERROR(EIO);
@@ -1388,7 +1388,7 @@ static int asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pkt)
ret = asf->packet_frag_size;
} else {
// no scrambling, so we can return partial packets
- av_shrink_packet(&asf_st->pkt, asf->packet_frag_offset + ret);
+ av_packet_resize(&asf_st->pkt, asf->packet_frag_offset + ret);
}
}
if (s->key && s->keylen == 20)
@@ -221,7 +221,7 @@ static int cdxl_read_packet(AVFormatContext *s, AVPacket *pkt)
if (ret < 0) {
return ret;
}
- av_shrink_packet(pkt, CDXL_HEADER_SIZE + ret);
+ av_packet_resize(pkt, CDXL_HEADER_SIZE + ret);
pkt->stream_index = cdxl->video_stream_index;
pkt->flags |= AV_PKT_FLAG_KEY;
pkt->pos = cdxl->pos;
@@ -203,7 +203,7 @@ static int cin_read_packet(AVFormatContext *s, AVPacket *pkt)
return ret;
}
if (ret < pkt_size)
- av_shrink_packet(pkt, 4 + ret);
+ av_packet_resize(pkt, 4 + ret);
/* sound buffer will be processed on next read_packet() call */
cin->audio_buffer_size = hdr->audio_frame_size;
@@ -575,7 +575,7 @@ static int mxf_get_d10_aes3_packet(AVIOContext *pb, AVStream *st, AVPacket *pkt,
}
buf_ptr += 32 - st->codecpar->channels*4; // always 8 channels stored SMPTE 331M
}
- av_shrink_packet(pkt, data_ptr - pkt->data);
+ av_packet_resize(pkt, data_ptr - pkt->data);
return 0;
}
@@ -642,7 +642,7 @@ static int mxf_decrypt_triplet(AVFormatContext *s, AVPacket *pkt, KLVPacket *klv
if (mxf->aesc)
av_aes_crypt(mxf->aesc, &pkt->data[plaintext_size],
&pkt->data[plaintext_size], size >> 4, ivec, 1);
- av_shrink_packet(pkt, orig_size);
+ av_packet_resize(pkt, orig_size);
pkt->stream_index = index;
avio_skip(pb, end - avio_tell(pb));
return 0;
@@ -1122,7 +1122,7 @@ static int decode_frame(NUTContext *nut, AVPacket *pkt, int frame_code)
if (ret < 0)
goto fail;
}
- av_shrink_packet(pkt, nut->header_len[header_idx] + ret);
+ av_packet_resize(pkt, nut->header_len[header_idx] + ret);
pkt->stream_index = stream_id;
if (stc->last_flags & FLAG_KEY)
@@ -291,7 +291,7 @@ static int nuv_packet(AVFormatContext *s, AVPacket *pkt)
return ret;
}
if (ret < size)
- av_shrink_packet(pkt, copyhdrsize + ret);
+ av_packet_resize(pkt, copyhdrsize + ret);
return 0;
case NUV_AUDIO:
if (ctx->a_id < 0) {
@@ -49,7 +49,7 @@ int ff_raw_read_partial_packet(AVFormatContext *s, AVPacket *pkt)
av_packet_unref(pkt);
return ret;
}
- av_shrink_packet(pkt, ret);
+ av_packet_resize(pkt, ret);
return ret;
}
@@ -850,7 +850,7 @@ static int rm_assemble_video_frame(AVFormatContext *s, AVIOContext *pb,
if(vst->slices != vst->cur_slice) //FIXME find out how to set slices correct from the begin
memmove(pkt->data + 1 + 8*vst->cur_slice, pkt->data + 1 + 8*vst->slices,
vst->videobufpos - 1 - 8*vst->slices);
- av_shrink_packet(pkt, vst->videobufpos + 8*(vst->cur_slice - vst->slices));
+ av_packet_resize(pkt, vst->videobufpos + 8*(vst->cur_slice - vst->slices));
pkt->pts = AV_NOPTS_VALUE;
pkt->pos = vst->pktpos;
vst->slices = 0;
@@ -97,7 +97,7 @@ static int sdr2_read_packet(AVFormatContext *s, AVPacket *pkt)
if (ret < 0) {
return ret;
}
- av_shrink_packet(pkt, ret + 24);
+ av_packet_resize(pkt, ret + 24);
} else {
ret = av_get_packet(s->pb, pkt, next - 52);
}
@@ -79,7 +79,7 @@ static int svs_read_packet(AVFormatContext *s, AVPacket *pkt)
if (ret != 32 * 256) {
if (ret < 0)
return ret;
- av_shrink_packet(pkt, ret);
+ av_packet_resize(pkt, ret);
pkt->flags &= ~AV_PKT_FLAG_CORRUPT;
}
pkt->stream_index = 0;
@@ -538,7 +538,7 @@ bitmap_end_skip:
if (res < 0) {
return res;
}
- av_shrink_packet(pkt, res);
+ av_packet_resize(pkt, res);
}
pkt->pos = pos;
@@ -293,7 +293,7 @@ static int append_packet_chunked(AVIOContext *s, AVPacket *pkt, int size)
ret = avio_read(s, pkt->data + prev_size, read_size);
if (ret != read_size) {
- av_shrink_packet(pkt, prev_size + FFMAX(ret, 0));
+ av_packet_resize(pkt, prev_size + FFMAX(ret, 0));
break;
}
@@ -160,7 +160,7 @@ static int yop_read_packet(AVFormatContext *s, AVPacket *pkt)
if (ret < 0)
goto err_out;
else if (ret < actual_video_data_size)
- av_shrink_packet(&yop->video_packet, yop->palette_size + ret);
+ av_packet_resize(&yop->video_packet, yop->palette_size + ret);
// Arbitrarily return the audio data first
return 0;
Signed-off-by: James Almer <jamrial@gmail.com> --- libavformat/4xm.c | 2 +- libavformat/adp.c | 2 +- libavformat/adxdec.c | 2 +- libavformat/asfdec_f.c | 2 +- libavformat/cdxl.c | 2 +- libavformat/dsicin.c | 2 +- libavformat/mxfdec.c | 4 ++-- libavformat/nutdec.c | 2 +- libavformat/nuv.c | 2 +- libavformat/rawdec.c | 2 +- libavformat/rmdec.c | 2 +- libavformat/sdr2.c | 2 +- libavformat/svs.c | 2 +- libavformat/swfdec.c | 2 +- libavformat/utils.c | 2 +- libavformat/yop.c | 2 +- 16 files changed, 17 insertions(+), 17 deletions(-)