summaryrefslogtreecommitdiffstats
path: root/libhb/hb_json.c
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2019-06-07 08:06:50 -0700
committerJohn Stebbins <[email protected]>2019-07-12 14:15:36 -0700
commit206df6267e8065366f2df18252b22030462b9436 (patch)
treec5d3ea34fe5d748678921aeb19b008a230229803 /libhb/hb_json.c
parent2588aaf5f48358019e27bbc611f8835248fd7349 (diff)
hb_json: don't fail if audio is invalid for mux
Just drop the track. If audio is 'none' drop silently.
Diffstat (limited to 'libhb/hb_json.c')
-rw-r--r--libhb/hb_json.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/libhb/hb_json.c b/libhb/hb_json.c
index 89a4da479..8413d3cd6 100644
--- a/libhb/hb_json.c
+++ b/libhb/hb_json.c
@@ -955,9 +955,12 @@ static int validate_audio_codec_mux(int codec, int mux, int track)
{
if ((enc->codec == codec) && (enc->muxers & mux) == 0)
{
- hb_error("track %d: incompatible encoder '%s' for muxer '%s'",
- track + 1, enc->short_name,
- hb_container_get_short_name(mux));
+ if (codec != HB_ACODEC_NONE)
+ {
+ hb_error("track %d: incompatible encoder '%s' for muxer '%s'",
+ track + 1, enc->short_name,
+ hb_container_get_short_name(mux));
+ }
return -1;
}
}
@@ -1537,16 +1540,20 @@ hb_job_t* hb_dict_to_job( hb_handle_t * h, hb_dict_t *dict )
}
// Audio sanity checks
- int count = hb_list_count(job->list_audio);
int ii;
- for (ii = 0; ii < count; ii++)
+ for (ii = 0; ii < hb_list_count(job->list_audio); )
{
hb_audio_config_t *acfg;
acfg = hb_list_audio_config_item(job->list_audio, ii);
if (validate_audio_codec_mux(acfg->out.codec, job->mux, ii))
{
- goto fail;
+ // drop the track
+ hb_audio_t * audio = hb_list_item(job->list_audio, ii);
+ hb_list_rem(job->list_audio, audio);
+ hb_audio_close(&audio);
+ continue;
}
+ ii++;
}
// process subtitle list