| .. | .. |
|---|
| 76 | 76 | } |
|---|
| 77 | 77 | } |
|---|
| 78 | 78 | |
|---|
| 79 | +int ebc_drop_one_dsp_buf(void) |
|---|
| 80 | +{ |
|---|
| 81 | + struct ebc_buf_s *temp_buf; |
|---|
| 82 | + int temp_pos; |
|---|
| 83 | + |
|---|
| 84 | + mutex_lock(&ebc_buf_info.dsp_buf_lock); |
|---|
| 85 | + if (ebc_buf_info.dsp_buf_list) { |
|---|
| 86 | + if (ebc_buf_info.dsp_buf_list->nb_elt > 0) { |
|---|
| 87 | + temp_pos = ebc_buf_info.dsp_buf_list->nb_elt - 1; |
|---|
| 88 | + temp_buf = (struct ebc_buf_s *)buf_list_get(ebc_buf_info.dsp_buf_list, temp_pos); |
|---|
| 89 | + if (temp_buf->needpic == 2) { |
|---|
| 90 | + buf_list_remove(ebc_buf_info.dsp_buf_list, temp_pos); |
|---|
| 91 | + ebc_buf_release(temp_buf); |
|---|
| 92 | + mutex_unlock(&ebc_buf_info.dsp_buf_lock); |
|---|
| 93 | + return BUF_SUCCESS; |
|---|
| 94 | + } |
|---|
| 95 | + } |
|---|
| 96 | + } |
|---|
| 97 | + mutex_unlock(&ebc_buf_info.dsp_buf_lock); |
|---|
| 98 | + |
|---|
| 99 | + return BUF_ERROR; |
|---|
| 100 | +} |
|---|
| 101 | + |
|---|
| 79 | 102 | int ebc_add_to_dsp_buf_list(struct ebc_buf_s *dsp_buf) |
|---|
| 80 | 103 | { |
|---|
| 81 | 104 | mutex_lock(&ebc_buf_info.dsp_buf_lock); |
|---|