Lines Matching defs:ret
178 int ret;
185 if ((ret = av_frame_get_buffer(frame, 0)) < 0)
186 return ret;
226 int ret;
231 ret = av_buffersrc_add_frame_flags(ist->filters[i]->filter, frame,
234 if (ret != AVERROR_EOF && ret < 0)
236 av_err2str(ret));
315 int ret;
320 ret = av_buffersrc_add_frame(ist->filters[i]->filter, NULL);
321 if (ret != AVERROR_EOF && ret < 0)
352 int ret;
357 ret = write(2/*STDERR_FILENO*/, "Received > 3 system signals, hard exiting\n",
359 if (ret < 0) { /* Do nothing */ };
514 static void ffmpeg_cleanup(int ret)
651 } else if (ret && atomic_load(&transcode_init_done)) {
728 int ret = 0;
732 ret = av_bsf_send_packet(ost->bsf_ctx, eof ? NULL : pkt);
733 if (ret < 0)
735 while ((ret = av_bsf_receive_packet(ost->bsf_ctx, pkt)) >= 0)
737 if (ret == AVERROR(EAGAIN))
738 ret = 0;
743 if (ret < 0 && ret != AVERROR_EOF) {
814 int ret = AVERROR_BUG;
820 ret = init_output_stream(ost, frame, error, sizeof(error));
821 if (ret < 0) {
829 return ret;
898 int ret;
914 ret = avcodec_send_frame(enc, frame);
915 if (ret < 0 && !(ret == AVERROR_EOF && !frame)) {
918 return ret;
922 ret = avcodec_receive_packet(enc, pkt);
927 if ((ret >= 0 || ret == AVERROR_EOF) && ost->logfile && enc->stats_out)
930 if (ret == AVERROR(EAGAIN)) {
933 } else if (ret == AVERROR_EOF) {
935 return ret;
936 } else if (ret < 0) {
938 return ret;
977 int ret;
989 ret = encode_frame(of, ost, frame);
990 if (ret < 0)
1082 int ret;
1281 ret = encode_frame(of, ost, in_picture);
1282 if (ret < 0)
1324 int ret = 0;
1345 ret = av_buffersink_get_frame_flags(filter, filtered_frame,
1347 if (ret < 0) {
1348 if (ret != AVERROR(EAGAIN) && ret != AVERROR_EOF) {
1350 "Error in av_buffersink_get_frame_flags(): %s\n", av_err2str(ret));
1351 } else if (flush && ret == AVERROR_EOF) {
1523 int ret;
1705 if ((ret = avio_closep(&progress_avio)) < 0)
1707 "Error closing progress log, loss of information possible: %s\n", av_err2str(ret));
1719 int ret;
1728 ret = av_channel_layout_copy(&ifilter->ch_layout, &par->ch_layout);
1729 if (ret < 0)
1730 return ret;
1737 int i, ret;
1770 ret = configure_filtergraph(fg);
1771 if (ret < 0) {
1785 ret = encode_frame(of, ost, NULL);
1786 if (ret != AVERROR_EOF)
1907 static void check_decode_result(InputStream *ist, int *got_output, int ret)
1909 if (*got_output || ret<0)
1910 decode_error_stat[ret<0] ++;
1912 if (ret < 0 && exit_on_error)
1941 int need_reinit, ret;
1975 ret = ifilter_parameters_from_frame(ifilter, frame);
1976 if (ret < 0)
1977 return ret;
1987 ret = av_fifo_write(ifilter->frame_queue, &tmp, 1);
1988 if (ret < 0)
1991 return ret;
1994 ret = reap_filters(1);
1995 if (ret < 0 && ret != AVERROR_EOF) {
1996 av_log(NULL, AV_LOG_ERROR, "Error while filtering: %s\n", av_err2str(ret));
1997 return ret;
2000 ret = configure_filtergraph(fg);
2001 if (ret < 0) {
2003 return ret;
2007 ret = av_buffersrc_add_frame_flags(ifilter->filter, frame, buffersrc_flags);
2008 if (ret < 0) {
2009 if (ret != AVERROR_EOF)
2010 av_log(NULL, AV_LOG_ERROR, "Error while filtering: %s\n", av_err2str(ret));
2011 return ret;
2019 int ret;
2024 ret = av_buffersrc_close(ifilter->filter, pts, AV_BUFFERSRC_FLAG_PUSH);
2025 if (ret < 0)
2026 return ret;
2030 ret = ifilter_parameters_from_codecpar(ifilter, ifilter->ist->st->codecpar);
2031 if (ret < 0)
2032 return ret;
2049 int ret;
2054 ret = avcodec_send_packet(avctx, pkt);
2057 if (ret < 0 && ret != AVERROR_EOF)
2058 return ret;
2061 ret = avcodec_receive_frame(avctx, frame);
2062 if (ret < 0 && ret != AVERROR(EAGAIN))
2063 return ret;
2064 if (ret >= 0)
2072 int i, ret;
2074 av_assert1(ist->nb_filters > 0); /* ensure ret is initialized */
2076 ret = ifilter_send_frame(ist->filters[i], decoded_frame, i < ist->nb_filters - 1);
2077 if (ret == AVERROR_EOF)
2078 ret = 0; /* ignore */
2079 if (ret < 0) {
2081 "Failed to inject frame into filter network: %s\n", av_err2str(ret));
2085 return ret;
2093 int ret, err = 0;
2097 ret = decode(avctx, decoded_frame, got_output, pkt);
2099 if (ret < 0)
2102 if (ret >= 0 && avctx->sample_rate <= 0) {
2104 ret = AVERROR_INVALIDDATA;
2107 if (ret != AVERROR_EOF)
2108 check_decode_result(ist, got_output, ret);
2110 if (!*got_output || ret < 0)
2111 return ret;
2145 return err < 0 ? err : ret;
2152 int i, ret = 0, err = 0;
2179 ret = decode(ist->dec_ctx, decoded_frame, got_output, pkt);
2181 if (ret < 0)
2199 if (ret != AVERROR_EOF)
2200 check_decode_result(ist, got_output, ret);
2202 if (*got_output && ret >= 0) {
2216 if (!*got_output || ret < 0)
2217 return ret;
2270 return err < 0 ? err : ret;
2278 int i, ret = avcodec_decode_subtitle2(ist->dec_ctx,
2281 check_decode_result(NULL, got_output, ret);
2283 if (ret < 0 || !*got_output) {
2287 return ret;
2304 FFSWAP(int, ret, ist->prev_sub.ret);
2311 return ret;
2321 ret = av_fifo_write(ist->sub2video.sub_queue, &subtitle, 1);
2322 if (ret < 0)
2345 return ret;
2350 int i, ret;
2356 ret = ifilter_send_eof(ist->filters[i], pts);
2357 if (ret < 0)
2358 return ret;
2366 int ret = 0, i;
2391 ret = av_packet_ref(avpkt, pkt);
2392 if (ret < 0)
2393 return ret;
2414 ret = decode_audio (ist, repeating ? NULL : avpkt, &got_output,
2419 ret = decode_video (ist, repeating ? NULL : avpkt, &got_output, &duration_pts, !pkt,
2449 ret = transcode_subtitles(ist, avpkt, &got_output, &decode_failed);
2450 if (!pkt && ret >= 0)
2451 ret = AVERROR_EOF;
2458 if (ret == AVERROR_EOF) {
2463 if (ret < 0) {
2466 ist->file_index, ist->st->index, av_err2str(ret));
2499 int ret = send_filter_eof(ist);
2500 if (ret < 0) {
2556 int ret;
2580 ret = hwaccel_decode_init(s);
2581 if (ret < 0) {
2603 int ret;
2639 ret = hw_device_setup_for_decode(ist);
2640 if (ret < 0) {
2643 ist->file_index, ist->st->index, av_err2str(ret));
2644 return ret;
2647 if ((ret = avcodec_open2(ist->dec_ctx, codec, &ist->decoder_opts)) < 0) {
2648 if (ret == AVERROR_EXPERIMENTAL)
2654 ist->file_index, ist->st->index, av_err2str(ret));
2655 return ret;
2681 int ret;
2686 ret = avcodec_parameters_copy(ctx->par_in, ost->st->codecpar);
2687 if (ret < 0)
2688 return ret;
2692 ret = av_bsf_init(ctx);
2693 if (ret < 0) {
2696 return ret;
2699 ret = avcodec_parameters_copy(ost->st->codecpar, ctx->par_out);
2700 if (ret < 0)
2701 return ret;
2714 int i, ret;
2719 ret = avcodec_parameters_to_context(ost->enc_ctx, ist->st->codecpar);
2720 if (ret >= 0)
2721 ret = av_opt_set_dict(ost->enc_ctx, &ost->encoder_opts);
2722 if (ret < 0) {
2725 return ret;
2728 ret = avcodec_parameters_from_context(par_src, ost->enc_ctx);
2729 if (ret < 0) {
2732 return ret;
2743 ret = avcodec_parameters_copy(par_dst, par_src);
2744 if (ret < 0)
2745 return ret;
2757 ret = avformat_transfer_internal_stream_timing_info(of->format, ost->st, ist->st, copy_tb);
2758 if (ret < 0)
2759 return ret;
2961 int ret;
3002 ret = av_buffersink_get_ch_layout(ost->filter->filter, &enc_ctx->ch_layout);
3003 if (ret < 0)
3004 return ret;
3079 ret = av_expr_parse(&ost->forced_keyframes_pexpr, ost->forced_keyframes+5,
3081 if (ret < 0) {
3084 return ret;
3120 int ret = 0;
3127 ret = init_output_stream_encode(ost, frame);
3128 if (ret < 0)
3129 return ret;
3144 ret = hw_device_setup_for_encode(ost);
3145 if (ret < 0) {
3148 ost->file_index, ost->index, av_err2str(ret));
3149 return ret;
3170 if ((ret = avcodec_open2(ost->enc_ctx, codec, &ost->encoder_opts)) < 0) {
3171 if (ret == AVERROR_EXPERIMENTAL)
3177 return ret;
3189 ret = avcodec_parameters_from_context(ost->st->codecpar, ost->enc_ctx);
3190 if (ret < 0) {
3240 ret = init_output_stream_streamcopy(ost);
3241 if (ret < 0)
3242 return ret;
3248 ret = init_output_bsfs(ost);
3249 if (ret < 0)
3250 return ret;
3254 ret = of_check_init(output_files[ost->file_index]);
3255 if (ret < 0)
3256 return ret;
3258 return ret;
3278 int ret = 0, i, j, k;
3309 if ((ret = init_input_stream(i, error, sizeof(error))) < 0) {
3332 ret = init_output_stream_wrapper(output_streams[i], NULL, 0);
3333 if (ret < 0)
3357 ret = of_check_init(output_files[i]);
3358 if (ret < 0)
3447 if (ret) {
3449 return ret;
3529 int i, ret, key;
3576 ret = avfilter_graph_send_command(fg->graph, target, command, arg, buf, sizeof(buf),
3578 fprintf(stderr, "Command reply for stream %d: ret:%d res:\n%s", i, ret, buf);
3581 ret = AVERROR_PATCHWELCOME;
3583 ret = avfilter_graph_queue_command(fg->graph, target, command, arg, 0, time);
3584 if (ret < 0)
3585 fprintf(stderr, "Queuing command failed with error %s\n", av_err2str(ret));
3648 int ret = 0;
3651 ret = av_read_frame(f->ctx, pkt);
3653 if (ret == AVERROR(EAGAIN)) {
3657 if (ret < 0) {
3658 av_thread_message_queue_set_err_recv(f->in_thread_queue, ret);
3668 ret = av_thread_message_queue_send(f->in_thread_queue, &queue_pkt, flags);
3669 if (flags && ret == AVERROR(EAGAIN)) {
3671 ret = av_thread_message_queue_send(f->in_thread_queue, &queue_pkt, flags);
3677 if (ret < 0) {
3678 if (ret != AVERROR_EOF)
3681 av_err2str(ret));
3683 av_thread_message_queue_set_err_recv(f->in_thread_queue, ret);
3717 int ret;
3728 ret = av_thread_message_queue_alloc(&f->in_thread_queue,
3730 if (ret < 0)
3731 return ret;
3733 if ((ret = pthread_create(&f->thread, NULL, input_thread, f))) {
3734 av_log(NULL, AV_LOG_ERROR, "pthread_create failed: %s. Try to increase `ulimit -v` or decrease `ulimit -s`.\n", strerror(ret));
3736 return AVERROR(ret);
3744 int i, ret;
3747 ret = init_input_thread(i);
3748 if (ret < 0)
3749 return ret;
3813 int ret;
3820 ret = av_compare_ts(*duration, time_base, tmp, tmp_time_base);
3821 if (ret < 0) {
3833 int i, ret, has_audio = 0;
3836 ret = avformat_seek_file(is, -1, INT64_MIN, is->start_time, is->start_time, 0);
3837 if (ret < 0)
3838 return ret;
3885 return ret;
3901 int ret, thread_ret, i, j;
3907 ret = get_input_packet(ifile, &pkt);
3909 if (ret == AVERROR(EAGAIN)) {
3911 return ret;
3913 if (ret < 0 && ifile->loop) {
3919 ret = process_input_packet(ist, NULL, 1);
3920 if (ret>0)
3929 ret = seek_to_start(ifile, is);
3935 if (ret < 0)
3938 ret = get_input_packet(ifile, &pkt);
3939 if (ret == AVERROR(EAGAIN)) {
3941 return ret;
3944 if (ret < 0) {
3945 if (ret != AVERROR_EOF) {
3946 print_error(is->url, ret);
3954 ret = process_input_packet(ist, NULL, 0);
3955 if (ret>0)
4193 int i, ret;
4199 ret = avfilter_graph_request_oldest(graph->graph);
4200 if (ret >= 0)
4203 if (ret == AVERROR_EOF) {
4204 ret = reap_filters(1);
4207 return ret;
4209 if (ret != AVERROR(EAGAIN))
4210 return ret;
4241 int ret;
4256 ret = configure_filtergraph(ost->filter->graph);
4257 if (ret < 0) {
4259 return ret;
4289 if ((ret = transcode_from_filter(ost->filter->graph, &ist)) < 0)
4290 return ret;
4311 ret = process_input(ist->file_index);
4312 if (ret == AVERROR(EAGAIN)) {
4318 if (ret < 0)
4319 return ret == AVERROR_EOF ? 0 : ret;
4329 int ret, i;
4336 ret = transcode_init();
4337 if (ret < 0)
4347 if ((ret = init_input_threads()) < 0)
4365 ret = transcode_step();
4366 if (ret < 0 && ret != AVERROR_EOF) {
4367 av_log(NULL, AV_LOG_ERROR, "Error while filtering: %s\n", av_err2str(ret));
4391 ret = of_write_trailer(output_files[i]);
4392 if (ret < 0 && exit_on_error)
4403 if ((ret = avio_closep(&os->pb)) < 0) {
4404 av_log(NULL, AV_LOG_ERROR, "Error closing file %s: %s\n", os->url, av_err2str(ret));
4442 ret = 0;
4469 return ret;
4518 int i, ret;
4538 ret = ffmpeg_parse_options(argc, argv);
4539 if (ret < 0)