mirror of https://github.com/FFmpeg/FFmpeg.git
Compare commits
2 Commits
8c633f45b0
...
4deb8b3a7a
| Author | SHA1 | Date |
|---|---|---|
|
|
4deb8b3a7a | |
|
|
68152978b5 |
|
|
@ -6536,7 +6536,8 @@ static int mov_flush_fragment(AVFormatContext *s, int force)
|
||||||
mov->tracks[i].data_offset = pos + moov_size + 8;
|
mov->tracks[i].data_offset = pos + moov_size + 8;
|
||||||
|
|
||||||
avio_write_marker(s->pb, AV_NOPTS_VALUE, AVIO_DATA_MARKER_HEADER);
|
avio_write_marker(s->pb, AV_NOPTS_VALUE, AVIO_DATA_MARKER_HEADER);
|
||||||
if (mov->flags & FF_MOV_FLAG_DELAY_MOOV)
|
if (mov->flags & FF_MOV_FLAG_DELAY_MOOV &&
|
||||||
|
!(mov->flags & FF_MOV_FLAG_HYBRID_FRAGMENTED))
|
||||||
mov_write_identification(s->pb, s);
|
mov_write_identification(s->pb, s);
|
||||||
if ((ret = mov_write_moov_tag(s->pb, mov, s)) < 0)
|
if ((ret = mov_write_moov_tag(s->pb, mov, s)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
@ -8413,7 +8414,8 @@ static int mov_write_header(AVFormatContext *s)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(mov->flags & FF_MOV_FLAG_DELAY_MOOV)) {
|
if (!(mov->flags & FF_MOV_FLAG_DELAY_MOOV) ||
|
||||||
|
(mov->flags & FF_MOV_FLAG_HYBRID_FRAGMENTED)) {
|
||||||
if ((ret = mov_write_identification(pb, s)) < 0)
|
if ((ret = mov_write_identification(pb, s)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,16 +16,15 @@
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <pthread.h>
|
|
||||||
|
|
||||||
#include <glslang/build_info.h>
|
#include <glslang/build_info.h>
|
||||||
#include <glslang/Include/glslang_c_interface.h>
|
#include <glslang/Include/glslang_c_interface.h>
|
||||||
|
|
||||||
#include "vulkan_spirv.h"
|
#include "vulkan_spirv.h"
|
||||||
#include "libavutil/mem.h"
|
#include "libavutil/mem.h"
|
||||||
#include "libavutil/avassert.h"
|
#include "libavutil/avassert.h"
|
||||||
|
#include "libavutil/thread.h"
|
||||||
|
|
||||||
static pthread_mutex_t glslc_mutex = PTHREAD_MUTEX_INITIALIZER;
|
static AVMutex glslc_mutex = AV_MUTEX_INITIALIZER;
|
||||||
static int glslc_refcount = 0;
|
static int glslc_refcount = 0;
|
||||||
|
|
||||||
static const glslang_resource_t glslc_resource_limits = {
|
static const glslang_resource_t glslc_resource_limits = {
|
||||||
|
|
@ -277,10 +276,10 @@ static void glslc_uninit(FFVkSPIRVCompiler **ctx)
|
||||||
if (!ctx || !*ctx)
|
if (!ctx || !*ctx)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
pthread_mutex_lock(&glslc_mutex);
|
ff_mutex_lock(&glslc_mutex);
|
||||||
if (glslc_refcount && (--glslc_refcount == 0))
|
if (glslc_refcount && (--glslc_refcount == 0))
|
||||||
glslang_finalize_process();
|
glslang_finalize_process();
|
||||||
pthread_mutex_unlock(&glslc_mutex);
|
ff_mutex_unlock(&glslc_mutex);
|
||||||
|
|
||||||
av_freep(ctx);
|
av_freep(ctx);
|
||||||
}
|
}
|
||||||
|
|
@ -295,14 +294,14 @@ FFVkSPIRVCompiler *ff_vk_glslang_init(void)
|
||||||
ret->free_shader = glslc_shader_free;
|
ret->free_shader = glslc_shader_free;
|
||||||
ret->uninit = glslc_uninit;
|
ret->uninit = glslc_uninit;
|
||||||
|
|
||||||
pthread_mutex_lock(&glslc_mutex);
|
ff_mutex_lock(&glslc_mutex);
|
||||||
if (!glslc_refcount++) {
|
if (!glslc_refcount++) {
|
||||||
if (!glslang_initialize_process()) {
|
if (!glslang_initialize_process()) {
|
||||||
av_freep(&ret);
|
av_freep(&ret);
|
||||||
glslc_refcount--;
|
glslc_refcount--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pthread_mutex_unlock(&glslc_mutex);
|
ff_mutex_unlock(&glslc_mutex);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue