rtmp: Add credit/copyright to librtmp authors for parts of the RTMPE code
[ffmpeg.git] / libavformat / xmv.c
index a6081af..6fa9a6a 100644 (file)
@@ -30,6 +30,7 @@
 #include "libavutil/intreadwrite.h"
 
 #include "avformat.h"
+#include "internal.h"
 #include "riff.h"
 
 #define XMV_MIN_HEADER_SIZE 36
@@ -125,8 +126,7 @@ static int xmv_probe(AVProbeData *p)
     return 0;
 }
 
-static int xmv_read_header(AVFormatContext *s,
-                           AVFormatParameters *ap)
+static int xmv_read_header(AVFormatContext *s)
 {
     XMVDemuxContext *xmv = s->priv_data;
     AVIOContext     *pb  = s->pb;
@@ -150,11 +150,11 @@ static int xmv_read_header(AVFormatContext *s,
 
     /* Video track */
 
-    vst = av_new_stream(s, 0);
+    vst = avformat_new_stream(s, NULL);
     if (!vst)
         return AVERROR(ENOMEM);
 
-    av_set_pts_info(vst, 32, 1, 1000);
+    avpriv_set_pts_info(vst, 32, 1, 1000);
 
     vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
     vst->codec->codec_id   = CODEC_ID_WMV2;
@@ -211,7 +211,7 @@ static int xmv_read_header(AVFormatContext *s,
             av_log(s, AV_LOG_WARNING, "Unsupported 5.1 ADPCM audio stream "
                                       "(0x%04X)\n", track->flags);
 
-        ast = av_new_stream(s, audio_track);
+        ast = avformat_new_stream(s, NULL);
         if (!ast)
             return AVERROR(ENOMEM);
 
@@ -224,7 +224,7 @@ static int xmv_read_header(AVFormatContext *s,
         ast->codec->bit_rate              = track->bit_rate;
         ast->codec->block_align           = 36 * track->channels;
 
-        av_set_pts_info(ast, 32, track->block_samples, track->sample_rate);
+        avpriv_set_pts_info(ast, 32, track->block_samples, track->sample_rate);
 
         packet->stream_index = ast->index;
 
@@ -235,17 +235,8 @@ static int xmv_read_header(AVFormatContext *s,
     /** Initialize the packet context */
 
     xmv->next_packet_offset = avio_tell(pb);
-
-    xmv->next_packet_size = this_packet_size - xmv->next_packet_offset;
-    xmv->this_packet_size = 0;
-
-    xmv->video.current_frame = 0;
-    xmv->video.frame_count   = 0;
-    xmv->video.pts           = 0;
-    xmv->video.last_pts      = 0;
-
-    xmv->current_stream = 0;
-    xmv->stream_count   = xmv->audio_track_count + 1;
+    xmv->next_packet_size   = this_packet_size - xmv->next_packet_offset;
+    xmv->stream_count       = xmv->audio_track_count + 1;
 
     return 0;
 }