Subversion Repositories Kolibri OS

Rev

Rev 5592 | Rev 6106 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5592 Rev 5603
Line 48... Line 48...
48
int64_t  rewind_pos;
48
int64_t  rewind_pos;
49
 
49
 
Line 50... Line 50...
50
int64_t stream_duration;
50
int64_t stream_duration;
Line -... Line 51...
-
 
51
 
-
 
52
int threads_running = DECODER_THREAD;
-
 
53
mutex_t driver_lock;
51
 
54
 
Line 52... Line 55...
52
extern double audio_base;
55
extern double audio_base;
53
 
56
 
54
double get_audio_base()
57
double get_audio_base()
Line 167... Line 170...
167
    };
170
    };
168
 
171
 
Line 169... Line 172...
169
//    printf("ctx->pix_fmt %d\n", pCodecCtx->pix_fmt);
172
//    printf("ctx->pix_fmt %d\n", pCodecCtx->pix_fmt);
Line -... Line 173...
-
 
173
 
-
 
174
    mutex_init(&driver_lock);
-
 
175
    mutex_init(&q_video.lock);
Line 170... Line 176...
170
 
176
    mutex_init(&q_audio.lock);
171
 
177
 
172
    if (aCodecCtx->channels > 0)
178
    if (aCodecCtx->channels > 0)
173
            aCodecCtx->request_channels = FFMIN(2, aCodecCtx->channels);
179
            aCodecCtx->request_channels = FFMIN(2, aCodecCtx->channels);
Line 201... Line 207...
201
            {
207
            {
202
                decoder_buffer = (uint8_t*)av_mallocz(192000*2+64);
208
                decoder_buffer = (uint8_t*)av_mallocz(192000*2+64);
203
                if( decoder_buffer != NULL )
209
                if( decoder_buffer != NULL )
204
                {
210
                {
205
                    astream.lock   = 0;
211
                    mutex_init(&astream.lock);
206
                    astream.count  = 0;
212
                    astream.count  = 0;
207
                    astream.buffer = (char *)av_mallocz(192000*3);
213
                    astream.buffer = (char *)av_mallocz(192000*3);
208
                    if( astream.buffer != NULL )
214
                    if( astream.buffer != NULL )
209
                        have_sound = 1;
215
                        have_sound = 1;
210
                    else
216
                    else
211
                        av_free(decoder_buffer);
217
                        av_free(decoder_buffer);
Line 222... Line 228...
222
 
228
 
Line 223... Line 229...
223
    if( !init_video(pCodecCtx))
229
    if( !init_video(pCodecCtx))
224
        return 0;
230
        return 0;
Line 225... Line -...
225
 
-
 
226
//    __asm__ __volatile__("int3");
-
 
227
 
231
 
Line 228... Line 232...
228
    decoder();
232
    decoder();
229
 
233
 
Line 230... Line 234...
230
  // Free the YUV frame
234
  // Free the YUV frame
Line 231... Line 235...
231
    av_free(pFrame);
235
    av_free(pFrame);
-
 
236
 
232
 
237
 
Line 233... Line 238...
233
 
238
//__asm__ __volatile__("int3");
234
//__asm__ __volatile__("int3");
239
 
Line 235... Line 240...
235
 
240
    while( threads_running &
-
 
241
           (AUDIO_THREAD | VIDEO_THREAD))
-
 
242
           delay(1);
Line 236... Line 243...
236
  // Close the codec
243
 
237
 // avcodec_close(pCodecCtx);
244
    if(astream.lock.handle)
Line 429... Line 436...
429
                break;
436
                break;
430
        }
437
        }
431
    };
438
    };
432
 
439
 
Line 433... Line -...
433
    ret = 1;
-
 
434
 
-
 
435
    while( (player_state != CLOSED) && ret)
-
 
436
    {
-
 
437
        ret =  decode_video(pCodecCtx, &q_video);
-
 
438
        ret |= decode_audio(aCodecCtx, &q_audio);
-
 
439
        delay(1);
-
 
440
    };
-
 
441
    delay(50);
-
 
442
    player_state = CLOSED;
-
 
443
    delay(300);
-
 
444
};
440
};