From: lekma Date: Sat, 10 Sep 2016 09:35:21 +0000 (+0200) Subject: [transcode]: avcodec_close is deprecated X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b615169eac146543293d1e4f3cca62884680bd16;p=thirdparty%2Ftvheadend.git [transcode]: avcodec_close is deprecated see note at: https://www.ffmpeg.org/doxygen/3.1/group__lavc__core.html#gaf4daa92361efb3523ef5afeb0b54077f --- diff --git a/src/transcoding/transcode/context.c b/src/transcoding/transcode/context.c index d18fd5ed0..9ce4fff13 100644 --- a/src/transcoding/transcode/context.c +++ b/src/transcoding/transcode/context.c @@ -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); - } } diff --git a/src/transcoding/transcode/video.c b/src/transcoding/transcode/video.c index b46f8f2d4..4a2a1b433 100644 --- a/src/transcoding/transcode/video.c +++ b/src/transcoding/transcode/video.c @@ -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;