From 6470f69508c37b2e0a293ee672942769f4e846fb Mon Sep 17 00:00:00 2001 From: deva Date: Fri, 25 Mar 2005 15:04:59 +0000 Subject: *** empty log message *** --- src/decoder.cc | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/decoder.cc b/src/decoder.cc index debff33..b9f634a 100644 --- a/src/decoder.cc +++ b/src/decoder.cc @@ -102,10 +102,11 @@ void Decoder::decode() av_read_packet(fc, &pkt); len = pkt.size; ptr = pkt.data; - /* NOTE: we only decode video, we only need the data from stream_index 0 */ - /* (stream 0: video, stream 1: audio) */ - while(pkt.stream_index == 0 && len > 0) { + // NOTE: we only decode video, we only need the data from stream_index 0 + // (stream 0: video, stream 1: audio) + // while(pkt.stream_index == 0 && len > 0) { + while(len > 0) { int ret; int got_picture; // buf_t *buf = buf_alloc(); @@ -129,18 +130,20 @@ void Decoder::decode() pthread_mutex_lock(mutex); encode_queue->push(dvf); - player_queue->push(fff); + if(pkt.stream_index == 0) player_queue->push(fff); pthread_mutex_unlock(mutex); sem_post(encode_sem); - user_event.type = SDL_USEREVENT; - user_event.user.code = 0; - user_event.user.data1 = NULL; - user_event.user.data2 = NULL; - SDL_PushEvent(&user_event); + if(pkt.stream_index == 0) { + user_event.type = SDL_USEREVENT; + user_event.user.code = 0; + user_event.user.data1 = NULL; + user_event.user.data2 = NULL; + SDL_PushEvent(&user_event); + } } - + /* // For later use, when audio must be implemented while(pkt.stream_index == 1 && len > 0) { DVFrame *dvf = new DVFrame(); @@ -157,6 +160,7 @@ void Decoder::decode() sem_post(encode_sem); } + */ av_free_packet(&pkt); } -- cgit v1.2.3