diff options
author | deva <deva> | 2005-03-25 15:04:59 +0000 |
---|---|---|
committer | deva <deva> | 2005-03-25 15:04:59 +0000 |
commit | 6470f69508c37b2e0a293ee672942769f4e846fb (patch) | |
tree | a65996c1534e511f7c48043be2f939b86ad1b8e9 /src/decoder.cc | |
parent | 687c9d10046194dd25f36fc9610b8f6544748d88 (diff) |
*** empty log message ***
Diffstat (limited to 'src/decoder.cc')
-rw-r--r-- | src/decoder.cc | 24 |
1 files changed, 14 insertions, 10 deletions
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); } |