summaryrefslogtreecommitdiff
path: root/src/decoder.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/decoder.cc')
-rw-r--r--src/decoder.cc24
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);
}