summaryrefslogtreecommitdiff
path: root/chromium/third_party/ffmpeg/libavformat/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/ffmpeg/libavformat/utils.c')
-rw-r--r--chromium/third_party/ffmpeg/libavformat/utils.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/chromium/third_party/ffmpeg/libavformat/utils.c b/chromium/third_party/ffmpeg/libavformat/utils.c
index 39c118f9e89..61a0be02eb1 100644
--- a/chromium/third_party/ffmpeg/libavformat/utils.c
+++ b/chromium/third_party/ffmpeg/libavformat/utils.c
@@ -2948,6 +2948,7 @@ static void estimate_timings(AVFormatContext *ic, int64_t old_offset)
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));
@@ -4213,7 +4214,8 @@ int av_find_best_stream(AVFormatContext *ic, enum AVMediaType type,
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);
@@ -4725,7 +4727,7 @@ void av_url_split(char *proto, int proto_size,
char *hostname, int hostname_size,
int *port_ptr, char *path, int path_size, const char *url)
{
- const char *p, *ls, *ls2, *ls3, *at, *at2, *col, *brk;
+ const char *p, *ls, *ls2, *at, *at2, *col, *brk;
if (port_ptr)
*port_ptr = -1;
@@ -4755,9 +4757,6 @@ void av_url_split(char *proto, int proto_size,
/* separate path from hostname */
ls = strchr(p, '/');
ls2 = strchr(p, '?');
- ls3 = strchr(p, '@');
- if (ls3 && ls3 > ls && (!ls2 || ls2 > ls3))
- ls = strchr(ls3, '/');
if (!ls)
ls = ls2;
else if (ls && ls2)
@@ -5105,7 +5104,7 @@ AVRational av_guess_frame_rate(AVFormatContext *format, AVStream *st, AVFrame *f
* >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) {
@@ -5160,6 +5159,8 @@ FF_DISABLE_DEPRECATION_WARNINGS
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;
}
@@ -5262,8 +5263,10 @@ int avformat_match_stream_specifier(AVFormatContext *s, AVStream *st,
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;
@@ -5281,11 +5284,13 @@ int avformat_match_stream_specifier(AVFormatContext *s, AVStream *st,
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;