|
@@ -3134,20 +3134,12 @@ static int is_network_time_seekable_input(AVFormatContext *ic)
|
|
|
strstr(format_name, "applehttp") != NULL;
|
|
strstr(format_name, "applehttp") != NULL;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static int has_renderable_video_stream(VideoState *is)
|
|
|
|
|
-{
|
|
|
|
|
- if (!is || is->video_stream < 0 || !is->video_st) {
|
|
|
|
|
- return 0;
|
|
|
|
|
- }
|
|
|
|
|
- return !(is->video_st->disposition & AV_DISPOSITION_ATTACHED_PIC);
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
static int allow_network_time_seek_for_stream(AVFormatContext *ic, VideoState *is)
|
|
static int allow_network_time_seek_for_stream(AVFormatContext *ic, VideoState *is)
|
|
|
{
|
|
{
|
|
|
if (!is_network_time_seekable_input(ic) || !is) {
|
|
if (!is_network_time_seekable_input(ic) || !is) {
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|
|
|
- return has_renderable_video_stream(is);
|
|
|
|
|
|
|
+ return is->video_stream >= 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -3569,8 +3561,7 @@ static int read_thread(void *arg)
|
|
|
(strcmp(ic->iformat->name, "asf") == 0 ||
|
|
(strcmp(ic->iformat->name, "asf") == 0 ||
|
|
|
strcmp(ic->iformat->name, "asf_o") == 0 ||
|
|
strcmp(ic->iformat->name, "asf_o") == 0 ||
|
|
|
strstr(ic->iformat->name, "asf") != NULL));
|
|
strstr(ic->iformat->name, "asf") != NULL));
|
|
|
- int is_audio_only_stream = !has_renderable_video_stream(is);
|
|
|
|
|
- int use_safe_byte_seek = is_asf_format || is_audio_only_stream;
|
|
|
|
|
|
|
+ int use_safe_byte_seek = is_asf_format;
|
|
|
int64_t local_seek_target = seek_target;
|
|
int64_t local_seek_target = seek_target;
|
|
|
int64_t local_seek_min = seek_min;
|
|
int64_t local_seek_min = seek_min;
|
|
|
int64_t local_seek_max = seek_max;
|
|
int64_t local_seek_max = seek_max;
|
|
@@ -3592,8 +3583,8 @@ static int read_thread(void *arg)
|
|
|
effective_seek_target = local_seek_target;
|
|
effective_seek_target = local_seek_target;
|
|
|
|
|
|
|
|
if (use_safe_byte_seek) {
|
|
if (use_safe_byte_seek) {
|
|
|
- // Avoid avformat_seek_file for fragile local ASF/audio-only streams.
|
|
|
|
|
- const char *safe_seek_name = is_asf_format ? "ASF" : "audio-only";
|
|
|
|
|
|
|
+ // Avoid avformat_seek_file for fragile local ASF streams.
|
|
|
|
|
+ const char *safe_seek_name = "ASF";
|
|
|
if (!ic->pb || !(ic->pb->seekable & AVIO_SEEKABLE_NORMAL)) {
|
|
if (!ic->pb || !(ic->pb->seekable & AVIO_SEEKABLE_NORMAL)) {
|
|
|
av_log(ffp, AV_LOG_WARNING, "heanup: %s stream is not byte-seekable, reject seek\n", safe_seek_name);
|
|
av_log(ffp, AV_LOG_WARNING, "heanup: %s stream is not byte-seekable, reject seek\n", safe_seek_name);
|
|
|
ret = -1;
|
|
ret = -1;
|