OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2004 Roman Shaposhnik | 2 * Copyright (c) 2004 Roman Shaposhnik |
3 * Copyright (c) 2008 Alexander Strange (astrange@ithinksw.com) | 3 * Copyright (c) 2008 Alexander Strange (astrange@ithinksw.com) |
4 * | 4 * |
5 * Many thanks to Steven M. Schultz for providing clever ideas and | 5 * Many thanks to Steven M. Schultz for providing clever ideas and |
6 * to Michael Niedermayer <michaelni@gmx.at> for writing initial | 6 * to Michael Niedermayer <michaelni@gmx.at> for writing initial |
7 * implementation. | 7 * implementation. |
8 * | 8 * |
9 * This file is part of FFmpeg. | 9 * This file is part of FFmpeg. |
10 * | 10 * |
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
603 { | 603 { |
604 FrameThreadContext *fctx = avctx->thread_opaque; | 604 FrameThreadContext *fctx = avctx->thread_opaque; |
605 int finished = fctx->next_finished; | 605 int finished = fctx->next_finished; |
606 PerThreadContext *p; | 606 PerThreadContext *p; |
607 int err; | 607 int err; |
608 | 608 |
609 /* | 609 /* |
610 * Submit a packet to the next decoding thread. | 610 * Submit a packet to the next decoding thread. |
611 */ | 611 */ |
612 | 612 |
613 if (fctx->next_decoding >= avctx->thread_count) return err; | |
DaleCurtis
2012/02/09 22:43:26
Proper fix is likely related to acolwell's threadi
rbultje1
2012/02/09 23:28:46
This looks really evil, I'm OK with the workaround
DaleCurtis
2012/02/10 00:04:01
I've commented on valgrind.txt to link each test f
| |
613 p = &fctx->threads[fctx->next_decoding]; | 614 p = &fctx->threads[fctx->next_decoding]; |
614 err = update_context_from_user(p->avctx, avctx); | 615 err = update_context_from_user(p->avctx, avctx); |
615 if (err) return err; | 616 if (err) return err; |
616 err = submit_packet(p, avpkt); | 617 err = submit_packet(p, avpkt); |
617 if (err) return err; | 618 if (err) return err; |
618 | 619 |
619 /* | 620 /* |
620 * If we're still receiving the initial packets, don't return a frame. | 621 * If we're still receiving the initial packets, don't return a frame. |
621 */ | 622 */ |
622 | 623 |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1062 return 0; | 1063 return 0; |
1063 } | 1064 } |
1064 | 1065 |
1065 void ff_thread_free(AVCodecContext *avctx) | 1066 void ff_thread_free(AVCodecContext *avctx) |
1066 { | 1067 { |
1067 if (avctx->active_thread_type&FF_THREAD_FRAME) | 1068 if (avctx->active_thread_type&FF_THREAD_FRAME) |
1068 frame_thread_free(avctx, avctx->thread_count); | 1069 frame_thread_free(avctx, avctx->thread_count); |
1069 else | 1070 else |
1070 thread_free(avctx); | 1071 thread_free(avctx); |
1071 } | 1072 } |
OLD | NEW |