From bc8e0b9a110b43a2e573f2977a76f7faccd0fbfc Mon Sep 17 00:00:00 2001 From: deva Date: Fri, 25 Mar 2005 16:44:02 +0000 Subject: No good.. diabled audio again! --- src/decoder.cc | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/decoder.cc b/src/decoder.cc index b9f634a..3c5a4e8 100644 --- a/src/decoder.cc +++ b/src/decoder.cc @@ -106,7 +106,7 @@ void Decoder::decode() // 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) { + while(pkt.stream_index == 0 && len > 0) { int ret; int got_picture; // buf_t *buf = buf_alloc(); @@ -117,8 +117,9 @@ void Decoder::decode() memcpy(dvf->frame, ptr, len); // fprintf(stderr, "DVBufferSize: [%d]bytes\n", len); + ret = avcodec_decode_video(&fc->streams[0]->codec, - fff->frame, &got_picture, ptr, len); + fff->frame, &got_picture, ptr, len); if(ret < 0) { fprintf(stderr, "Error while decoding stream\n"); @@ -130,18 +131,16 @@ void Decoder::decode() pthread_mutex_lock(mutex); encode_queue->push(dvf); - if(pkt.stream_index == 0) player_queue->push(fff); + player_queue->push(fff); pthread_mutex_unlock(mutex); sem_post(encode_sem); - 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); - } + 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 -- cgit v1.2.3