On 23.07.2017, at 12:20, Nicolas George <geo...@nsup.org> wrote:
> >> + if (!q->last_pkt) { >> + q->first_pkt = pkt1; >> + } else { >> + q->last_pkt->next = pkt1; >> + } If kept, I would invert the condition, otherwise the else is essentially a double-negation. >> + q->last_pkt = pkt1; > > There is a little known but nice simplification when implementing > linked-lists like that: instead of "last_pkt", have in the structure > "AVPacketList **tail", and you can write this whole block without a > condition: > > *q->tail = pkt1; > q->tail = &(*q->tail)->next; It's without condition and an optimization, I am not sure it quite qualifies as "simplification" though. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel