~medibuntu-maintainers/mplayer/medibuntu.precise

« back to all changes in this revision

Viewing changes to ffmpeg/libavformat/librtmp.c

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2012-01-12 22:23:28 UTC
  • mfrom: (0.4.7 sid)
  • mto: This revision was merged to the branch mainline in revision 76.
  • Revision ID: package-import@ubuntu.com-20120112222328-8jqdyodym3p84ygu
Tags: 2:1.0~rc4.dfsg1+svn34540-1
* New upstream snapshot
* upload to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 * RTMP protocol based on http://rtmpdump.mplayerhq.hu/ librtmp
25
25
 */
26
26
 
 
27
#include "libavutil/mathematics.h"
27
28
#include "avformat.h"
28
29
#include "url.h"
29
30
 
51
52
    RTMP *r = s->priv_data;
52
53
 
53
54
    RTMP_Close(r);
54
 
    av_free(r);
55
55
    return 0;
56
56
}
57
57
 
69
69
 */
70
70
static int rtmp_open(URLContext *s, const char *uri, int flags)
71
71
{
72
 
    RTMP *r;
 
72
    RTMP *r = s->priv_data;
73
73
    int rc;
74
74
 
75
 
    r = av_mallocz(sizeof(RTMP));
76
 
    if (!r)
77
 
        return AVERROR(ENOMEM);
78
 
 
79
75
    switch (av_log_get_level()) {
80
76
    default:
81
77
    case AV_LOG_FATAL:   rc = RTMP_LOGCRIT;    break;
102
98
        goto fail;
103
99
    }
104
100
 
105
 
    s->priv_data   = r;
106
101
    s->is_streamed = 1;
107
102
    return 0;
108
103
fail:
109
 
    av_free(r);
110
104
    return rc;
111
105
}
112
106
 
166
160
    .url_close           = rtmp_close,
167
161
    .url_read_pause      = rtmp_read_pause,
168
162
    .url_read_seek       = rtmp_read_seek,
169
 
    .url_get_file_handle = rtmp_get_file_handle
 
163
    .url_get_file_handle = rtmp_get_file_handle,
 
164
    .priv_data_size      = sizeof(RTMP),
 
165
    .flags               = URL_PROTOCOL_FLAG_NETWORK,
170
166
};
171
167
 
172
168
URLProtocol ff_rtmpt_protocol = {
177
173
    .url_close           = rtmp_close,
178
174
    .url_read_pause      = rtmp_read_pause,
179
175
    .url_read_seek       = rtmp_read_seek,
180
 
    .url_get_file_handle = rtmp_get_file_handle
 
176
    .url_get_file_handle = rtmp_get_file_handle,
 
177
    .priv_data_size      = sizeof(RTMP),
 
178
    .flags               = URL_PROTOCOL_FLAG_NETWORK,
181
179
};
182
180
 
183
181
URLProtocol ff_rtmpe_protocol = {
188
186
    .url_close           = rtmp_close,
189
187
    .url_read_pause      = rtmp_read_pause,
190
188
    .url_read_seek       = rtmp_read_seek,
191
 
    .url_get_file_handle = rtmp_get_file_handle
 
189
    .url_get_file_handle = rtmp_get_file_handle,
 
190
    .priv_data_size      = sizeof(RTMP),
 
191
    .flags               = URL_PROTOCOL_FLAG_NETWORK,
192
192
};
193
193
 
194
194
URLProtocol ff_rtmpte_protocol = {
199
199
    .url_close           = rtmp_close,
200
200
    .url_read_pause      = rtmp_read_pause,
201
201
    .url_read_seek       = rtmp_read_seek,
202
 
    .url_get_file_handle = rtmp_get_file_handle
 
202
    .url_get_file_handle = rtmp_get_file_handle,
 
203
    .priv_data_size      = sizeof(RTMP),
 
204
    .flags               = URL_PROTOCOL_FLAG_NETWORK,
203
205
};
204
206
 
205
207
URLProtocol ff_rtmps_protocol = {
210
212
    .url_close           = rtmp_close,
211
213
    .url_read_pause      = rtmp_read_pause,
212
214
    .url_read_seek       = rtmp_read_seek,
213
 
    .url_get_file_handle = rtmp_get_file_handle
 
215
    .url_get_file_handle = rtmp_get_file_handle,
 
216
    .priv_data_size      = sizeof(RTMP),
 
217
    .flags               = URL_PROTOCOL_FLAG_NETWORK,
214
218
};