X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=ffmpeg.c;h=b2e39e8d0eed3604c676cddbe57f65ae8aa8955b;hb=32388e04a80139740e495639e3237e99de3b5662;hp=c97f46285ee78566f1cd848638b0aa2e1df1ab5d;hpb=e37dbfddda0380fd9ea9ba1bbae8a5ab2afc6573;p=ffmpeg diff --git a/ffmpeg.c b/ffmpeg.c index c97f46285ee..b2e39e8d0ee 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -517,6 +517,8 @@ static void ffmpeg_cleanup(int ret) if (received_sigterm) { av_log(NULL, AV_LOG_INFO, "Received signal %d: terminating.\n", (int) received_sigterm); + } else if (ret && transcode_init_done) { + av_log(NULL, AV_LOG_INFO, "Conversion failed!\n"); } term_exit(); } @@ -1791,16 +1793,15 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output) decoded_frame_tb = avctx->time_base; } else if (decoded_frame->pkt_pts != AV_NOPTS_VALUE) { decoded_frame->pts = decoded_frame->pkt_pts; - pkt->pts = AV_NOPTS_VALUE; decoded_frame_tb = ist->st->time_base; } else if (pkt->pts != AV_NOPTS_VALUE) { decoded_frame->pts = pkt->pts; - pkt->pts = AV_NOPTS_VALUE; decoded_frame_tb = ist->st->time_base; }else { decoded_frame->pts = ist->dts; decoded_frame_tb = AV_TIME_BASE_Q; } + pkt->pts = AV_NOPTS_VALUE; if (decoded_frame->pts != AV_NOPTS_VALUE) decoded_frame->pts = av_rescale_delta(decoded_frame_tb, decoded_frame->pts, (AVRational){1, ist->st->codec->sample_rate}, decoded_frame->nb_samples, &ist->filter_in_rescale_delta_last, @@ -2149,7 +2150,7 @@ static void print_sdp(void) { char sdp[16384]; int i; - AVFormatContext **avc = av_malloc(sizeof(*avc) * nb_output_files); + AVFormatContext **avc = av_malloc_array(nb_output_files, sizeof(*avc)); if (!avc) exit_program(1); @@ -2284,7 +2285,7 @@ static void parse_forced_key_frames(char *kf, OutputStream *ost, if (*p == ',') n++; size = n; - pts = av_malloc(sizeof(*pts) * size); + pts = av_malloc_array(size, sizeof(*pts)); if (!pts) { av_log(NULL, AV_LOG_FATAL, "Could not allocate forced key frames array.\n"); exit_program(1);