]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Replace deprecated av_init_packet()
authorAndré Apitzsch <git@apitzsch.eu>
Sun, 23 Jun 2024 14:42:50 +0000 (16:42 +0200)
committerFlole <Flole998@users.noreply.github.com>
Tue, 25 Jun 2024 00:02:05 +0000 (02:02 +0200)
src/muxer/muxer_libav.c
src/transcoding/transcode/context.c

index c7a190e78bc1032a35af897117e08052cff982ad..e4c9758559b6de8b8adbd8363edb7b965fcf9832 100644 (file)
@@ -557,7 +557,8 @@ lav_muxer_write_pkt(muxer_t *m, streaming_message_type_t smt, void *data)
       continue;
 
     tofree = NULL;
-    av_init_packet(&packet);
+    memset(&packet, 0, sizeof(packet));
+    packet.pos = -1;
     codec_id = st->codecpar->codec_id;
 
     if (codec_id == AV_CODEC_ID_AAC) {
index d951a92464b87cbcdad650710831f703a40525fa..0d993a076e45fc0d7343e8e5a5fccbb8822cd471 100644 (file)
@@ -312,7 +312,11 @@ tvh_context_receive_packet(TVHContext *self)
     AVPacket avpkt;
     int ret = -1;
 
-    av_init_packet(&avpkt);
+    memset(&avpkt, 0, sizeof(avpkt));
+    avpkt.pts = AV_NOPTS_VALUE;
+    avpkt.dts = AV_NOPTS_VALUE;
+    avpkt.pos = -1;
+
     while ((ret = avcodec_receive_packet(self->oavctx, &avpkt)) != AVERROR(EAGAIN)) {
         if (ret || (ret = tvh_context_ship(self, &avpkt))) {
             break;
@@ -657,7 +661,10 @@ tvh_context_handle(TVHContext *self, th_pkt_t *pkt)
             ret = AVERROR(ENOMEM);
         }
         else {
-            av_init_packet(&avpkt);
+            memset(&avpkt, 0, sizeof(avpkt));
+            avpkt.pts = AV_NOPTS_VALUE;
+            avpkt.dts = AV_NOPTS_VALUE;
+            avpkt.pos = -1;
             if ((ret = av_packet_from_data(&avpkt, data, size))) { // takes ownership of data
                 tvh_context_log(self, LOG_ERR,
                                 "failed to allocate AVPacket buffer");