mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2026-01-24 07:31:22 +01:00
avformat/hlsenc: correctly reset subtitle stream counter per-varstream
Without resetting it, if there was a previous set of varstreams with subtitles, it would subtract from all the streams, leading to chaos and segfaults when trying to access for example stream -1.
This commit is contained in:
parent
5ff181c025
commit
7e69129d2f
1 changed files with 1 additions and 1 deletions
|
|
@ -2427,7 +2427,6 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
|
|||
int is_ref_pkt = 1;
|
||||
int ret = 0, can_split = 1, i, j;
|
||||
int stream_index = 0;
|
||||
int subtitle_streams = 0;
|
||||
int range_length = 0;
|
||||
const char *proto = NULL;
|
||||
int use_temp_file = 0;
|
||||
|
|
@ -2435,6 +2434,7 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
|
|||
char *old_filename = NULL;
|
||||
|
||||
for (i = 0; i < hls->nb_varstreams; i++) {
|
||||
int subtitle_streams = 0;
|
||||
vs = &hls->var_streams[i];
|
||||
for (j = 0; j < vs->nb_streams; j++) {
|
||||
if (vs->streams[j]->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue