On 04/01/2011 07:09 PM, Reinhard Tartler wrote:
>> +typedef struct AVPacketQueue {
>> +    AVPacketList *first_pkt, *last_pkt;
>> +    int nb_packets;
>> +    int size;
>> +    int abort_request;
>> +    pthread_mutex_t mutex;
>> +    pthread_cond_t cond;
>> +} AVPacketQueue;
> 
> err, does really each element of the queue need it's own mutex and
> condition variable? AFAIU your code, there is no race on single elements
> of the queue, but you are syncorinzing get() and puts() on elements of
> the queue.

I basically copied the ffplay one with the idea to factor it out once
the thing works.

> I wonder if this AVPacketQueue wouldn't be better placed somewhere in
> libavformat/

It is there mostly because I wanted to test it, sadly I got wrong the
packet duplication.

> TBH, I'm actually a bit surprised that we don't have a syncronized list
> implementation already.

I know and I want one (the decklink avdevice will use it)
> 
>>  #if CONFIG_AVFILTER
>>  
>>  static int configure_filters(AVInputStream *ist, AVOutputStream *ost)
>> @@ -447,6 +560,15 @@ static int decode_interrupt_cb(void)
>>      return q_pressed || (q_pressed = read_key() == 'q');
>>  }
>>  
>> +// kill the thread and free the queue
>> +static void stop_output_queue(AVOutputQueue *out)
>> +{
>> +    //pthread_cancel(out->th);
> 
> ??

This code shouldn't be committed, it is just for comment and ideas.

> I didn't test your patch, but you are changing the semantics of the
> loop. Shouldn't a 'new_pkt = *pkt' remain at the head of the loop?

Uhm... that is part of the first experiment to fix the breakage from
this patch ^^;

lu

-- 

Luca Barbato
Gentoo/linux
http://dev.gentoo.org/~lu_zero

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

Reply via email to