Browse code

Fix deprecated warnings in .bit (de)muxer

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Vladimir Voroshilov authored on 2011/10/30 12:52:06
Showing 1 changed files
... ...
@@ -50,7 +50,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
50 50
 {
51 51
     AVStream* st;
52 52
 
53
-    st=av_new_stream(s, 0);
53
+    st=avformat_new_stream(s, NULL);
54 54
     if (!st)
55 55
         return AVERROR(ENOMEM);
56 56
 
... ...
@@ -67,7 +67,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
67 67
 static int read_packet(AVFormatContext *s,
68 68
                           AVPacket *pkt)
69 69
 {
70
-    ByteIOContext *pb = s->pb;
70
+    AVIOContext *pb = s->pb;
71 71
     PutBitContext pbo;
72 72
     uint16_t buf[8 * MAX_FRAME_SIZE + 2];
73 73
     int packet_size;
... ...
@@ -78,12 +78,12 @@ static int read_packet(AVFormatContext *s,
78 78
     if(url_feof(pb))
79 79
         return AVERROR_EOF;
80 80
 
81
-    get_le16(pb); // sync word
82
-    packet_size = get_le16(pb) / 8;
81
+    avio_rl16(pb); // sync word
82
+    packet_size = avio_rl16(pb) / 8;
83 83
     if(packet_size > MAX_FRAME_SIZE)
84 84
         return AVERROR_INVALIDDATA;
85 85
 
86
-    ret = get_buffer(pb, (uint8_t*)buf, (8 * packet_size) * sizeof(uint16_t));
86
+    ret = avio_read(pb, (uint8_t*)buf, (8 * packet_size) * sizeof(uint16_t));
87 87
     if(ret<0)
88 88
         return ret;
89 89
     if(ret != 8 * packet_size * sizeof(uint16_t))
... ...
@@ -131,13 +131,13 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
131 131
     GetBitContext gb;
132 132
     int i;
133 133
 
134
-    put_le16(pb, SYNC_WORD);
135
-    put_le16(pb, 8 * 10);
134
+    avio_wl16(pb, SYNC_WORD);
135
+    avio_wl16(pb, 8 * 10);
136 136
 
137 137
     init_get_bits(&gb, pkt->data, 8*10);
138 138
     for(i=0; i< 8 * 10; i++)
139
-        put_le16(pb, get_bits1(&gb) ? BIT_1 : BIT_0);
140
-    put_flush_packet(pb);
139
+        avio_wl16(pb, get_bits1(&gb) ? BIT_1 : BIT_0);
140
+    avio_flush(pb);
141 141
 
142 142
     return 0;
143 143
 }