forked from FFmpeg/FFmpeg
fftools/ffmpeg_mux: drop OutputFile.format
It is no longer used outside of the muxing code (where we can access the muxer directly).
This commit is contained in:
parent
5b0589c8c3
commit
bfeb751171
3 changed files with 9 additions and 8 deletions
|
@ -611,7 +611,6 @@ typedef struct OutputFile {
|
||||||
|
|
||||||
int index;
|
int index;
|
||||||
|
|
||||||
const AVOutputFormat *format;
|
|
||||||
const char *url;
|
const char *url;
|
||||||
|
|
||||||
OutputStream **streams;
|
OutputStream **streams;
|
||||||
|
|
|
@ -370,10 +370,11 @@ fail:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void thread_set_name(OutputFile *of)
|
static void thread_set_name(Muxer *mux)
|
||||||
{
|
{
|
||||||
char name[16];
|
char name[16];
|
||||||
snprintf(name, sizeof(name), "mux%d:%s", of->index, of->format->name);
|
snprintf(name, sizeof(name), "mux%d:%s",
|
||||||
|
mux->of.index, mux->fc->oformat->name);
|
||||||
ff_thread_setname(name);
|
ff_thread_setname(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -417,7 +418,7 @@ int muxer_thread(void *arg)
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto finish;
|
goto finish;
|
||||||
|
|
||||||
thread_set_name(of);
|
thread_set_name(mux);
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
OutputStream *ost;
|
OutputStream *ost;
|
||||||
|
@ -515,8 +516,10 @@ int print_sdp(const char *filename)
|
||||||
if (!avc)
|
if (!avc)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
for (int i = 0; i < nb_output_files; i++) {
|
for (int i = 0; i < nb_output_files; i++) {
|
||||||
if (!strcmp(output_files[i]->format->name, "rtp")) {
|
Muxer *mux = mux_from_of(output_files[i]);
|
||||||
avc[j] = mux_from_of(output_files[i])->fc;
|
|
||||||
|
if (!strcmp(mux->fc->oformat->name, "rtp")) {
|
||||||
|
avc[j] = mux->fc;
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -756,7 +759,7 @@ int of_write_trailer(OutputFile *of)
|
||||||
|
|
||||||
mux->last_filesize = filesize(fc->pb);
|
mux->last_filesize = filesize(fc->pb);
|
||||||
|
|
||||||
if (!(of->format->flags & AVFMT_NOFILE)) {
|
if (!(fc->oformat->flags & AVFMT_NOFILE)) {
|
||||||
ret = avio_closep(&fc->pb);
|
ret = avio_closep(&fc->pb);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
av_log(mux, AV_LOG_ERROR, "Error closing file: %s\n", av_err2str(ret));
|
av_log(mux, AV_LOG_ERROR, "Error closing file: %s\n", av_err2str(ret));
|
||||||
|
|
|
@ -3063,7 +3063,6 @@ int of_open(const OptionsContext *o, const char *filename, Scheduler *sch)
|
||||||
av_strlcat(mux->log_name, oc->oformat->name, sizeof(mux->log_name));
|
av_strlcat(mux->log_name, oc->oformat->name, sizeof(mux->log_name));
|
||||||
|
|
||||||
|
|
||||||
of->format = oc->oformat;
|
|
||||||
if (recording_time != INT64_MAX)
|
if (recording_time != INT64_MAX)
|
||||||
oc->duration = recording_time;
|
oc->duration = recording_time;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue