History

demux: don't log if track isn't refreshed

Also use demux_internal type for the refresh_track in style of other internal functions.

nanahi committed 2 years ago

Commit c461ea61 parent dc523b11 file · +7 −6Browse files

Unified · Split

demux/demux.c+7−6
@@ -3965,14 +3965,12 @@ static void initiate_refresh_seek(struct demux_internal *in, · 3964 unmodified lines
3965}3965}
3966 3966
3967// Called locked.3967// Called locked.
3968static void refresh_track(struct demuxer *demuxer, struct sh_stream *stream,3968static void refresh_track(struct demux_internal *in, struct sh_stream *stream,
3969 double ref_pts)3969 double ref_pts)
3970{3970{
3971 struct demux_internal *in = demuxer->in;
3972 struct demux_stream *ds = stream->ds;3971 struct demux_stream *ds = stream->ds;
3973 ref_pts = MP_ADD_PTS(ref_pts, -in->ts_offset);3972 ref_pts = MP_ADD_PTS(ref_pts, -in->ts_offset);
3974 3973
3975 MP_VERBOSE(in, "refresh track %d\n", stream->index);
3976 if (in->back_demuxing)3974 if (in->back_demuxing)
3977 ds->back_seek_pos = ref_pts;3975 ds->back_seek_pos = ref_pts;
3978 // Allow refresh seek for non-video streams, even if no packets have3976 // Allow refresh seek for non-video streams, even if no packets have
@@ -3982,8 +3980,11 @@ static void refresh_track(struct demuxer *demuxer, struct sh_stream *stream, · 3 unmodified lines
3982 // - If cache is enabled and a seek causes some new data to be cached, the demuxer3980 // - If cache is enabled and a seek causes some new data to be cached, the demuxer
3983 // is sought to the end of cache after cache joining. Switching track immediately3981 // is sought to the end of cache after cache joining. Switching track immediately
3984 // after this also causes the same problem.3982 // after this also causes the same problem.
3985 if (!in->after_seek || ds->type != STREAM_VIDEO)3983 if (!in->after_seek || ds->type != STREAM_VIDEO) {
3984 MP_VERBOSE(in, "refresh track %d (%s)\n", stream->index,
3985 stream_type_name(ds->type));
3986 initiate_refresh_seek(in, ds, ref_pts);3986 initiate_refresh_seek(in, ds, ref_pts);
3987 }
3987}3988}
3988 3989
3989// Set whether the given stream should return packets.3990// Set whether the given stream should return packets.
@@ -4002,7 +4003,7 @@ void demuxer_select_track(struct demuxer *demuxer, struct sh_stream *stream, · 12 unmodified lines
4002 update_stream_selection_state(in, ds);4003 update_stream_selection_state(in, ds);
4003 in->tracks_switched = true;4004 in->tracks_switched = true;
4004 if (ds->selected)4005 if (ds->selected)
4005 refresh_track(demuxer, stream, ref_pts);4006 refresh_track(in, stream, ref_pts);
4006 if (in->threading) {4007 if (in->threading) {
4007 mp_cond_signal(&in->wakeup);4008 mp_cond_signal(&in->wakeup);
4008 } else {4009 } else {
@@ -4022,7 +4023,7 @@ void demuxer_refresh_track(struct demuxer *demuxer, struct sh_stream *stream, · 13 unmodified lines
4022 mp_mutex_lock(&in->lock);4023 mp_mutex_lock(&in->lock);
4023 if (ds->selected) {4024 if (ds->selected) {
4024 update_stream_selection_state(in, ds);4025 update_stream_selection_state(in, ds);
4025 refresh_track(demuxer, stream, ref_pts);4026 refresh_track(in, stream, ref_pts);
4026 }4027 }
4027 mp_mutex_unlock(&in->lock);4028 mp_mutex_unlock(&in->lock);
4028}4029}

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