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

Alex Converse git at videolan.org
Sat Oct 8 03:47:32 CEST 2011


ffmpeg | branch: master | Alex Converse <alex.converse at gmail.com> | Fri Oct  7 17:02:36 2011 -0700| [98ef887a759c66febcb612407c6bb361c4d50bcb] | committer: Alex Converse

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

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

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

diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c
index ef683b1..52bf40f 100644
--- a/libavformat/mpeg.c
+++ b/libavformat/mpeg.c
@@ -566,14 +566,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