]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
transcode: fix the stream translation
authorJaroslav Kysela <perex@perex.cz>
Wed, 6 Sep 2017 07:42:10 +0000 (09:42 +0200)
committerJaroslav Kysela <perex@perex.cz>
Wed, 6 Sep 2017 07:42:10 +0000 (09:42 +0200)
src/transcoding/codec/codecs/libs/libvpx.c
src/transcoding/transcode/stream.c
src/transcoding/transcode/transcoder.c

index e0e57e7d3db77fce18b4295d023b4289321a6778..481825cd848a5d6aded23feaa983f1bcf2a79229 100644 (file)
@@ -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,
             },
             {
index 3632afaebb9a706c1ce4183dd2773128f150fc85..9d68dce3e0ded32d1825504a7c97e87a02f2ef4b 100644 (file)
@@ -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;
 }
index 44d1fcb7c71acfd86bff4d3782126e57362aba0c..2f81100381bef0c0a1e18907d06854585a26a833 100644 (file)
@@ -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])