]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
[transcode]: avcodec_close is deprecated
authorlekma <lekmalek@gmail.com>
Sat, 10 Sep 2016 09:35:21 +0000 (11:35 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 28 Aug 2017 13:32:48 +0000 (15:32 +0200)
see note at:
https://www.ffmpeg.org/doxygen/3.1/group__lavc__core.html#gaf4daa92361efb3523ef5afeb0b54077f

src/transcoding/transcode/context.c
src/transcoding/transcode/video.c

index d18fd5ed06e7d00e7564fa3132ec3b57eaa592d8..9ce4fff13f607697747cca99b9ef546b51bf0458 100644 (file)
@@ -477,12 +477,6 @@ tvh_context_close(TVHContext *self, int flush)
     if (self->type->close) {
         self->type->close(self);
     }
-    if (self->oavctx && avcodec_is_open(self->oavctx)) {
-        avcodec_close(self->oavctx);
-    }
-    if (self->iavctx && avcodec_is_open(self->iavctx)) {
-        avcodec_close(self->iavctx);
-    }
 }
 
 
index b46f8f2d40d4f0d18cd458672bbdc66d7bfbb77b..4a2a1b4335d68f8442b64f7ddb0c2211ab15471d 100644 (file)
@@ -218,8 +218,13 @@ static int
 tvh_video_context_encode(TVHContext *self, AVFrame *avframe)
 {
     avframe->pts = av_frame_get_best_effort_timestamp(avframe);
-    /*tvhinfo(LS_TRANSCODE, "encode avframe: pts: %"PRId64 ", pkt_pts: %"PRId64 ", pkt_dts: %"PRId64,
-            avframe->pts, avframe->pkt_pts, avframe->pkt_dts);*/
+    /*if (avframe->pts <= self->pts) {
+        tvh_context_log(self, LOG_ERR,
+                        "Invalid pts (%"PRId64") <= last (%"PRId64")",
+                        avframe->pts, self->pts);
+        return -1;
+    }
+    self->pts = avframe->pts;*/
     return 0;
 }
 
@@ -227,8 +232,6 @@ tvh_video_context_encode(TVHContext *self, AVFrame *avframe)
 static int
 tvh_video_context_ship(TVHContext *self, AVPacket *avpkt)
 {
-    /*tvhinfo(LS_TRANSCODE, "ship avpkt: pts: %"PRId64 ", dts: %"PRId64,
-            avpkt->pts, avpkt->dts);*/
     if (avpkt->size < 0 || avpkt->pts < avpkt->dts) {
         tvh_context_log(self, LOG_ERR, "encode failed");
         return -1;