]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/amr.c
Merge remote-tracking branch 'newdev/master'
[ffmpeg] / libavformat / amr.c
index f2fecf3ee1869ba51f1993f7c3ab22edf61ec8bd..66763f3fa788fa8a80c00705977e06181963f9ae 100644 (file)
@@ -2,20 +2,20 @@
  * amr file format
  * Copyright (c) 2001 ffmpeg project
  *
- * This file is part of Libav.
+ * This file is part of FFmpeg.
  *
- * Libav is free software; you can redistribute it and/or
+ * FFmpeg is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
- * Libav is distributed in the hope that it will be useful,
+ * FFmpeg is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
+ * License along with FFmpeg; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
@@ -121,8 +121,9 @@ static int amr_read_packet(AVFormatContext *s,
 {
     AVCodecContext *enc = s->streams[0]->codec;
     int read, size = 0, toc, mode;
+    int64_t pos = avio_tell(s->pb);
 
-    if (s->pb->eof_reached)
+    if (url_feof(s->pb))
     {
         return AVERROR(EIO);
     }
@@ -157,7 +158,7 @@ static int amr_read_packet(AVFormatContext *s,
     s->streams[0]->codec->bit_rate = size*8*50;
 
     pkt->stream_index = 0;
-    pkt->pos= avio_tell(s->pb);
+    pkt->pos = pos;
     pkt->data[0]=toc;
     pkt->duration= enc->codec_id == CODEC_ID_AMR_NB ? 160 : 320;
     read = avio_read(s->pb, pkt->data+1, size-1);
@@ -180,6 +181,7 @@ AVInputFormat ff_amr_demuxer = {
     amr_read_header,
     amr_read_packet,
     NULL,
+    .flags = AVFMT_GENERIC_INDEX,
 };
 #endif