1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-12 19:31:53 +00:00

fix #304, fix hls bug, write pts/dts error. 2.0.124.

This commit is contained in:
winlin 2015-02-24 18:39:31 +08:00
parent a3648063d5
commit 1cb8e44b1b
4 changed files with 14 additions and 5 deletions

View file

@ -532,6 +532,7 @@ Supported operating systems and hardware:
### SRS 2.0 history
* v2.0, 2015-02-24, for [#304](https://github.com/winlinvip/simple-rtmp-server/issues/304), fix hls bug, write pts/dts error. 2.0.124.
* v2.0, 2015-02-24, fix [#179](https://github.com/winlinvip/simple-rtmp-server/issues/179), support dvr http api. 2.0.123.
* v2.0, 2015-02-19, refine dvr, append file when dvr file exists. 2.0.122.
* v2.0, 2015-02-19, refine pithy print to more easyer to use. 2.0.121.

View file

@ -928,6 +928,8 @@ int SrsHls::on_audio(SrsSharedPtrMessage* __audio)
return ret;
}
}
srs_info("audio decoded, type=%d, codec=%d, cts=%d, size=%d, time=%"PRId64,
sample->frame_type, codec->audio_codec_id, sample->cts, audio->size, audio->timestamp);
SrsCodecAudio acodec = (SrsCodecAudio)codec->audio_codec_id;
// ts support audio codec: aac/mp3

View file

@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// current release version
#define VERSION_MAJOR 2
#define VERSION_MINOR 0
#define VERSION_REVISION 123
#define VERSION_REVISION 124
// server info.
#define RTMP_SIG_SRS_KEY "SRS"

View file

@ -1960,16 +1960,16 @@ int SrsTsPayloadPES::encode_33bits_dts_pts(SrsStream* stream, u_int8_t fb, int64
char* p = stream->data() + stream->pos();
stream->skip(5);
int32_t val;
int32_t val = 0;
val = fb << 4 | (((pts >> 30) & 0x07) << 1) | 1;
val = fb << 4 | (((v >> 30) & 0x07) << 1) | 1;
*p++ = val;
val = (((pts >> 15) & 0x7fff) << 1) | 1;
val = (((v >> 15) & 0x7fff) << 1) | 1;
*p++ = (val >> 8);
*p++ = val;
val = (((pts) & 0x7fff) << 1) | 1;
val = (((v) & 0x7fff) << 1) | 1;
*p++ = (val >> 8);
*p++ = val;
@ -2653,6 +2653,9 @@ int SrsTSMuxer::update_acodec(SrsCodecAudio ac)
int SrsTSMuxer::write_audio(SrsTsMessage* audio)
{
int ret = ERROR_SUCCESS;
srs_info("hls: write audio pts=%"PRId64", dts=%"PRId64", size=%d",
audio->pts, audio->dts, audio->PES_packet_length);
if ((ret = context->encode(writer, audio, vcodec, acodec)) != ERROR_SUCCESS) {
srs_error("hls encode audio failed. ret=%d", ret);
@ -2666,6 +2669,9 @@ int SrsTSMuxer::write_audio(SrsTsMessage* audio)
int SrsTSMuxer::write_video(SrsTsMessage* video)
{
int ret = ERROR_SUCCESS;
srs_info("hls: write video pts=%"PRId64", dts=%"PRId64", size=%d",
video->pts, video->dts, video->PES_packet_length);
if ((ret = context->encode(writer, video, vcodec, acodec)) != ERROR_SUCCESS) {
srs_error("hls encode video failed. ret=%d", ret);