* hb_audio_add ********************************************************************** * *********************************************************************/
| 5865 | * |
| 5866 | *********************************************************************/ |
| 5867 | int hb_audio_add(const hb_job_t * job, const hb_audio_config_t * audiocfg) |
| 5868 | { |
| 5869 | hb_title_t *title = job->title; |
| 5870 | hb_audio_t *audio; |
| 5871 | |
| 5872 | audio = hb_audio_copy( hb_list_item( title->list_audio, audiocfg->index ) ); |
| 5873 | if( audio == NULL ) |
| 5874 | { |
| 5875 | /* We fail! */ |
| 5876 | return 0; |
| 5877 | } |
| 5878 | |
| 5879 | if( (audiocfg->in.bitrate != -1) && (audiocfg->in.codec != 0xDEADBEEF) ) |
| 5880 | { |
| 5881 | /* This most likely means the client didn't call hb_audio_config_init |
| 5882 | * so bail. */ |
| 5883 | hb_audio_close(&audio); |
| 5884 | return 0; |
| 5885 | } |
| 5886 | |
| 5887 | /* Really shouldn't ignore the passed out track, but there is currently no |
| 5888 | * way to handle duplicates or out-of-order track numbers. */ |
| 5889 | audio->config.out = audiocfg->out; |
| 5890 | audio->config.out.track = hb_list_count(job->list_audio) + 1; |
| 5891 | if (audiocfg->out.name && *audiocfg->out.name) |
| 5892 | { |
| 5893 | audio->config.out.name = strdup(audiocfg->out.name); |
| 5894 | } |
| 5895 | |
| 5896 | hb_list_add(job->list_audio, audio); |
| 5897 | return 1; |
| 5898 | } |
| 5899 | |
| 5900 | hb_audio_config_t * hb_list_audio_config_item(hb_list_t * list, int i) |
| 5901 | { |
no test coverage detected