summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/demuxers/demux_ts.c17
-rw-r--r--src/video_out/video_out_opengl.c15
2 files changed, 18 insertions, 14 deletions
diff --git a/src/demuxers/demux_ts.c b/src/demuxers/demux_ts.c
index 1a19340f3..1a016fea9 100644
--- a/src/demuxers/demux_ts.c
+++ b/src/demuxers/demux_ts.c
@@ -987,6 +987,7 @@ static void demux_ts_buffer_pes(demux_ts_t*this, unsigned char *ts,
m->buf->decoder_flags |= BUF_FLAG_FRAME_END;
}
m->buf->pts = m->pts;
+ m->pts = 0;
m->buf->decoder_info[0] = 1;
if( this->input->get_length (this->input) )
@@ -995,12 +996,12 @@ static void demux_ts_buffer_pes(demux_ts_t*this, unsigned char *ts,
if (this->rate)
m->buf->extra_info->input_time = (int)((int64_t)this->input->get_current_pos (this->input)
* 1000 / (this->rate * 50));
+#ifdef TS_LOG
+ printf ("demux_ts: produced buffer, pts=%lld\n", m->buf->pts);
+#endif
m->fifo->put(m->fifo, m->buf);
m->buffered_bytes = 0;
m->buf = NULL; /* forget about buf -- not our responsibility anymore */
-#ifdef TS_LOG
- printf ("demux_ts: produced buffer, pts=%lld\n", m->pts);
-#endif
}
/* allocate the buffer here, as pes_header needs a valid buf for dvbsubs */
m->buf = m->fifo->buffer_pool_alloc(m->fifo);
@@ -1033,6 +1034,7 @@ static void demux_ts_buffer_pes(demux_ts_t*this, unsigned char *ts,
m->buf->size = m->buffered_bytes;
m->buf->type = m->type;
m->buf->pts = m->pts;
+ m->pts = 0;
m->buf->decoder_info[0] = 1;
if( this->input->get_length (this->input) )
m->buf->extra_info->input_normpos = (int)( (double) this->input->get_current_pos (this->input) *
@@ -1040,15 +1042,12 @@ static void demux_ts_buffer_pes(demux_ts_t*this, unsigned char *ts,
if (this->rate)
m->buf->extra_info->input_time = (int)((int64_t)this->input->get_current_pos (this->input)
* 1000 / (this->rate * 50));
-
+#ifdef TS_LOG
+ printf ("demux_ts: produced buffer, pts=%lld\n", m->buf->pts);
+#endif
m->fifo->put(m->fifo, m->buf);
m->buffered_bytes = 0;
m->buf = m->fifo->buffer_pool_alloc(m->fifo);
-
-#ifdef TS_LOG
- printf ("demux_ts: produced buffer, pts=%lld\n", m->pts);
-#endif
-
}
memcpy(m->buf->mem + m->buffered_bytes, ts, len);
m->buffered_bytes += len;
diff --git a/src/video_out/video_out_opengl.c b/src/video_out/video_out_opengl.c
index 1904fe6af..648cd38c5 100644
--- a/src/video_out/video_out_opengl.c
+++ b/src/video_out/video_out_opengl.c
@@ -606,7 +606,7 @@ static int render_image_fp_yuv (opengl_driver_t *this, opengl_frame_t *frame) {
return 0;
}
- ret = render_help_image_tex (this, frame->width+3, frame->height + h2 + 3,
+ ret = render_help_image_tex (this, w2 + frame->vo_frame.pitches[2] + 3, frame->height + h2 + 3,
GL_LUMINANCE, GL_LUMINANCE);
if (! ret)
return 0;
@@ -628,16 +628,21 @@ static int render_image_fp_yuv (opengl_driver_t *this, opengl_frame_t *frame) {
this->glProgramEnvParameter4fARB (MYGL_FRAGMENT_PROGRAM_ARB, 0,
1.0 /this->tex_width,
(float)(frame->height+2)/this->tex_height,
- (float)(w2+1) /this->tex_width,
+ (float)(w2+2) /this->tex_width,
0);
}
+ if (w2 & 7)
+ for (i = 0; i < h2; i++) {
+ frame->vo_frame.base[1][i*frame->vo_frame.pitches[1]+w2] = 128;
+ frame->vo_frame.base[2][i*frame->vo_frame.pitches[2]+w2] = 128;
+ }
/* Load texture */
CHECKERR ("pre-texsubimage");
- glTexSubImage2D (GL_TEXTURE_2D, 0, 1, 0, frame->width, frame->height,
+ glTexSubImage2D (GL_TEXTURE_2D, 0, 1, 0, frame->vo_frame.pitches[0], frame->height,
GL_LUMINANCE, GL_UNSIGNED_BYTE, frame->vo_frame.base[0]);
- glTexSubImage2D (GL_TEXTURE_2D, 0, 1, frame->height+2, w2, h2,
+ glTexSubImage2D (GL_TEXTURE_2D, 0, 1, frame->height+2, frame->vo_frame.pitches[1], h2,
GL_LUMINANCE, GL_UNSIGNED_BYTE, frame->vo_frame.base[1]);
- glTexSubImage2D (GL_TEXTURE_2D, 0, w2+2, frame->height+2, w2, h2,
+ glTexSubImage2D (GL_TEXTURE_2D, 0, w2+2, frame->height+2, frame->vo_frame.pitches[2], h2,
GL_LUMINANCE, GL_UNSIGNED_BYTE, frame->vo_frame.base[2]);
CHECKERR ("texsubimage");
return 1;