diff options
author | deva <deva> | 2005-03-25 16:44:02 +0000 |
---|---|---|
committer | deva <deva> | 2005-03-25 16:44:02 +0000 |
commit | bc8e0b9a110b43a2e573f2977a76f7faccd0fbfc (patch) | |
tree | 8e5ab7f4f9d0480f5cf33904eaa9fc8becb8e955 | |
parent | 6470f69508c37b2e0a293ee672942769f4e846fb (diff) |
No good.. diabled audio again!
-rw-r--r-- | src/decoder.cc | 19 |
1 files 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 |