Changeset e110b99aac4bc342fb927d9c83197f59a4f867f1
- Timestamp:
- 20/05/08 15:16:27
(7 months ago)
- Author:
- Rafaël Carré <funman@videolan.org>
- git-committer:
- Rafaël Carré <funman@videolan.org> 1211289387 +0200
- git-parent:
[a5ff1f926dc6ae6bf2db641b2025a4b5ffdecdf5]
- git-author:
- Rafaël Carré <funman@videolan.org> 1211288716 +0200
- Message:
Use reference counting for pictures
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rcf9c7df |
re110b99 |
|
| 253 | 253 | { |
|---|
| 254 | 254 | block_t *p_block; |
|---|
| 255 | | void (*pf_release)( picture_t * ); |
|---|
| 256 | 255 | |
|---|
| 257 | 256 | /* Check if we can reuse the current encoder */ |
|---|
| … | … | |
| 564 | 563 | static void video_release_buffer( picture_t *p_pic ) |
|---|
| 565 | 564 | { |
|---|
| 566 | | if( p_pic ) |
|---|
| 567 | | { |
|---|
| 568 | | free( p_pic->p_data_orig ); |
|---|
| 569 | | free( p_pic->p_sys ); |
|---|
| 570 | | free( p_pic ); |
|---|
| 571 | | } |
|---|
| | 565 | if( --p_pic->i_refcount > 0 ) return; |
|---|
| | 566 | |
|---|
| | 567 | free( p_pic->p_data_orig ); |
|---|
| | 568 | free( p_pic->p_sys ); |
|---|
| | 569 | free( p_pic ); |
|---|
| 572 | 570 | } |
|---|
| 573 | 571 | |
|---|
| … | … | |
| 589 | 587 | } |
|---|
| 590 | 588 | |
|---|
| | 589 | p_pic->i_refcount = 1; |
|---|
| 591 | 590 | p_pic->pf_release = video_release_buffer; |
|---|
| 592 | 591 | p_pic->i_status = RESERVED_PICTURE; |
|---|
| … | … | |
| 599 | 598 | { |
|---|
| 600 | 599 | (void)p_dec; |
|---|
| 601 | | if( p_pic ) |
|---|
| 602 | | { |
|---|
| 603 | | free( p_pic->p_data_orig ); |
|---|
| 604 | | free( p_pic->p_sys ); |
|---|
| 605 | | free( p_pic ); |
|---|
| 606 | | } |
|---|
| | 600 | free( p_pic->p_data_orig ); |
|---|
| | 601 | free( p_pic->p_sys ); |
|---|
| | 602 | free( p_pic ); |
|---|
| 607 | 603 | } |
|---|
| 608 | 604 | |
|---|
| 609 | 605 | static void video_link_picture( decoder_t *p_dec, picture_t *p_pic ) |
|---|
| 610 | 606 | { |
|---|
| | 607 | (void)p_dec; |
|---|
| | 608 | p_pic->i_refcount++; |
|---|
| | 609 | } |
|---|
| | 610 | |
|---|
| | 611 | static void video_unlink_picture( decoder_t *p_dec, picture_t *p_pic ) |
|---|
| | 612 | { |
|---|
| 611 | 613 | (void)p_dec; (void)p_pic; |
|---|
| 612 | | } |
|---|
| 613 | | |
|---|
| 614 | | static void video_unlink_picture( decoder_t *p_dec, picture_t *p_pic ) |
|---|
| 615 | | { |
|---|
| 616 | | (void)p_dec; (void)p_pic; |
|---|
| | 614 | video_release_buffer( p_pic ); |
|---|
| 617 | 615 | } |
|---|
| 618 | 616 | |
|---|