summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPetri Hintukainen <phintuka@users.sourceforge.net>2013-01-17 14:43:44 +0200
committerPetri Hintukainen <phintuka@users.sourceforge.net>2013-01-17 14:43:44 +0200
commit62b24c4a35455b392b7f886f2a3e44261ed2d2a9 (patch)
treeb04fb036c7a5582dd48cadfe5535f62e7f1aebbe /src
parentd341968faf9cfa917fa4a39173085ce687f96f3d (diff)
downloadxine-lib-62b24c4a35455b392b7f886f2a3e44261ed2d2a9.tar.gz
xine-lib-62b24c4a35455b392b7f886f2a3e44261ed2d2a9.tar.bz2
ff_video_decoder: delay calling set_stream_info() instead of calling it from get_buffer()
(merged from https://github.com/huceke/xine-lib-vaapi)
Diffstat (limited to 'src')
-rw-r--r--src/combined/ffmpeg/ff_video_decoder.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/combined/ffmpeg/ff_video_decoder.c b/src/combined/ffmpeg/ff_video_decoder.c
index 7d87a6b7b..e231b4b2c 100644
--- a/src/combined/ffmpeg/ff_video_decoder.c
+++ b/src/combined/ffmpeg/ff_video_decoder.c
@@ -138,6 +138,8 @@ struct ff_video_decoder_s {
#ifdef LOG
enum PixelFormat debug_fmt;
#endif
+
+ uint8_t set_stream_info;
};
/* import color matrix names */
@@ -213,7 +215,7 @@ static int get_buffer(AVCodecContext *context, AVFrame *av_frame){
this->aspect_ratio = (double)width / (double)height;
this->aspect_ratio_prio = 1;
lprintf("default aspect ratio: %f\n", this->aspect_ratio);
- set_stream_info(this);
+ this->set_stream_info = 1;
}
}
@@ -1320,6 +1322,11 @@ static void ff_handle_mpeg12_buffer (ff_video_decoder_t *this, buf_element_t *bu
offset += len;
}
+ if( this->set_stream_info) {
+ set_stream_info(this);
+ this->set_stream_info = 0;
+ }
+
if (got_picture && this->av_frame->data[0]) {
/* got a picture, draw it */
if(!this->av_frame->opaque) {
@@ -1536,6 +1543,11 @@ static void ff_handle_buffer (ff_video_decoder_t *this, buf_element_t *buf) {
set_stream_info(this);
}
+ if( this->set_stream_info) {
+ set_stream_info(this);
+ this->set_stream_info = 0;
+ }
+
if (got_picture && this->av_frame->data[0]) {
/* got a picture, draw it */
got_one_picture = 1;
@@ -1899,6 +1911,7 @@ static video_decoder_t *ff_video_open_plugin (video_decoder_class_t *class_gen,
this->mpeg_parser = NULL;
this->dr1_frames = xine_list_new();
+ this->set_stream_info = 0;
#ifdef LOG
this->debug_fmt = -1;