mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-04-14 00:58:38 +02:00
avconv: rename OutputStream.is_past_recording_time to finished.
The new name is shorter and more accurate, since this variable is no longer used only for checking recording time constraint.
This commit is contained in:
parent
0c00fd80ee
commit
57d2422559
15
avconv.c
15
avconv.c
@ -345,7 +345,7 @@ static int check_recording_time(OutputStream *ost)
|
|||||||
if (of->recording_time != INT64_MAX &&
|
if (of->recording_time != INT64_MAX &&
|
||||||
av_compare_ts(ost->sync_opts - ost->first_pts, ost->st->codec->time_base, of->recording_time,
|
av_compare_ts(ost->sync_opts - ost->first_pts, ost->st->codec->time_base, of->recording_time,
|
||||||
AV_TIME_BASE_Q) >= 0) {
|
AV_TIME_BASE_Q) >= 0) {
|
||||||
ost->is_past_recording_time = 1;
|
ost->finished = 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
@ -729,8 +729,7 @@ static int poll_filters(void)
|
|||||||
for (i = 0; i < nb_output_streams; i++) {
|
for (i = 0; i < nb_output_streams; i++) {
|
||||||
int64_t pts = output_streams[i]->sync_opts;
|
int64_t pts = output_streams[i]->sync_opts;
|
||||||
|
|
||||||
if (!output_streams[i]->filter ||
|
if (!output_streams[i]->filter || output_streams[i]->finished)
|
||||||
output_streams[i]->is_past_recording_time)
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
pts = av_rescale_q(pts, output_streams[i]->st->codec->time_base,
|
pts = av_rescale_q(pts, output_streams[i]->st->codec->time_base,
|
||||||
@ -747,7 +746,7 @@ static int poll_filters(void)
|
|||||||
ret = poll_filter(ost);
|
ret = poll_filter(ost);
|
||||||
|
|
||||||
if (ret == AVERROR_EOF) {
|
if (ret == AVERROR_EOF) {
|
||||||
ost->is_past_recording_time = 1;
|
ost->finished = 1;
|
||||||
|
|
||||||
if (opt_shortest)
|
if (opt_shortest)
|
||||||
return ret;
|
return ret;
|
||||||
@ -983,7 +982,7 @@ static void do_streamcopy(InputStream *ist, OutputStream *ost, const AVPacket *p
|
|||||||
|
|
||||||
if (of->recording_time != INT64_MAX &&
|
if (of->recording_time != INT64_MAX &&
|
||||||
ist->last_dts >= of->recording_time + of->start_time) {
|
ist->last_dts >= of->recording_time + of->start_time) {
|
||||||
ost->is_past_recording_time = 1;
|
ost->finished = 1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1932,13 +1931,13 @@ static int need_output(void)
|
|||||||
OutputFile *of = output_files[ost->file_index];
|
OutputFile *of = output_files[ost->file_index];
|
||||||
AVFormatContext *os = output_files[ost->file_index]->ctx;
|
AVFormatContext *os = output_files[ost->file_index]->ctx;
|
||||||
|
|
||||||
if (ost->is_past_recording_time ||
|
if (ost->finished ||
|
||||||
(os->pb && avio_tell(os->pb) >= of->limit_filesize))
|
(os->pb && avio_tell(os->pb) >= of->limit_filesize))
|
||||||
continue;
|
continue;
|
||||||
if (ost->frame_number >= ost->max_frames) {
|
if (ost->frame_number >= ost->max_frames) {
|
||||||
int j;
|
int j;
|
||||||
for (j = 0; j < of->ctx->nb_streams; j++)
|
for (j = 0; j < of->ctx->nb_streams; j++)
|
||||||
output_streams[of->ost_index + j]->is_past_recording_time = 1;
|
output_streams[of->ost_index + j]->finished = 1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2165,7 +2164,7 @@ static int process_input(void)
|
|||||||
|
|
||||||
if (ost->source_index == ifile->ist_index + i &&
|
if (ost->source_index == ifile->ist_index + i &&
|
||||||
(ost->stream_copy || ost->enc->type == AVMEDIA_TYPE_SUBTITLE))
|
(ost->stream_copy || ost->enc->type == AVMEDIA_TYPE_SUBTITLE))
|
||||||
ost->is_past_recording_time = 1;
|
ost->finished= 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
avconv.h
2
avconv.h
@ -288,7 +288,7 @@ typedef struct OutputStream {
|
|||||||
|
|
||||||
int64_t sws_flags;
|
int64_t sws_flags;
|
||||||
AVDictionary *opts;
|
AVDictionary *opts;
|
||||||
int is_past_recording_time;
|
int finished; /* no more packets should be written for this stream */
|
||||||
int stream_copy;
|
int stream_copy;
|
||||||
const char *attachment_filename;
|
const char *attachment_filename;
|
||||||
int copy_initial_nonkeyframes;
|
int copy_initial_nonkeyframes;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user