History

fftools/ffmpeg_demux: don't flag timestamps as unreliable if they are generated

Regardless of the source being an AVFMT_NOTIMESTAMPS format, if the timestamps are generated like when using the use_wallclock_as_timestamps demuxer option, then they are reliable. Fixes ticket #11268

James Almer committed 1 year ago

Commit 1787fad1 parent 82aeee31 file · +10 −1Browse files

Unified · Split

fftools/ffmpeg_demux.c+10−1
@@ -945,9 +945,18 @@ int ist_use(InputStream *ist, int decoding_needed, · 944 unmodified lines
945945
946946 if (decoding_needed && ds->sch_idx_dec < 0) {
947947 int is_audio = ist->st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO;
948+ int is_unreliable = !!(d->f.ctx->iformat->flags & AVFMT_NOTIMESTAMPS);
949+ int64_t use_wallclock_as_timestamps;
950+
951+ ret = av_opt_get_int(d->f.ctx, "use_wallclock_as_timestamps", 0, &use_wallclock_as_timestamps);
952+ if (ret < 0)
953+ return ret;
954+
955+ if (use_wallclock_as_timestamps)
956+ is_unreliable = 0;
948957
949958 ds->dec_opts.flags |= (!!ist->fix_sub_duration * DECODER_FLAG_FIX_SUB_DURATION) |
950− (!!(d->f.ctx->iformat->flags & AVFMT_NOTIMESTAMPS) * DECODER_FLAG_TS_UNRELIABLE) |
959+ (!!is_unreliable * DECODER_FLAG_TS_UNRELIABLE) |
951960 (!!(d->loop && is_audio) * DECODER_FLAG_SEND_END_TS)
952961 #if FFMPEG_OPT_TOP
953962 | ((ist->top_field_first >= 0) * DECODER_FLAG_TOP_FIELD_FIRST)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t