Revision 99b2ac07

View differences:

libavformat/rtsp.c
1372 1372
    av_log(s, AV_LOG_DEBUG, "hello state=%d\n", rt->state);
1373 1373

  
1374 1374
    if (!(rt->server_type == RTSP_SERVER_RDT && rt->need_subscription)) {
1375
    if (rt->state == RTSP_STATE_PAUSED) {
1376
        snprintf(cmd, sizeof(cmd),
1377
                 "PLAY %s RTSP/1.0\r\n",
1378
                 s->filename);
1379
    } else {
1380
        snprintf(cmd, sizeof(cmd),
1381
                 "PLAY %s RTSP/1.0\r\n"
1382
                 "Range: npt=%0.3f-\r\n",
1383
                 s->filename,
1384
                 (double)rt->seek_timestamp / AV_TIME_BASE);
1385
    }
1386
    rtsp_send_cmd(s, cmd, reply, NULL);
1387
    if (reply->status_code != RTSP_STATUS_OK) {
1388
        return -1;
1389
    }
1375
        if (rt->state == RTSP_STATE_PAUSED) {
1376
            snprintf(cmd, sizeof(cmd),
1377
                     "PLAY %s RTSP/1.0\r\n",
1378
                     s->filename);
1379
        } else {
1380
            snprintf(cmd, sizeof(cmd),
1381
                     "PLAY %s RTSP/1.0\r\n"
1382
                     "Range: npt=%0.3f-\r\n",
1383
                     s->filename,
1384
                     (double)rt->seek_timestamp / AV_TIME_BASE);
1385
        }
1386
        rtsp_send_cmd(s, cmd, reply, NULL);
1387
        if (reply->status_code != RTSP_STATUS_OK) {
1388
            return -1;
1389
        }
1390 1390
    }
1391 1391
    rt->state = RTSP_STATE_PLAYING;
1392 1392
    return 0;
......
1404 1404
    if (rt->state != RTSP_STATE_PLAYING)
1405 1405
        return 0;
1406 1406
    else if (!(rt->server_type == RTSP_SERVER_RDT && rt->need_subscription)) {
1407
    snprintf(cmd, sizeof(cmd),
1408
             "PAUSE %s RTSP/1.0\r\n",
1409
             s->filename);
1410
    rtsp_send_cmd(s, cmd, reply, NULL);
1411
    if (reply->status_code != RTSP_STATUS_OK) {
1412
        return -1;
1413
    }
1407
        snprintf(cmd, sizeof(cmd),
1408
                 "PAUSE %s RTSP/1.0\r\n",
1409
                 s->filename);
1410
        rtsp_send_cmd(s, cmd, reply, NULL);
1411
        if (reply->status_code != RTSP_STATUS_OK) {
1412
            return -1;
1413
        }
1414 1414
    }
1415 1415
    rt->state = RTSP_STATE_PAUSED;
1416 1416
    return 0;

Also available in: Unified diff