[FFmpeg-cvslog] mpegps: Use av_get_packet() instead of poorly emulating it.

Alex Converse git at videolan.org
Mon Mar 19 05:30:30 CET 2012


ffmpeg | branch: release/0.8 | Alex Converse <alex.converse at gmail.com> | Fri Oct  7 17:02:36 2011 -0700| [4faa00b256bfdecb4ee1c14f332a7d0b2f539e94] | committer: Reinhard Tartler

mpegps: Use av_get_packet() instead of poorly emulating it.

(cherry picked from commit 98ef887a759c66febcb612407c6bb361c4d50bcb)

Signed-off-by: Anton Khirnov <anton at khirnov.net>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4faa00b256bfdecb4ee1c14f332a7d0b2f539e94
---

 libavformat/mpeg.c |    9 +--------
 1 files changed, 1 insertions(+), 8 deletions(-)

diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
index 9407b3f..3fc83bb 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;



More information about the ffmpeg-cvslog mailing list