fixed: playback from mmst:// urls would halt after some time.
authorspiff <spiff@xbmc.org>
Tue, 17 Jan 2012 21:47:36 +0000 (22:47 +0100)
committerspiff <spiff@xbmc.org>
Tue, 17 Jan 2012 21:50:13 +0000 (22:50 +0100)
this backports upstream 275189a2bd71cf49d66374c44d3de2262d323460

thanks to johoja for doing the ground work

lib/ffmpeg/libavformat/mmst.c

index 8464d3b..385f017 100644 (file)
@@ -290,8 +290,7 @@ static MMSSCPacketType get_tcp_server_response(MMSTContext *mmst)
                 return read_result < 0 ? read_result : AVERROR_IO;
             }
             packet_type= AV_RL16(mms->in_buffer+36);
-            hr = AV_RL32(mms->in_buffer + 40);
-            if (hr) {
+            if (read_result >= 44 && (hr = AV_RL32(mms->in_buffer + 40))) {
                 av_log(NULL, AV_LOG_ERROR,
                        "Server sent an error status code: 0x%08x\n", hr);
                 return AVERROR_UNKNOWN;