Subversion Repositories Kolibri OS

Rev

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

Rev 2349 Rev 2415
Line 8... Line 8...
8
#include 
8
#include 
9
#include 
9
#include 
10
#include 
10
#include 
11
#include 
11
#include 
-
 
12
#include 
Line 12... Line 13...
12
 
13
 
13
#include "sound.h"
14
#include "sound.h"
Line 14... Line 15...
14
#include "fplay.h"
15
#include "fplay.h"
Line 49... Line 50...
49
 
50
 
Line 50... Line 51...
50
    movie_file = argv[1];
51
    movie_file = argv[1];
51
    /* register all codecs, demux and protocols */
52
    /* register all codecs, demux and protocols */
Line -... Line 53...
-
 
53
 
-
 
54
//    av_log_set_level(AV_LOG_INFO);
52
 
55
 
53
    avcodec_register_all();
56
    avcodec_register_all();
54
    avdevice_register_all();
57
    avdevice_register_all();
Line 55... Line 58...
55
    av_register_all();
58
    av_register_all();
56
 
59
 
57
    if( avformat_open_input(&pFormatCtx, argv[1], NULL, NULL) < 0)
60
    if( avformat_open_input(&pFormatCtx, argv[1], NULL, NULL) < 0)
58
    {
61
    {
59
        printf("Cannot open file %s\n\r", argv[1]);
62
        printf("Cannot open file %s\n\r", argv[1]);
Line 60... Line 63...
60
        return -1; // Couldn't open file
63
        return -1; // Couldn't open file
Line 61... Line 64...
61
    };
64
    };
62
 
65
 
63
    printf("%s\n\r", __FUNCTION__);
66
//    printf("%s\n\r", __FUNCTION__);
64
 
67
 
Line 205... Line 208...
205
        int err;
208
        int err;
206
 
209
 
Line 207... Line 210...
207
//        __asm__ __volatile__("int3");
210
//        __asm__ __volatile__("int3");
Line 208... Line 211...
208
 
211
 
209
        if(q_video.size+q_audio.size < 16*1024*1024)
212
        if(q_video.size+q_audio.size < 12*1024*1024)
210
        {
213
        {
211
            err = av_read_frame(pFormatCtx, &packet);
214
            err = av_read_frame(pFormatCtx, &packet);
212
            if( err < 0)
215
            if( err < 0)
213
            {
216
            {
Line 239... Line 242...
239
    };
242
    };
240
 
243
 
Line 241... Line 244...
241
    ret = 1;
244
    ret = 1;
Line 242... Line 245...
242
 
245
 
243
    while(status != 0 && ret)
246
    while( (status != 0) && ret)
244
    {
247
    {
245
        ret =  decode_video(pCodecCtx, &q_video);
248
        ret =  decode_video(pCodecCtx, &q_video);
246
        ret |= decode_audio(aCodecCtx, &q_audio);
249
        ret |= decode_audio(aCodecCtx, &q_audio);
247
        delay(1);
250
        delay(1);
248
    };
251
    };
249
    delay(50);
252
    delay(50);
250
    status = 0;
253
    status = 0;
251
    printf("status = 0\n");
254
    printf("status = 0\n");
252
    delay(200);
255
    delay(300);