mirror of https://git.ffmpeg.org/ffmpeg.git
fftools/ffmpeg_mux: move OutputStream.sq_idx_mux to private data
It should not be accessed outside of ffmpeg_mux*
This commit is contained in:
parent
2c54097614
commit
0d01e61807
|
@ -591,8 +591,6 @@ typedef struct OutputStream {
|
||||||
/* packet quality factor */
|
/* packet quality factor */
|
||||||
atomic_int quality;
|
atomic_int quality;
|
||||||
|
|
||||||
int sq_idx_mux;
|
|
||||||
|
|
||||||
EncStats enc_stats_pre;
|
EncStats enc_stats_pre;
|
||||||
EncStats enc_stats_post;
|
EncStats enc_stats_post;
|
||||||
|
|
||||||
|
|
|
@ -236,12 +236,12 @@ fail:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int sync_queue_process(Muxer *mux, OutputStream *ost, AVPacket *pkt, int *stream_eof)
|
static int sync_queue_process(Muxer *mux, MuxStream *ms, AVPacket *pkt, int *stream_eof)
|
||||||
{
|
{
|
||||||
OutputFile *of = &mux->of;
|
OutputFile *of = &mux->of;
|
||||||
|
|
||||||
if (ost->sq_idx_mux >= 0) {
|
if (ms->sq_idx_mux >= 0) {
|
||||||
int ret = sq_send(mux->sq_mux, ost->sq_idx_mux, SQPKT(pkt));
|
int ret = sq_send(mux->sq_mux, ms->sq_idx_mux, SQPKT(pkt));
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
if (ret == AVERROR_EOF)
|
if (ret == AVERROR_EOF)
|
||||||
*stream_eof = 1;
|
*stream_eof = 1;
|
||||||
|
@ -266,7 +266,7 @@ static int sync_queue_process(Muxer *mux, OutputStream *ost, AVPacket *pkt, int
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
} else if (pkt)
|
} else if (pkt)
|
||||||
return write_packet(mux, ost, pkt);
|
return write_packet(mux, &ms->ost, pkt);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -336,14 +336,14 @@ static int mux_packet_filter(Muxer *mux, MuxThreadContext *mt,
|
||||||
if (!bsf_eof)
|
if (!bsf_eof)
|
||||||
ms->bsf_pkt->time_base = ms->bsf_ctx->time_base_out;
|
ms->bsf_pkt->time_base = ms->bsf_ctx->time_base_out;
|
||||||
|
|
||||||
ret = sync_queue_process(mux, ost, bsf_eof ? NULL : ms->bsf_pkt, stream_eof);
|
ret = sync_queue_process(mux, ms, bsf_eof ? NULL : ms->bsf_pkt, stream_eof);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto mux_fail;
|
goto mux_fail;
|
||||||
}
|
}
|
||||||
*stream_eof = 1;
|
*stream_eof = 1;
|
||||||
return AVERROR_EOF;
|
return AVERROR_EOF;
|
||||||
} else {
|
} else {
|
||||||
ret = sync_queue_process(mux, ost, pkt, stream_eof);
|
ret = sync_queue_process(mux, ms, pkt, stream_eof);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto mux_fail;
|
goto mux_fail;
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,6 +50,8 @@ typedef struct MuxStream {
|
||||||
int sch_idx_enc;
|
int sch_idx_enc;
|
||||||
int sch_idx_src;
|
int sch_idx_src;
|
||||||
|
|
||||||
|
int sq_idx_mux;
|
||||||
|
|
||||||
int64_t max_frames;
|
int64_t max_frames;
|
||||||
|
|
||||||
// timestamp from which the streamcopied streams should start,
|
// timestamp from which the streamcopied streams should start,
|
||||||
|
|
|
@ -1923,7 +1923,7 @@ static int setup_sync_queues(Muxer *mux, AVFormatContext *oc, int64_t buf_size_u
|
||||||
MuxStream *ms = ms_from_ost(ost);
|
MuxStream *ms = ms_from_ost(ost);
|
||||||
enum AVMediaType type = ost->type;
|
enum AVMediaType type = ost->type;
|
||||||
|
|
||||||
ost->sq_idx_mux = -1;
|
ms->sq_idx_mux = -1;
|
||||||
|
|
||||||
nb_interleaved += IS_INTERLEAVED(type);
|
nb_interleaved += IS_INTERLEAVED(type);
|
||||||
nb_av_enc += IS_AV_ENC(ost, type);
|
nb_av_enc += IS_AV_ENC(ost, type);
|
||||||
|
@ -1992,13 +1992,13 @@ static int setup_sync_queues(Muxer *mux, AVFormatContext *oc, int64_t buf_size_u
|
||||||
if (!IS_INTERLEAVED(type))
|
if (!IS_INTERLEAVED(type))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ost->sq_idx_mux = sq_add_stream(mux->sq_mux,
|
ms->sq_idx_mux = sq_add_stream(mux->sq_mux,
|
||||||
of->shortest || ms->max_frames < INT64_MAX);
|
of->shortest || ms->max_frames < INT64_MAX);
|
||||||
if (ost->sq_idx_mux < 0)
|
if (ms->sq_idx_mux < 0)
|
||||||
return ost->sq_idx_mux;
|
return ms->sq_idx_mux;
|
||||||
|
|
||||||
if (ms->max_frames != INT64_MAX)
|
if (ms->max_frames != INT64_MAX)
|
||||||
sq_limit_frames(mux->sq_mux, ost->sq_idx_mux, ms->max_frames);
|
sq_limit_frames(mux->sq_mux, ms->sq_idx_mux, ms->max_frames);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue