Revision 7feb950a

View differences:

libav/utils.c
751 751
{
752 752
    AVStream *st;
753 753
    INT64 pts_mask;
754
    int ret;
754
    int ret, frame_size;
755 755

  
756 756
    st = s->streams[stream_index];
757 757
    pts_mask = (1LL << s->pts_wrap_bits) - 1;
......
763 763
    /* update pts */
764 764
    switch (st->codec.codec_type) {
765 765
    case CODEC_TYPE_AUDIO:
766
        if (st->codec.frame_size <= 1) {
767
            frame_size = size / st->codec.channels;
768
            /* specific hack for pcm codecs because no frame size is provided */
769
            switch(st->codec.codec->id) {
770
            case CODEC_ID_PCM_S16LE:
771
            case CODEC_ID_PCM_S16BE:
772
            case CODEC_ID_PCM_U16LE:
773
            case CODEC_ID_PCM_U16BE:
774
                frame_size >>= 1;
775
                break;
776
            default:
777
                break;
778
            }
779
        } else {
780
            frame_size = st->codec.frame_size;
781
        }
766 782
        av_frac_add(&st->pts, 
767
                    (INT64)s->pts_den * st->codec.frame_size);
783
                    (INT64)s->pts_den * frame_size);
768 784
        break;
769 785
    case CODEC_TYPE_VIDEO:
770 786
        av_frac_add(&st->pts, 

Also available in: Unified diff