From 680c8e9c15d1e5b71278f22e0d5dd1a5d2297b75 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 4 May 2013 15:13:18 +0200 Subject: [PATCH] generic-pc/audio: initialize curr_pts Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/7cff17cb959a6246dfd0596912d6d1b5be994470 Author: Stefan Seyfried Date: 2013-05-04 (Sat, 04 May 2013) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- generic-pc/audio.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/generic-pc/audio.cpp b/generic-pc/audio.cpp index c68fbd1..bb814e7 100644 --- a/generic-pc/audio.cpp +++ b/generic-pc/audio.cpp @@ -52,6 +52,7 @@ cAudio::cAudio(void *, void *, void *) thread_started = false; dmxbuf = (uint8_t *)malloc(DMX_BUF_SZ); bufpos = 0; + curr_pts = 0; gThiz = this; ao_initialize(); } @@ -233,6 +234,8 @@ void cAudio::run() ao_info *ai; ao_device *adevice; ao_sample_format sformat; + + curr_pts = 0; av_init_packet(&avpkt); inp = av_find_input_format("mpegts"); AVIOContext *pIOCtx = avio_alloc_context(inbuf, INBUF_SIZE, // internal Buffer and its size @@ -300,9 +303,8 @@ void cAudio::run() break; avcodec_decode_audio4(c, frame, &gotframe, &avpkt); if (gotframe && thread_started) { - int64_t pts = av_frame_get_best_effort_timestamp(frame); - lt_debug("%s: pts 0x%" PRIx64 " %" PRId64 " %3f\n", __func__, pts, pts, pts/90000.0); - curr_pts = pts; + curr_pts = av_frame_get_best_effort_timestamp(frame); + lt_debug("%s: pts 0x%" PRIx64 " %3f\n", __func__, curr_pts, curr_pts/90000.0); ao_play(adevice, (char*)frame->extended_data[0], frame->linesize[0]); } av_free_packet(&avpkt);