st->cur_dts = pkt->dts;
if (s->debug & FF_FDEBUG_TS)
- av_log(s, AV_LOG_DEBUG, "OUTdelayed:%d/%d pts:%s, dts:%s cur_dts:%s\n",
- presentation_delayed, delay, av_ts2str(pkt->pts), av_ts2str(pkt->dts), av_ts2str(st->cur_dts));
+ av_log(s, AV_LOG_DEBUG, "OUTdelayed:%d/%d pts:%s, dts:%s cur_dts:%s st:%d (%d)\n",
+ presentation_delayed, delay, av_ts2str(pkt->pts), av_ts2str(pkt->dts), av_ts2str(st->cur_dts), st->index, st->id);
/* update flags */
if (st->codecpar->codec_type == AVMEDIA_TYPE_DATA || is_intra_only(st->codecpar->codec_id))
AVStream av_unused *st;
for (i = 0; i < ic->nb_streams; i++) {
st = ic->streams[i];
+ if (st->time_base.den)
av_log(ic, AV_LOG_TRACE, "stream %d: start_time: %0.3f duration: %0.3f\n", i,
(double) st->start_time * av_q2d(st->time_base),
(double) st->duration * av_q2d(st->time_base));
}
}
}
- st->info->duration_count++;
- st->info->rfps_duration_sum += duration;
+ if (st->info->rfps_duration_sum <= INT64_MAX - duration) {
+ st->info->duration_count++;
+ st->info->rfps_duration_sum += duration;
+ }
if (st->info->duration_count % 10 == 0) {
int n = st->info->duration_count;
continue;
}
}
- disposition = !(st->disposition & (AV_DISPOSITION_HEARING_IMPAIRED | AV_DISPOSITION_VISUAL_IMPAIRED));
+ disposition = !(st->disposition & (AV_DISPOSITION_HEARING_IMPAIRED | AV_DISPOSITION_VISUAL_IMPAIRED))
+ + !! (st->disposition & AV_DISPOSITION_DEFAULT);
count = st->codec_info_nb_frames;
bitrate = par->bit_rate;
multiframe = FFMIN(5, count);
* >0 if st is a matching stream
*/
static int match_stream_specifier(AVFormatContext *s, AVStream *st,
- const char *spec, const char **indexptr)
+ const char *spec, const char **indexptr, AVProgram **p)
{
int match = 1; /* Stores if the specifier matches so far. */
while (*spec) {
for (j = 0; j < s->programs[i]->nb_stream_indexes; j++) {
if (st->index == s->programs[i]->stream_index[j]) {
found = 1;
+ if (p)
+ *p = s->programs[i];
i = s->nb_programs;
break;
}
int ret, index;
char *endptr;
const char *indexptr = NULL;
+ AVProgram *p = NULL;
+ int nb_streams;
- ret = match_stream_specifier(s, st, spec, &indexptr);
+ ret = match_stream_specifier(s, st, spec, &indexptr, &p);
if (ret < 0)
goto error;
return (index == st->index);
/* If we requested a matching stream index, we have to ensure st is that. */
- for (int i = 0; i < s->nb_streams && index >= 0; i++) {
- ret = match_stream_specifier(s, s->streams[i], spec, NULL);
+ nb_streams = p ? p->nb_stream_indexes : s->nb_streams;
+ for (int i = 0; i < nb_streams && index >= 0; i++) {
+ AVStream *candidate = p ? s->streams[p->stream_index[i]] : s->streams[i];
+ ret = match_stream_specifier(s, candidate, spec, NULL, NULL);
if (ret < 0)
goto error;
- if (ret > 0 && index-- == 0 && st == s->streams[i])
+ if (ret > 0 && index-- == 0 && st == candidate)
return 1;
}
return 0;