On 11/9/2019 7:01 PM, Derek Buitenhuis wrote: > On 09/11/2019 21:47, James Almer wrote: >> No, this encoder doesn't have an AVCodec->encode2() implementation, so >> it can't be used with the avcodec_encode_video2() API, only with the >> avcodec_send_frame()/avcodec_receive_packet() one, so no need to take >> user provided packets into consideration since those are not an option. >> If you use ff_alloc_packet2(), you'll be first copying the RaPacket to >> some internal buffer, which will then be copied into a ref counted >> buffer before being returned to the user. >> >> You can safely use av_new_packet() to allocate the packet buffer, as the >> AVPacket passed to AVCodec->receive_packet() will be freshly initialized >> and empty. > > How "obvious"...
Actually, i'm partly wrong, avcodec_receive_packet() is not ensuring the packet returned by the encoder is reference counted. So for this version it would give the user the output of ff_alloc_packet2() as is... Lovely. Guess an av_assert0() is in order. > > Anyway, simple fix. Update sent. > > - Derek > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > To unsubscribe, visit link above, or email > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe". > _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".