You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
lavf/segment: fix logic for segmenting audio-only inputs
Also add a comment for clarifying the logic. Fix trac ticket #1290.
This commit is contained in:
@@ -203,7 +203,8 @@ static int seg_write_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
int64_t end_pts = seg->recording_time * seg->number;
|
int64_t end_pts = seg->recording_time * seg->number;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if ((seg->has_video && st->codec->codec_type == AVMEDIA_TYPE_VIDEO) &&
|
/* if the segment has video, start a new segment *only* with a key video frame */
|
||||||
|
if ((st->codec->codec_type == AVMEDIA_TYPE_VIDEO || !seg->has_video) &&
|
||||||
av_compare_ts(pkt->pts, st->time_base,
|
av_compare_ts(pkt->pts, st->time_base,
|
||||||
end_pts, AV_TIME_BASE_Q) >= 0 &&
|
end_pts, AV_TIME_BASE_Q) >= 0 &&
|
||||||
pkt->flags & AV_PKT_FLAG_KEY) {
|
pkt->flags & AV_PKT_FLAG_KEY) {
|
||||||
|
Reference in New Issue
Block a user