Return 1 if there remain streams where more output is wanted, 0 otherwise. */
| 3780 | |
| 3781 | /* Return 1 if there remain streams where more output is wanted, 0 otherwise. */ |
| 3782 | static int need_output(void) |
| 3783 | { |
| 3784 | int i; |
| 3785 | |
| 3786 | for (i = 0; i < nb_output_streams; i++) { |
| 3787 | OutputStream *ost = output_streams[i]; |
| 3788 | OutputFile *of = output_files[ost->file_index]; |
| 3789 | AVFormatContext *os = output_files[ost->file_index]->ctx; |
| 3790 | |
| 3791 | if (ost->finished || |
| 3792 | (os->pb && avio_tell(os->pb) >= of->limit_filesize)) |
| 3793 | continue; |
| 3794 | if (ost->frame_number >= ost->max_frames) { |
| 3795 | int j; |
| 3796 | for (j = 0; j < of->ctx->nb_streams; j++) |
| 3797 | close_output_stream(output_streams[of->ost_index + j]); |
| 3798 | continue; |
| 3799 | } |
| 3800 | |
| 3801 | return 1; |
| 3802 | } |
| 3803 | |
| 3804 | return 0; |
| 3805 | } |
| 3806 | |
| 3807 | /** |
| 3808 | * Select the output stream to process. |
no test coverage detected