X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=shared%2Fmux.cpp;h=921605574d0a496841bc42215c4573b24faf3170;hb=50b6f9f570f4a2989fa45cc033cd983ad05cd9f6;hp=0a2eaef6a8310f53b5f7ea0d9a175ea1eb226570;hpb=ee6ece72bc12e5527e114e0e1973f0c0b2dc2138;p=nageru diff --git a/shared/mux.cpp b/shared/mux.cpp index 0a2eaef..9216055 100644 --- a/shared/mux.cpp +++ b/shared/mux.cpp @@ -61,9 +61,6 @@ Mux::Mux(AVFormatContext *avctx, int width, int height, Codec video_codec, const avstream_video->codecpar->codec_id = AV_CODEC_ID_H264; } else if (video_codec == CODEC_AV1) { avstream_video->codecpar->codec_id = AV_CODEC_ID_AV1; - } else if (video_codec == CODEC_NV12) { - avstream_video->codecpar->codec_id = AV_CODEC_ID_RAWVIDEO; - avstream_video->codecpar->codec_tag = avcodec_pix_fmt_to_codec_tag(AV_PIX_FMT_NV12); } else { assert(video_codec == CODEC_MJPEG); avstream_video->codecpar->codec_id = AV_CODEC_ID_MJPEG; @@ -167,6 +164,8 @@ Mux::~Mux() void Mux::add_packet(const AVPacket &pkt, int64_t pts, int64_t dts, AVRational timebase, int stream_index_override) { + assert(pts >= dts); + AVPacket pkt_copy; av_init_packet(&pkt_copy); if (av_packet_ref(&pkt_copy, &pkt) < 0) {