Browse Source

Add a parameter for queue size.

Patch by Anuradha Suraparaju anuradha rd bbc co uk

Originally committed as revision 14150 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.5
Anuradha Suraparaju Benoit Fouet 17 years ago
parent
commit
0cf0e25d22
2 changed files with 5 additions and 0 deletions
  1. +3
    -0
      libavcodec/libdirac_libschro.c
  2. +2
    -0
      libavcodec/libdirac_libschro.h

+ 3
- 0
libavcodec/libdirac_libschro.c View File

@@ -70,6 +70,7 @@ unsigned int ff_dirac_schro_get_video_format_idx (AVCodecContext *avccontext)
void ff_dirac_schro_queue_init (FfmpegDiracSchroQueue *queue)
{
queue->p_head = queue->p_tail = NULL;
queue->size = 0;
}

void ff_dirac_schro_queue_free (FfmpegDiracSchroQueue *queue,
@@ -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 = p_new;

++queue->size;
return 0;
}

@@ -106,6 +108,7 @@ void *ff_dirac_schro_queue_pop (FfmpegDiracSchroQueue *queue)
if (top != NULL) {
void *data = top->data;
queue->p_head = queue->p_head->next;
--queue->size;
av_freep (&top);
return data;
}


+ 2
- 0
libavcodec/libdirac_libschro.h View File

@@ -80,6 +80,8 @@ typedef struct FfmpegDiracSchroQueue
FfmpegDiracSchroQueueElement *p_head;
/** Pointer to tail of queue */
FfmpegDiracSchroQueueElement *p_tail;
/** Queue size*/
int size;
} FfmpegDiracSchroQueue;

/**


Loading…
Cancel
Save