Revision 79ee4683 ffplay.c

View differences:

ffplay.c
49 49

  
50 50
//#define DEBUG_SYNC
51 51

  
52
#define MAX_VIDEOQ_SIZE (30 * 256 * 1024)
53
#define MAX_AUDIOQ_SIZE (20 * 16 * 1024)
54
#define MAX_SUBTITLEQ_SIZE (5 * 16 * 1024)
52
#define MAX_QUEUE_SIZE (15 * 1024 * 1024)
53
#define MIN_AUDIOQ_SIZE (20 * 16 * 1024)
54
#define MIN_FRAMES 5
55 55

  
56 56
/* SDL audio buffer size, in samples. Should be small to have precise
57 57
   A/V sync as SDL does not have hardware buffer fullness info. */
......
2026 2026
        }
2027 2027

  
2028 2028
        /* if the queue are full, no need to read more */
2029
        if (is->audioq.size > MAX_AUDIOQ_SIZE ||
2030
            is->videoq.size > MAX_VIDEOQ_SIZE ||
2031
            is->subtitleq.size > MAX_SUBTITLEQ_SIZE) {
2029
        if (   is->audioq.size + is->videoq.size + is->subtitleq.size > MAX_QUEUE_SIZE
2030
            || (   (is->audioq   .size  > MIN_AUDIOQ_SIZE || is->audio_stream<0)
2031
                && (is->videoq   .nb_packets > MIN_FRAMES || is->video_stream<0)
2032
                && (is->subtitleq.nb_packets > MIN_FRAMES || is->subtitle_stream<0))) {
2032 2033
            /* wait 10 ms */
2033 2034
            SDL_Delay(10);
2034 2035
            continue;

Also available in: Unified diff