diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-10-07 02:11:06 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-10-07 02:29:31 +0200 |
commit | b93cb8383fec0aa95b735fcd97eff03425e79bc1 (patch) | |
tree | cb6807ba58e1ae79160f88ffb8662650c8458f23 /libavcodec/utils.c | |
parent | 5ec55d216ef05ceb877a158c7d65e072df8b71f9 (diff) | |
download | ffmpeg-b93cb8383fec0aa95b735fcd97eff03425e79bc1.tar.gz |
lavc: add ff_init_buffer_info()
Fixes seeking per fileposition in ffplay.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r-- | libavcodec/utils.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 8af4c338fd..f28b024c25 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -238,6 +238,22 @@ void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height){ *width=FFALIGN(*width, align); } +void ff_init_buffer_info(AVCodecContext *s, AVFrame *pic) +{ + if (s->pkt) { + pic->pkt_pts = s->pkt->pts; + pic->pkt_pos = s->pkt->pos; + } else { + pic->pkt_pts = AV_NOPTS_VALUE; + pic->pkt_pos = -1; + } + pic->reordered_opaque= s->reordered_opaque; + pic->sample_aspect_ratio = s->sample_aspect_ratio; + pic->width = s->width; + pic->height = s->height; + pic->format = s->pix_fmt; +} + int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic){ int i; int w= s->width; @@ -1357,6 +1373,9 @@ unsigned int ff_toupper4(unsigned int x) int ff_thread_get_buffer(AVCodecContext *avctx, AVFrame *f) { f->owner = avctx; + + ff_init_buffer_info(avctx, f); + return avctx->get_buffer(avctx, f); } |