]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
transcoder: fix the wrong audio codec profile structure access, fixes #4565
authorJaroslav Kysela <perex@perex.cz>
Fri, 1 Sep 2017 12:31:24 +0000 (14:31 +0200)
committerJaroslav Kysela <perex@perex.cz>
Fri, 1 Sep 2017 12:32:02 +0000 (14:32 +0200)
src/transcoding/transcode/transcoder.c

index af19e9c1ca0b39953317ad69612dbe0f422466db..5810998749349e7424e04e19e77e125b996d7063 100644 (file)
@@ -117,11 +117,15 @@ tvh_transcoder_start(TVHTranscoder *self, tvh_ss_t *ss_src)
                 video_index = i;
             break;
         case AVMEDIA_TYPE_AUDIO:
-            aprofile = (TVHAudioCodecProfile *)self->profiles[media_type];
-            if (aprofile &&
-                lang_match(aprofile->language1, ssc, &audio_pindex[0], i) == 0 &&
-                lang_match(aprofile->language2, ssc, &audio_pindex[1], i) == 0)
-                lang_match(aprofile->language3, ssc, &audio_pindex[2], i);
+            profile = self->profiles[media_type];
+            if (profile &&
+                idnode_is_instance(&profile->idnode,
+                                   (idclass_t *)&codec_profile_audio_class)) {
+                aprofile = (TVHAudioCodecProfile *)profile;
+                if (lang_match(aprofile->language1, ssc, &audio_pindex[0], i) == 0 &&
+                    lang_match(aprofile->language2, ssc, &audio_pindex[1], i) == 0)
+                    lang_match(aprofile->language3, ssc, &audio_pindex[2], i);
+            }
             break;
         case AVMEDIA_TYPE_SUBTITLE:
            if (subtitle_index < 0)