On 16/10/15 19:09, wm4 wrote:
> On Thu, 15 Oct 2015 02:26:43 +0200
> Luca Barbato <[email protected]> wrote:
> 
>> ---
>>  avplay.c | 12 +++++++-----
>>  1 file changed, 7 insertions(+), 5 deletions(-)
>>
>> diff --git a/avplay.c b/avplay.c
>> index 7f1bbb7..f934c3d 100644
>> --- a/avplay.c
>> +++ b/avplay.c
>> @@ -319,15 +319,17 @@ static void packet_queue_end(PacketQueue *q)
>>  static int packet_queue_put(PacketQueue *q, AVPacket *pkt)
>>  {
>>      AVPacketList *pkt1;
>> -
>> -    /* duplicate the packet */
>> -    if (pkt != &flush_pkt && av_dup_packet(pkt) < 0)
>> -        return -1;
>> +    int ret;
>>  
>>      pkt1 = av_malloc(sizeof(AVPacketList));
>>      if (!pkt1)
>> +        return AVERROR(ENOMEM);
>> +
>> +    /* duplicate the packet */
>> +    if (pkt != &flush_pkt &&
>> +        (ret = av_packet_ref(&pkt1->pkt, pkt)) < 0)
>>          return -1;
>> -    pkt1->pkt = *pkt;
>> +
>>      pkt1->next = NULL;
>>  
> 
> Fails to initialize pkt1->pkt if pkt is a flush packet?

Good catch. I wonder why avplay works though...

lu

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to