mirror of
https://mirror.skon.top/https://github.com/FFmpeg/FFmpeg
synced 2026-04-20 21:00:41 +08:00
avformat/mux: Add flag for "only default codecs allowed"
AVOutputFormat has default codecs for audio, video and subtitle and often these are the only codecs of this type allowed. So add a flag to AVOutputFormat so that this can be checked generically. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@@ -31,16 +31,6 @@ typedef struct WvMuxContext {
|
||||
int64_t samples;
|
||||
} WvMuxContext;
|
||||
|
||||
static av_cold int wv_init(AVFormatContext *ctx)
|
||||
{
|
||||
if (ctx->streams[0]->codecpar->codec_id != AV_CODEC_ID_WAVPACK) {
|
||||
av_log(ctx, AV_LOG_ERROR, "This muxer only supports a single WavPack stream.\n");
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int wv_write_packet(AVFormatContext *ctx, AVPacket *pkt)
|
||||
{
|
||||
WvMuxContext *s = ctx->priv_data;
|
||||
@@ -85,9 +75,9 @@ const FFOutputFormat ff_wv_muxer = {
|
||||
.p.audio_codec = AV_CODEC_ID_WAVPACK,
|
||||
.p.video_codec = AV_CODEC_ID_NONE,
|
||||
.p.subtitle_codec = AV_CODEC_ID_NONE,
|
||||
.init = wv_init,
|
||||
.write_packet = wv_write_packet,
|
||||
.write_trailer = wv_write_trailer,
|
||||
.p.flags = AVFMT_NOTIMESTAMPS,
|
||||
.flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH,
|
||||
.flags_internal = FF_OFMT_FLAG_MAX_ONE_OF_EACH |
|
||||
FF_OFMT_FLAG_ONLY_DEFAULT_CODECS,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user