From: Jaroslav Kysela Date: Wed, 6 Sep 2017 07:42:10 +0000 (+0200) Subject: transcode: fix the stream translation X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=303f418e1ac2bb3078f7a974b69f04ab6a56c636;p=thirdparty%2Ftvheadend.git transcode: fix the stream translation --- diff --git a/src/transcoding/codec/codecs/libs/libvpx.c b/src/transcoding/codec/codecs/libs/libvpx.c index e0e57e7d3..481825cd8 100644 --- a/src/transcoding/codec/codecs/libs/libvpx.c +++ b/src/transcoding/codec/codecs/libs/libvpx.c @@ -121,7 +121,7 @@ static const codec_profile_class_t codec_profile_libvpx_class = { .opts = PO_EXPERT, .get_opts = codec_profile_class_get_opts, .off = offsetof(tvh_codec_profile_libvpx_t, cpu_used), - .intextra = INTEXTRA_RANGE(0, 15, 1), + .intextra = INTEXTRA_RANGE(-16, 16, 1), .def.i = 8, }, { diff --git a/src/transcoding/transcode/stream.c b/src/transcoding/transcode/stream.c index 3632afaeb..9d68dce3e 100644 --- a/src/transcoding/transcode/stream.c +++ b/src/transcoding/transcode/stream.c @@ -43,7 +43,7 @@ tvh_stream_is_copy(TVHCodecProfile *profile, tvh_ssc_t *ssc, if (token == NULL) break; if (!strcasecmp(token, txtname)) - return 0; /* copy */ + return 0; /* do not copy */ } } cont: @@ -86,6 +86,9 @@ tvh_stream_setup(TVHStream *self, TVHCodecProfile *profile, tvh_ssc_t *ssc) return -1; } self->type = ssc->ssc_type = codec_id2streaming_component_type(ocodec->id); + if (ssc->ssc_type == SCT_UNKNOWN) { + tvh_stream_log(self, LOG_ERR, "unable to translate AV type %s [%d] to SCT!", ocodec->name, ocodec->id); + } ssc->ssc_gh = NULL; return 0; } diff --git a/src/transcoding/transcode/transcoder.c b/src/transcoding/transcode/transcoder.c index 44d1fcb7c..2f8110038 100644 --- a/src/transcoding/transcode/transcoder.c +++ b/src/transcoding/transcode/transcoder.c @@ -109,7 +109,7 @@ tvh_transcoder_start(TVHTranscoder *self, tvh_ss_t *ss_src) TVHAudioCodecProfile *aprofile; TVHStream *stream = NULL; int indexes[ss_src->ss_num_components]; - int i, j, count; + int i, j, k, count; int video_index = -1; int audio_index = -1; int audio_pindex[3] = { -1, -1, -1 }; @@ -195,11 +195,10 @@ tvh_transcoder_start(TVHTranscoder *self, tvh_ss_t *ss_src) ss->ss_pcr_pid = ss_src->ss_pcr_pid; ss->ss_pmt_pid = ss_src->ss_pmt_pid; service_source_info_copy(&ss->ss_si, &ss_src->ss_si); - ss->ss_num_components = count; - for (j = 0; j < count; j++) { + for (j = k = 0; j < count; j++) { i = indexes[j]; ssc_src = &ss_src->ss_components[i]; - ssc = &ss->ss_components[j]; + ssc = &ss->ss_components[k]; assert(ssc); media_type = ssc_get_media_type(ssc_src); assert(media_type != AVMEDIA_TYPE_UNKNOWN); @@ -214,12 +213,13 @@ tvh_transcoder_start(TVHTranscoder *self, tvh_ss_t *ss_src) tvh_ssc_log(ssc_src, LOG_INFO, "==> Using profile %s", self, tvh_codec_profile_get_name(profile)); SLIST_INSERT_HEAD(&self->streams, stream, link); + k++; } else { - memset(ssc, 0, sizeof(*ssc)); indexes[j] = -1; continue; } } + ss->ss_num_components = k; for (i = 0; i < ss_src->ss_num_components; i++) { for (j = 0; j < count; j++) { if (i == indexes[j])