diff options
author | jstebbins <[email protected]> | 2014-12-23 22:27:18 +0000 |
---|---|---|
committer | jstebbins <[email protected]> | 2014-12-23 22:27:18 +0000 |
commit | 29247cc9dfa23ea5ccdcb6c0db4508d58d7c919b (patch) | |
tree | f13a5aaf0a6ceab4f69d3db00f4c51daeaaa5e74 | |
parent | 602a0186397265c2446136e7d4ce7c47479d01d9 (diff) |
json: add "Codec" to audio list items
and add hb_audio_can_apply_drc2 API which doesn't require audio codec_param
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6651 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | libhb/common.c | 14 | ||||
-rw-r--r-- | libhb/common.h | 2 | ||||
-rw-r--r-- | libhb/hb_json.c | 1 |
3 files changed, 17 insertions, 0 deletions
diff --git a/libhb/common.c b/libhb/common.c index 876377c60..7f12e5838 100644 --- a/libhb/common.c +++ b/libhb/common.c @@ -3837,6 +3837,20 @@ int hb_audio_can_apply_drc(uint32_t codec, uint32_t codec_param, int encoder) } } +int hb_audio_can_apply_drc2(hb_handle_t *h, int title_idx, int audio_idx, int encoder) +{ + hb_title_t *title = hb_find_title_by_index(h, title_idx); + if (title == NULL) + return 0; + + hb_audio_t *audio = hb_list_item(title->list_audio, audio_idx); + if (audio == NULL) + return 0; + + return hb_audio_can_apply_drc(audio->config.in.codec, + audio->config.in.codec_param, encoder); +} + /********************************************************************** * hb_metadata_init ********************************************************************** diff --git a/libhb/common.h b/libhb/common.h index f4d25dcf6..f7952181f 100644 --- a/libhb/common.h +++ b/libhb/common.h @@ -169,6 +169,8 @@ int hb_subtitle_can_burn( int source ); int hb_subtitle_can_pass( int source, int mux ); int hb_audio_can_apply_drc(uint32_t codec, uint32_t codec_param, int encoder); +int hb_audio_can_apply_drc2(hb_handle_t *h, int title_idx, + int audio_idx, int encoder); hb_attachment_t *hb_attachment_copy(const hb_attachment_t *src); diff --git a/libhb/hb_json.c b/libhb/hb_json.c index 70160436e..30746c75c 100644 --- a/libhb/hb_json.c +++ b/libhb/hb_json.c @@ -258,6 +258,7 @@ static json_t* hb_title_to_dict( const hb_title_t * title ) "Description", json_string(audio->config.lang.description), "Language", json_string(audio->config.lang.simple), "LanguageCode", json_string(audio->config.lang.iso639_2), + "Codec", json_integer(audio->config.in.codec), "SampleRate", json_integer(audio->config.in.samplerate), "BitRate", json_integer(audio->config.in.bitrate), "ChannelLayout", json_integer(audio->config.in.channel_layout)); |