Commit 985cd2b3 authored by benoit's avatar benoit

Add a parameter for queue size.

Patch by Anuradha Suraparaju anuradha rd bbc co uk


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@14150 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent e8b94276
...@@ -70,6 +70,7 @@ unsigned int ff_dirac_schro_get_video_format_idx (AVCodecContext *avccontext) ...@@ -70,6 +70,7 @@ unsigned int ff_dirac_schro_get_video_format_idx (AVCodecContext *avccontext)
void ff_dirac_schro_queue_init (FfmpegDiracSchroQueue *queue) void ff_dirac_schro_queue_init (FfmpegDiracSchroQueue *queue)
{ {
queue->p_head = queue->p_tail = NULL; queue->p_head = queue->p_tail = NULL;
queue->size = 0;
} }
void ff_dirac_schro_queue_free (FfmpegDiracSchroQueue *queue, void ff_dirac_schro_queue_free (FfmpegDiracSchroQueue *queue,
...@@ -96,6 +97,7 @@ int ff_dirac_schro_queue_push_back (FfmpegDiracSchroQueue *queue, void *p_data) ...@@ -96,6 +97,7 @@ int ff_dirac_schro_queue_push_back (FfmpegDiracSchroQueue *queue, void *p_data)
queue->p_tail->next = p_new; queue->p_tail->next = p_new;
queue->p_tail = p_new; queue->p_tail = p_new;
++queue->size;
return 0; return 0;
} }
...@@ -106,6 +108,7 @@ void *ff_dirac_schro_queue_pop (FfmpegDiracSchroQueue *queue) ...@@ -106,6 +108,7 @@ void *ff_dirac_schro_queue_pop (FfmpegDiracSchroQueue *queue)
if (top != NULL) { if (top != NULL) {
void *data = top->data; void *data = top->data;
queue->p_head = queue->p_head->next; queue->p_head = queue->p_head->next;
--queue->size;
av_freep (&top); av_freep (&top);
return data; return data;
} }
......
...@@ -80,6 +80,8 @@ typedef struct FfmpegDiracSchroQueue ...@@ -80,6 +80,8 @@ typedef struct FfmpegDiracSchroQueue
FfmpegDiracSchroQueueElement *p_head; FfmpegDiracSchroQueueElement *p_head;
/** Pointer to tail of queue */ /** Pointer to tail of queue */
FfmpegDiracSchroQueueElement *p_tail; FfmpegDiracSchroQueueElement *p_tail;
/** Queue size*/
int size;
} FfmpegDiracSchroQueue; } FfmpegDiracSchroQueue;
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment