X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=mux.cpp;h=5e9043e78906989031e3c8bb30d0077ace184b54;hb=327534a3031a332423411c9599c741f2f81657df;hp=f52f795029c7ff3fd30daff5126244919de56def;hpb=ad1641ad3ab50ecd17af2e1c2d980f26e6adf0bb;p=nageru diff --git a/mux.cpp b/mux.cpp index f52f795..5e9043e 100644 --- a/mux.cpp +++ b/mux.cpp @@ -75,7 +75,7 @@ Mux::Mux(AVFormatContext *avctx, int width, int height, Codec video_codec, const // Note that there's no way to change this per-frame as the H.264 stream // would like to be able to. avstream_video->codecpar->color_primaries = AVCOL_PRI_BT709; // RGB colorspace (inout_format.color_space). - avstream_video->codecpar->color_trc = AVCOL_TRC_UNSPECIFIED; // Gamma curve (inout_format.gamma_curve). + avstream_video->codecpar->color_trc = AVCOL_TRC_IEC61966_2_1; // Gamma curve (inout_format.gamma_curve). // YUV colorspace (output_ycbcr_format.luma_coefficients). if (global_flags.ycbcr_rec709_coefficients) { avstream_video->codecpar->color_space = AVCOL_SPC_BT709; @@ -148,7 +148,8 @@ Mux::~Mux() void Mux::add_packet(const AVPacket &pkt, int64_t pts, int64_t dts, AVRational timebase) { AVPacket pkt_copy; - if (av_copy_packet(&pkt_copy, &pkt) < 0) { + av_init_packet(&pkt_copy); + if (av_packet_ref(&pkt_copy, &pkt) < 0) { fprintf(stderr, "av_copy_packet() failed\n"); exit(1); }