]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
transcode: use names instead numbers for pixfmt/samplefmt/audiolayout
authorJaroslav Kysela <perex@perex.cz>
Wed, 13 Sep 2017 09:11:14 +0000 (11:11 +0200)
committerJaroslav Kysela <perex@perex.cz>
Wed, 13 Sep 2017 09:11:14 +0000 (11:11 +0200)
src/transcoding/transcode/audio.c
src/transcoding/transcode/stream.c
src/transcoding/transcode/video.c

index b1977a8de3bf5bb3815396ccf7390faf12b29a3e..86965e048e18383848127120979179988134bae3 100644 (file)
@@ -137,17 +137,19 @@ tvh_audio_context_open_filters(TVHContext *self, AVDictionary **opts)
 {
     char source_args[128];
     char filters[16];
+    char layout[32];
     int resample = (self->iavctx->sample_rate != self->oavctx->sample_rate);
 
     // source args
     memset(source_args, 0, sizeof(source_args));
+    av_get_channel_layout_string(layout, sizeof(layout), self->iavctx->channels, self->iavctx->channel_layout);
     if (str_snprintf(source_args, sizeof(source_args),
-            "time_base=%d/%d:sample_rate=%d:sample_fmt=%d:channel_layout=0x%"PRIx64,
+            "time_base=%d/%d:sample_rate=%d:sample_fmt=%s:channel_layout=%s",
             self->iavctx->time_base.num,
             self->iavctx->time_base.den,
             self->iavctx->sample_rate,
-            self->iavctx->sample_fmt,
-            self->iavctx->channel_layout)) {
+            av_get_sample_fmt_name(self->iavctx->sample_fmt),
+            layout)) {
         return -1;
     }
 
index b837b34882816f3aecf7ab8a3f4b1cc6db499b8c..92039e6b2d896ced33d9e0edb24f4318724a9022 100644 (file)
@@ -40,7 +40,7 @@ tvh_stream_is_copy(TVHCodecProfile *profile, tvh_ssc_t *ssc,
         if (codecs == NULL)
             goto cont;
         for (str = codecs; ; str = NULL) {
-            token = strtok_r(str," ,|;" , &saveptr);
+            token = strtok_r(str, " ,|;" , &saveptr);
             if (token == NULL)
                 break;
             if (!strcasecmp(token, txtname))
index 75a030689adf8108c67a1b575b31eb527c7b2263..c9bf0a6905135e88db3c2b26828f9a3edd8b2ec8 100644 (file)
@@ -179,10 +179,10 @@ tvh_video_context_open_filters(TVHContext *self, AVDictionary **opts)
     // source args
     memset(source_args, 0, sizeof(source_args));
     if (str_snprintf(source_args, sizeof(source_args),
-            "video_size=%dx%d:pix_fmt=%d:time_base=%d/%d:pixel_aspect=%d/%d",
+            "video_size=%dx%d:pix_fmt=%s:time_base=%d/%d:pixel_aspect=%d/%d",
             self->iavctx->width,
             self->iavctx->height,
-            self->iavctx->pix_fmt,
+            av_get_pix_fmt_name(self->iavctx->pix_fmt),
             self->iavctx->time_base.num,
             self->iavctx->time_base.den,
             self->iavctx->sample_aspect_ratio.num,