From 4faa00b256bfdecb4ee1c14f332a7d0b2f539e94 Mon Sep 17 00:00:00 2001 From: Alex Converse Date: Fri, 7 Oct 2011 17:02:36 -0700 Subject: [PATCH] mpegps: Use av_get_packet() instead of poorly emulating it. (cherry picked from commit 98ef887a759c66febcb612407c6bb361c4d50bcb) Signed-off-by: Anton Khirnov --- libavformat/mpeg.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c index 9407b3f5b6..3fc83bb167 100644 --- a/libavformat/mpeg.c +++ b/libavformat/mpeg.c @@ -561,14 +561,7 @@ static int mpegps_read_packet(AVFormatContext *s, else if (st->codec->bits_per_coded_sample == 28) return AVERROR(EINVAL); } - av_new_packet(pkt, len); - ret = avio_read(s->pb, pkt->data, pkt->size); - if (ret < 0) { - pkt->size = 0; - } else if (ret < pkt->size) { - pkt->size = ret; - memset(pkt->data + ret, 0, FF_INPUT_BUFFER_PADDING_SIZE); - } + ret = av_get_packet(s->pb, pkt, len); pkt->pts = pts; pkt->dts = dts; pkt->pos = dummy_pos;