aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/mmst.c
diff options
context:
space:
mode:
authorZhentan Feng <spyfeng@gmail.com>2010-08-04 22:32:43 +0000
committerRonald S. Bultje <rsbultje@gmail.com>2010-08-04 22:32:43 +0000
commitb949875bf63af5ae8d431a9b0a8091430994d32c (patch)
tree63deddf8f7f8ffeb154d4a5dbdd80386f13b6eac /libavformat/mmst.c
parent4c3fbd4f93a48d74b81f19ece195a7e58369a542 (diff)
downloadffmpeg-b949875bf63af5ae8d431a9b0a8091430994d32c.tar.gz
Move send_media_packet_request() and clear_stream_buffers() up.
Patch by Zhentan Feng <spyfeng gmail com>. Originally committed as revision 24698 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/mmst.c')
-rw-r--r--libavformat/mmst.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/libavformat/mmst.c b/libavformat/mmst.c
index 55c67a82d8..eb636d1561 100644
--- a/libavformat/mmst.c
+++ b/libavformat/mmst.c
@@ -620,6 +620,30 @@ static int mms_close(URLContext *h)
return 0;
}
+static int send_media_packet_request(MMSContext *mms)
+{
+ start_command_packet(mms, CS_PKT_START_FROM_PKT_ID);
+ insert_command_prefixes(mms, 1, 0x0001FFFF);
+ bytestream_put_le64(&mms->write_out_ptr, 0); // seek timestamp
+ bytestream_put_le32(&mms->write_out_ptr, 0xffffffff); // unknown
+ bytestream_put_le32(&mms->write_out_ptr, 0xffffffff); // packet offset
+ bytestream_put_byte(&mms->write_out_ptr, 0xff); // max stream time limit
+ bytestream_put_byte(&mms->write_out_ptr, 0xff); // max stream time limit
+ bytestream_put_byte(&mms->write_out_ptr, 0xff); // max stream time limit
+ bytestream_put_byte(&mms->write_out_ptr, 0x00); // stream time limit flag
+
+ mms->packet_id++; // new packet_id
+ bytestream_put_le32(&mms->write_out_ptr, mms->packet_id);
+ return send_command_packet(mms);
+}
+
+
+static void clear_stream_buffers(MMSContext *mms)
+{
+ mms->remaining_in_len = 0;
+ mms->read_in_ptr = mms->in_buffer;
+}
+
static int mms_open(URLContext *h, const char *uri, int flags)
{
MMSContext *mms;
@@ -685,30 +709,6 @@ fail:
return err;
}
-static int send_media_packet_request(MMSContext *mms)
-{
- start_command_packet(mms, CS_PKT_START_FROM_PKT_ID);
- insert_command_prefixes(mms, 1, 0x0001FFFF);
- bytestream_put_le64(&mms->write_out_ptr, 0); // seek timestamp
- bytestream_put_le32(&mms->write_out_ptr, 0xffffffff); // unknown
- bytestream_put_le32(&mms->write_out_ptr, 0xffffffff); // packet offset
- bytestream_put_byte(&mms->write_out_ptr, 0xff); // max stream time limit
- bytestream_put_byte(&mms->write_out_ptr, 0xff); // max stream time limit
- bytestream_put_byte(&mms->write_out_ptr, 0xff); // max stream time limit
- bytestream_put_byte(&mms->write_out_ptr, 0x00); // stream time limit flag
-
- mms->packet_id++; // new packet_id
- bytestream_put_le32(&mms->write_out_ptr, mms->packet_id);
- return send_command_packet(mms);
-}
-
-
-static void clear_stream_buffers(MMSContext *mms)
-{
- mms->remaining_in_len = 0;
- mms->read_in_ptr = mms->in_buffer;
-}
-
/** Read ASF data through the protocol. */
static int mms_read(URLContext *h, uint8_t *buf, int size)
{