Revision 2a758efe

View differences:

libavformat/mp3.c
83 83
static int mp3_parse_vbr_tags(AVFormatContext *s, AVStream *st, int64_t base)
84 84
{
85 85
    uint32_t v, spf;
86
    int frames = -1; /* Total number of frames in file */
86
    unsigned frames = 0; /* Total number of frames in file */
87 87
    unsigned size = 0; /* Total number of bytes in the stream */
88 88
    const int64_t xing_offtbl[2][2] = {{32, 17}, {17,9}};
89 89
    MPADecodeHeader c;
......
122 122
        }
123 123
    }
124 124

  
125
    if(frames < 0 && !size)
125
    if(!frames && !size)
126 126
        return -1;
127 127

  
128 128
    /* Skip the vbr tag frame */
129 129
    url_fseek(s->pb, base + vbrtag_size, SEEK_SET);
130 130

  
131 131
    spf = c.lsf ? 576 : 1152; /* Samples per frame, layer 3 */
132
    if(frames >= 0)
132
    if(frames)
133 133
        st->duration = av_rescale_q(frames, (AVRational){spf, c.sample_rate},
134 134
                                    st->time_base);
135 135
    if(size)

Also available in: Unified diff