Skip to content

Commit

Permalink
修改了原版本的 libfmp4 文件夹,fmp4--->TS文件部分代码(之前有跑死机的BUG)
Browse files Browse the repository at this point in the history
  • Loading branch information
YuanDaYu002 committed Mar 3, 2019
1 parent ec199ef commit 316eb2f
Show file tree
Hide file tree
Showing 10 changed files with 339 additions and 231 deletions.
5 changes: 3 additions & 2 deletions libfmp4Encode/hls_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ int generate_playlist_test(char* filename, char* playlist, int* numberofchunks)
return -1;
}

//---打开文件--------------------------------------------
//---打开mp4文件--------------------------------------------
handle = (char*)malloc(source->handler_size);
if ( !handle )
{
Expand All @@ -121,7 +121,7 @@ int generate_playlist_test(char* filename, char* playlist, int* numberofchunks)
return -1;
}


//---获取文件的状态信息--------------------------------------------
stats_size = media->get_media_stats(NULL, handle, source, NULL, 0);
stats_buffer = (char*)malloc(stats_size);
if ( !stats_buffer )
Expand All @@ -134,6 +134,7 @@ int generate_playlist_test(char* filename, char* playlist, int* numberofchunks)

stats_size = media->get_media_stats(NULL, handle, source, (media_stats_t*)stats_buffer, stats_size);

//---生成m3u8文件--------------------------------------------
DEBUG_LOG("into position G\n");
pure_filename = get_pure_filename(filename); //get only filename without any directory info
if (pure_filename)
Expand Down
2 changes: 1 addition & 1 deletion libfmp4Encode/hls_media.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ typedef struct track_data_t{
char* buffer; //实际帧数据的开始位置
int buffer_size; //实际帧数据的总大小
int* size; //帧的大小信息的指针(理解为数组的指针)
int* offset; //帧的偏移量信息的指针(理解为数组的指针)(相较于 buffer开始位置
int* offset; //帧的偏移量信息的指针(理解为数组的指针)(相较于 buffer/TS文件 开始位置
int frames_written; //记录已经写入到TS文件(缓冲区)的帧数
int data_start_offset;
int cc; //mpeg2 ts continuity counter
Expand Down
Loading

0 comments on commit 316eb2f

Please sign in to comment.