Merge remote branch 'qatar/master'
* qatar/master: psymodel: extend API to include PE and bit allocation. avio: always compile dyn_buf functions Remove unnecessary parameter from ff_thread_init() and fix behavior Revert "aac_latm_dec: use aac context and aac m4ac" configure: tell user if libva is enabled like the rest of external libs. Add silence support for AV_SAMPLE_FMT_U8. avio: make URL_PROTOCOL_FLAG_NESTED_SCHEME internal avio: deprecate av_url_read_seek avio: deprecate av_url_read_pause ac3enc: NEON optimised extract_exponents Conflicts: libavcodec/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
11d78415ca
12 changed files with 76 additions and 35 deletions
10
ffmpeg.c
10
ffmpeg.c
|
@ -1475,6 +1475,14 @@ static void print_report(AVFormatContext **output_files,
|
|||
}
|
||||
}
|
||||
|
||||
static void generate_silence(uint8_t* buf, enum AVSampleFormat sample_fmt, size_t size)
|
||||
{
|
||||
int fill_char = 0x00;
|
||||
if (sample_fmt == AV_SAMPLE_FMT_U8)
|
||||
fill_char = 0x80;
|
||||
memset(buf, fill_char, size);
|
||||
}
|
||||
|
||||
/* pkt = NULL means EOF (needed to flush decoder buffers) */
|
||||
static int output_packet(AVInputStream *ist, int ist_index,
|
||||
AVOutputStream **ost_table, int nb_ostreams,
|
||||
|
@ -1826,7 +1834,7 @@ static int output_packet(AVInputStream *ist, int ist_index,
|
|||
int frame_bytes = enc->frame_size*osize*enc->channels;
|
||||
if (allocated_audio_buf_size < frame_bytes)
|
||||
ffmpeg_exit(1);
|
||||
memset(audio_buf+fifo_bytes, 0, frame_bytes - fifo_bytes);
|
||||
generate_silence(audio_buf+fifo_bytes, enc->sample_fmt, frame_bytes - fifo_bytes);
|
||||
}
|
||||
|
||||
ret = avcodec_encode_audio(enc, bit_buffer, bit_buffer_size, (short *)audio_buf);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue