diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/libreal/audio_decoder.c | 14 | ||||
-rw-r--r-- | src/libreal/xine_decoder.c | 16 |
2 files changed, 23 insertions, 7 deletions
diff --git a/src/libreal/audio_decoder.c b/src/libreal/audio_decoder.c index 8bf3afaaa..75c822ea8 100644 --- a/src/libreal/audio_decoder.c +++ b/src/libreal/audio_decoder.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: audio_decoder.c,v 1.5 2002/11/26 00:37:29 guenter Exp $ + * $Id: audio_decoder.c,v 1.6 2002/12/07 00:27:18 guenter Exp $ * * thin layer to use real binary-only codecs in xine * @@ -81,6 +81,8 @@ typedef struct realdec_decoder_s { int sample_size; + uint64_t pts; + } realdec_decoder_t; typedef struct { @@ -416,6 +418,9 @@ static void realdec_decode_data (video_decoder_t *this_gen, buf_element_t *buf) printf ("libareal: content buffer detected, %d bytes\n", buf->size); #endif + if (buf->pts) + this->pts = buf->pts; + size = buf->size; while (size) { @@ -542,7 +547,12 @@ static void realdec_decode_data (video_decoder_t *this_gen, buf_element_t *buf) printf ("libareal: raDecode result %d, len=%d\n", result, len); #endif - audio_buffer->vpts = 0; /* FIXME */ + audio_buffer->vpts = this->pts*90; /* FIXME */ + + printf ("libareal: pts = %lld\n", audio_buffer->vpts); + + this->pts = 0; + audio_buffer->num_frames = len/this->sample_size;; this->stream->audio_out->put_buffer (this->stream->audio_out, diff --git a/src/libreal/xine_decoder.c b/src/libreal/xine_decoder.c index 9db45e6e0..760003b1e 100644 --- a/src/libreal/xine_decoder.c +++ b/src/libreal/xine_decoder.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine_decoder.c,v 1.11 2002/12/06 23:40:26 guenter Exp $ + * $Id: xine_decoder.c,v 1.12 2002/12/07 00:27:18 guenter Exp $ * * thin layer to use real binary-only codecs in xine * @@ -250,8 +250,8 @@ static void realdec_decode_data (video_decoder_t *this_gen, buf_element_t *buf) realdec_decoder_t *this = (realdec_decoder_t *) this_gen; #ifdef LOG - printf ("libreal: decode_data, flags=0x%08x, len=%d ...\n", - buf->decoder_flags, buf->size); + printf ("libreal: decode_data, flags=0x%08x, len=%d, pts=%lld ...\n", + buf->decoder_flags, buf->size, buf->pts); #endif if (buf->decoder_flags & BUF_FLAG_PREVIEW) { @@ -292,21 +292,27 @@ static void realdec_decode_data (video_decoder_t *this_gen, buf_element_t *buf) XINE_IMGFMT_YV12, VO_BOTH_FIELDS); - if (this->pts != this->last_pts) { + if ( this->last_pts && (this->pts != this->last_pts)) { int64_t new_duration; img->pts = this->pts * 90; new_duration = (this->pts - this->last_pts) * 90 / (this->num_frames+1); this->duration = (this->duration * 9 + new_duration)/10; this->num_frames = 0; - this->last_pts = this->pts; } else { img->pts = 0; this->num_frames++; } + + if (this->pts) + this->last_pts = this->pts; + img->duration = this->duration; img->bad_frame = 0; + printf ("libreal: img->pts=%lld img->duration=%d\n", + img->pts, img->duration); + #ifdef LOG printf ("libreal: pts %lld %lld diff %lld # %d est. duration %lld\n", this->pts*90, |