Skip to content

Commit

Permalink
subtitles: do not seek when setting track if stream not seekeable or …
Browse files Browse the repository at this point in the history
…time is below zero
  • Loading branch information
courville committed Aug 24, 2024
1 parent 97e6c55 commit e4a16b4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Source/stream_subtitle.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,9 +447,10 @@ serprintf("SsS: sub_stream already set\n");

// FIXME: there should be a better way without seek jumping
int current_time = stream_get_current_time( s, NULL );
// reseek to current time to get internal subtitle decoder to reinitialize
stream_seek_time( s, current_time - 1, STREAM_SEEK_BACKWARD, 0 );

if( current_time > 0 && thread_state_get( &s->parser_tstate ) != THREAD_EXIT && s->parser->seekable && s->parser->seekable( s ) ) {
// reseek to current time to get internal subtitle decoder to reinitialize
stream_seek_time( s, current_time - 1, STREAM_SEEK_BACKWARD, 0 );
}
return 0;
}

Expand Down

0 comments on commit e4a16b4

Please sign in to comment.