mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-21 10:55:51 +02:00
avformat/mpegtsenc: Avoid allocation of AVPacket
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
a81e0ee21f
commit
2cddb2f7a8
@ -1140,9 +1140,7 @@ static int mpegts_init(AVFormatContext *s)
|
||||
ts->nit.write_packet = section_write_packet;
|
||||
ts->nit.opaque = s;
|
||||
|
||||
ts->pkt = av_packet_alloc();
|
||||
if (!ts->pkt)
|
||||
return AVERROR(ENOMEM);
|
||||
ts->pkt = ffformatcontext(s)->pkt;
|
||||
|
||||
/* assign pids to each stream */
|
||||
for (i = 0; i < s->nb_streams; i++) {
|
||||
@ -2186,8 +2184,6 @@ static void mpegts_deinit(AVFormatContext *s)
|
||||
MpegTSService *service;
|
||||
int i;
|
||||
|
||||
av_packet_free(&ts->pkt);
|
||||
|
||||
for (i = 0; i < s->nb_streams; i++) {
|
||||
AVStream *st = s->streams[i];
|
||||
MpegTSWriteStream *ts_st = st->priv_data;
|
||||
|
Loading…
Reference in New Issue
Block a user