mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-09 08:39:41 +00:00
fftools/ffmpeg_dec: inline decode_audio() into dec_packet()
The former function is now trivial - it has 3 lines and cannot fail.
This commit is contained in:
parent
959a5decf2
commit
909f5dfae1
@ -128,17 +128,6 @@ static void audio_ts_process(InputStream *ist, AVFrame *frame)
|
|||||||
frame->time_base = tb_filter;
|
frame->time_base = tb_filter;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int decode_audio(InputStream *ist, AVFrame *decoded_frame)
|
|
||||||
{
|
|
||||||
ist->samples_decoded += decoded_frame->nb_samples;
|
|
||||||
|
|
||||||
audio_ts_process(ist, decoded_frame);
|
|
||||||
|
|
||||||
ist->nb_samples = decoded_frame->nb_samples;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int64_t video_duration_estimate(const InputStream *ist, const AVFrame *frame)
|
static int64_t video_duration_estimate(const InputStream *ist, const AVFrame *frame)
|
||||||
{
|
{
|
||||||
const InputFile *ifile = input_files[ist->file_index];
|
const InputFile *ifile = input_files[ist->file_index];
|
||||||
@ -467,14 +456,18 @@ int dec_packet(InputStream *ist, const AVPacket *pkt, int no_eof)
|
|||||||
|
|
||||||
frame->time_base = dec->pkt_timebase;
|
frame->time_base = dec->pkt_timebase;
|
||||||
|
|
||||||
ret = dec->codec_type == AVMEDIA_TYPE_AUDIO ?
|
if (dec->codec_type == AVMEDIA_TYPE_AUDIO) {
|
||||||
decode_audio(ist, frame) :
|
ist->samples_decoded += frame->nb_samples;
|
||||||
decode_video(ist, frame);
|
ist->nb_samples = frame->nb_samples;
|
||||||
|
|
||||||
if (ret < 0) {
|
audio_ts_process(ist, frame);
|
||||||
av_log(NULL, AV_LOG_FATAL, "Error while processing the decoded "
|
} else {
|
||||||
"data for stream #%d:%d\n", ist->file_index, ist->st->index);
|
ret = decode_video(ist, frame);
|
||||||
exit_program(1);
|
if (ret < 0) {
|
||||||
|
av_log(NULL, AV_LOG_FATAL, "Error while processing the decoded "
|
||||||
|
"data for stream #%d:%d\n", ist->file_index, ist->st->index);
|
||||||
|
exit_program(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ist->frames_decoded++;
|
ist->frames_decoded++;
|
||||||
|
Loading…
Reference in New Issue
Block a user