avformat/wvenc: Make init function out of write_header

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2021-12-18 11:57:56 +01:00
parent ba27e248cf
commit 16b1df7541
1 changed files with 2 additions and 2 deletions

View File

@ -30,7 +30,7 @@ typedef struct WvMuxContext {
int64_t samples; int64_t samples;
} WvMuxContext; } WvMuxContext;
static av_cold int wv_write_header(AVFormatContext *ctx) static av_cold int wv_init(AVFormatContext *ctx)
{ {
if (ctx->nb_streams > 1 || if (ctx->nb_streams > 1 ||
ctx->streams[0]->codecpar->codec_id != AV_CODEC_ID_WAVPACK) { ctx->streams[0]->codecpar->codec_id != AV_CODEC_ID_WAVPACK) {
@ -84,7 +84,7 @@ const AVOutputFormat ff_wv_muxer = {
.priv_data_size = sizeof(WvMuxContext), .priv_data_size = sizeof(WvMuxContext),
.audio_codec = AV_CODEC_ID_WAVPACK, .audio_codec = AV_CODEC_ID_WAVPACK,
.video_codec = AV_CODEC_ID_NONE, .video_codec = AV_CODEC_ID_NONE,
.write_header = wv_write_header, .init = wv_init,
.write_packet = wv_write_packet, .write_packet = wv_write_packet,
.write_trailer = wv_write_trailer, .write_trailer = wv_write_trailer,
.flags = AVFMT_NOTIMESTAMPS, .flags = AVFMT_NOTIMESTAMPS,