diff options
author | Janne Grunau <janne-libav@jannau.net> | 2011-11-24 01:50:05 +0100 |
---|---|---|
committer | Janne Grunau <janne-libav@jannau.net> | 2011-11-25 08:25:12 +0100 |
commit | 117e2a30f254820e0fd4e4d5d9fbab757f17590f (patch) | |
tree | 1b57b621ffd909413c66064c625d9aa08ebbac28 /libavcodec/pthread.c | |
parent | d14d4d982cca55b34092fb71204b9a3f3749acd7 (diff) | |
download | ffmpeg-streaming-117e2a30f254820e0fd4e4d5d9fbab757f17590f.zip ffmpeg-streaming-117e2a30f254820e0fd4e4d5d9fbab757f17590f.tar.gz |
frame-mt: return consumed packet size in ff_thread_decode_frame
This is required to fulfill avcodec_decode_video2() promise to return
the number of consumed bytes on success.
Diffstat (limited to 'libavcodec/pthread.c')
-rw-r--r-- | libavcodec/pthread.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c index 9c3453f..3364376 100644 --- a/libavcodec/pthread.c +++ b/libavcodec/pthread.c @@ -522,7 +522,7 @@ int ff_thread_decode_frame(AVCodecContext *avctx, if (fctx->next_decoding >= (avctx->thread_count-1)) fctx->delaying = 0; *got_picture_ptr=0; - return 0; + return avpkt->size; } /* @@ -563,7 +563,8 @@ int ff_thread_decode_frame(AVCodecContext *avctx, fctx->next_finished = finished; - return p->result; + /* return the size of the consumed packet if no error occurred */ + return (p->result >= 0) ? avpkt->size : p->result; } void ff_thread_report_progress(AVFrame *f, int n, int field) |